intel / ros2_intel_realsense

This project is deprecated and no more maintained. Please visit https://github.com/IntelRealSense/realsense-ros for ROS2 wrapper.
Apache License 2.0
140 stars 96 forks source link

Build Error on MacOS ROS2 Foxy and Refactor Branch #144

Open AndrewJSchoen opened 4 years ago

AndrewJSchoen commented 4 years ago

Platform: MacOS ROS Distro: Foxy Realsense Branch: refactor

What I did: I installed librealsense and pyrealsense2 using the information from a number of sources, and was able to test this as working by running the following example. However, when running colcon build --symlink-install I get the following error:

--- stderr: realsense_ros                                      
/Users/me/ROS/ros2_specification/src/ros2_intel_realsense/realsense_ros/src/rs_base.cpp:42:9: warning: 'set_on_parameters_set_callback' is deprecated: use add_on_set_parameters_callback(OnParametersSetCallbackType callback) instead [-Wdeprecated-declarations]
  node_.set_on_parameters_set_callback(
        ^
/Users/schoen/ROS/ros2_foxy/install/rclcpp/include/rclcpp/node.hpp:860:5: note: 'set_on_parameters_set_callback' has been explicitly marked deprecated here
  [[deprecated("use add_on_set_parameters_callback(OnParametersSetCallbackType callback) instead")]]
    ^
/Users/schoen/ROS/ros2_specification/src/ros2_intel_realsense/realsense_ros/src/rs_base.cpp:154:16: warning: variable 'fps' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    } else if (stream == FISHEYE1 || stream == FISHEYE2) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/schoen/ROS/ros2_specification/src/ros2_intel_realsense/realsense_ros/src/rs_base.cpp:175:78: note: uninitialized use occurs here
    VideoStreamInfo info(static_cast<int>(res[0]), static_cast<int>(res[1]), fps);
                                                                             ^~~
/Users/schoen/ROS/ros2_specification/src/ros2_intel_realsense/realsense_ros/src/rs_base.cpp:154:12: note: remove the 'if' if its condition is always true
    } else if (stream == FISHEYE1 || stream == FISHEYE2) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/schoen/ROS/ros2_specification/src/ros2_intel_realsense/realsense_ros/src/rs_base.cpp:135:12: note: initialize the variable 'fps' to silence this warning
    int fps;
           ^
            = 0
/Users/schoen/ROS/ros2_specification/src/ros2_intel_realsense/realsense_ros/src/rs_factory.cpp:103:80: error: cannot pass object of non-trivial type 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char> >') through variadic function; call will abort at runtime [-Wnon-pod-varargs]
      RCLCPP_ERROR(this->get_logger(), "Unsupported device! Product ID: 0x%s", pid_str);
                                                                               ^
1 error generated.
make[2]: *** [CMakeFiles/realsense_ros.dir/src/rs_factory.cpp.o] Error 1

Not sure if this is due to the operating system, ROS2 version, branch, or a combination. I am happy to provide any other information that would be useful.