Code Monkey home page Code Monkey logo

Comments (5)

puzzlepaint avatar puzzlepaint commented on July 17, 2024

I don't see how this could happen. Looking at the following file:
https://github.com/ETH3D/badslam/blob/master/applications/badslam/src/badslam/input_realsense.h
It seems that either the RealSense support gets compiled into the binary, or the fatal error message at input_realsense.h:99, but never both at the same time. Thus, I suspect that when you ran badslam with gui, it was a different binary than the one that generated the log quoted above. At least I don't see any other possibility at the moment.

from badslam.

AreteQin avatar AreteQin commented on July 17, 2024

Thanks for your response.

I double-checked, and I can confirm that I am running the same binary file.

from badslam.

AreteQin avatar AreteQin commented on July 17, 2024

Hi,

I muted the following code to force it compile the correct part.

//#ifdef BAD_SLAM_HAVE_REALSENSE
#include <librealsense2/rs.hpp>
//#endif
//#else
//#ifdef BAD_SLAM_HAVE_REALSENSE
//// Dummy version of RealSenseInputThread which replaces the actual version in
//// case the program is compiled without librealsense2. Asserts if any of its
//// functions are called.
//    class RealSenseInputThread {
//    public:
//        inline void Start(RGBDVideo<Vec3u8, u16>* rgbd_video, float* depth_scaling) {
//            (void) rgbd_video;
//            (void) depth_scaling;
//                    LOG(FATAL) << "RealSense input requested, but the program was compiled without RealSense support.";
//        }
//
//        inline void GetNextFrame() {
//                    LOG(FATAL) << "RealSense input requested, but the program was compiled without RealSense support.";
//        }
//    };
//#endif

And I am able to run the realsense without gui.

from badslam.

puzzlepaint avatar puzzlepaint commented on July 17, 2024

Thanks for double-checking. I think I found the issue: The define BAD_SLAM_HAVE_REALSENSE is mistakenly added only to the badslam_baselib target, rather than also to the executable target. That's why the input_realsense.h header is compiled differently when included from the latter target.

In applications/badslam/CMakeLists.txt:

    target_compile_options(badslam_baselib
      PRIVATE
        $<$<COMPILE_LANGUAGE:CXX>:-DBAD_SLAM_HAVE_REALSENSE>
    )

While I can't test it right now, I believe that changing the "PRIVATE" to "PUBLIC" here should be the proper fix for this issue.
Sorry for suspecting a wrong cause.

from badslam.

AreteQin avatar AreteQin commented on July 17, 2024

Thanks a lot. I changed private to public, and it's working well now.

from badslam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.