IntelRealSense / realsense-ros

ROS Wrapper for Intel(R) RealSense(TM) Cameras
http://wiki.ros.org/RealSense
Apache License 2.0
2.61k stars 1.77k forks source link

Noob-question: installation #2544

Closed ryanmaxwell96 closed 1 year ago

ryanmaxwell96 commented 2 years ago

Hello,

Sorry for the newbie question, but I'm not familiar with how to install the package from a tar.gz file. I downloaded the Source.tar.gz file and extracted it to a folder I made so it looks like: ~/ros2_elequent_camera/src/realsense-ros-3.1.0

I saw online that I'm supposed to be able to install by running cmake ../realsense-ros-3.1.0 but I get this error when I run that:

CMake Error at CMakeLists.txt:94 (find_package): By not providing "Findrealsense_camera_msgs.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "realsense_camera_msgs", but CMake did not find one.

Could not find a package configuration file provided by "realsense_camera_msgs" with any of the following names:

realsense_camera_msgsConfig.cmake
realsense_camera_msgs-config.cmake

Add the installation prefix of "realsense_camera_msgs" to CMAKE_PREFIX_PATH or set "realsense_camera_msgs_DIR" to a directory containing one of the above files. If "realsense_camera_msgs" provides a separate development package or SDK, be sure it has been installed.

I am using Ubuntu 18.04 and ros2-eloquent.

Thanks for any help anyone can give!

MartyG-RealSense commented 2 years ago

Hi @ryanmaxwell96 The 3.1.0 Eloquent ROS2 wrapper is very old, dating back to September 2020, and is now obsolete. It dates back to a time when there were two separate individual ROS2 wrappers for Eloquent and Foxy, and then the two wrappers were merged into one from 3.2.2 onwards. After that, this wrapper became obsolete as a new wrapper ros2-development (formerly ros2_beta) was introduced. ros2-development is now the default RealSense ROS wrapper and is compatible with Eloquent if Ubuntu 18.04 is being used.

https://github.com/IntelRealSense/realsense-ros/releases/tag/4.51.1

I would not recommend using an old wrapper version such as 3.1.0 unless your project needs to use an old librealsense SDK version, such as the 2.38.1 SDK version that matches with 3.1.0 (it is important to match a particular ROS wrapper version with a particular SDK version listed in that wrapper version's release notes).


When building the RealSense ROS wrapper from source code, the librealsense SDK should be installed first and then the ROS wrapper installed secondly once librealsense has been confirmed to work successfully.

With the current modern ros2-development wrapper (currently at version 4.51.1 which should be matched to librealsense SDK version 2.51.1), once librealsense has been installed then you can build the wrapper with the instructions at the link below by cloning it into your ROS2 workspace instead of using the tar.gz file.

https://github.com/IntelRealSense/realsense-ros/#step-3-install-intel-realsense-ros2-wrapper-from-sources

MartyG-RealSense commented 2 years ago

Generally, a RealSense ROS wrapper installation involves either installing the librealsense SDK and ROS wrapper together at the same time from packages using apt-get install, or instead building the wrapper from source code by cloning its GitHub. So unless you need to modify the source code of the ROS wrapper, you are not likely to need to use the zip or tar.gz files to install the wrapper.

If the apt-get install method (Method 1 of the wrapper instructions) is used then you do not need to install librealsense separately, as this method will install librealsense automatically for you.

ryanmaxwell96 commented 2 years ago

Ok thanks for the all the info. I'm using a Jetson AGX. Will apt-get install still work? If so, what is the full command?

I have librealsense 2.51.1 installed. Running "realsense-viewer" shows 2.51.1. Also, the command "apt list librealsense2" returns

librealsense2/bionic,now 2.51.1-0~realsense0.476 arm64 [installed,automatic] N: There are 13 additional versions. Please use the '-a' switch to see them.

Also, my D435i works when plugged in.

I have tried following all of the steps in this link, but it fails at colcon build. https://github.com/IntelRealSense/realsense-ros/#step-3-install-intel-realsense-ros2-wrapper-from-sources

I believe my ros2 installation of eloquent should be working as I can run turtlesim node successfully.

The most significant errors I get are: error: ‘hdr_merge’ is not a member of ‘rs2’ error: no matching function for call to ‘make_shared< >()’ error: ‘sequence_id_filter’ is not a member of ‘rs2’

Here is the full terminal output I received after running colcon build:

/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:526:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers] const int get_data_size() const ^~~~~ In file included from /opt/ros/eloquent/include/librealsense2/hpp/rs_sensor.hpp:8:0, from /opt/ros/eloquent/include/librealsense2/hpp/rs_device.hpp:8, from /opt/ros/eloquent/include/librealsense2/hpp/rs_record_playback.hpp:8, from /opt/ros/eloquent/include/librealsense2/hpp/rs_context.hpp:8, from /opt/ros/eloquent/include/librealsense2/rs.hpp:9, from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/base_realsense_node.h:6, from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/parameters.cpp:4: /opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:526:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers] const int get_data_size() const ^~~~~ /opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function: /opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1020:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] frm.get_profile().stream_index() == index) f = frm;


/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1042:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1064:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1020:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1042:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from /opt/ros/eloquent/include/librealsense2/hpp/rs_sensor.hpp:8:0,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_device.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_record_playback.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_context.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/rs.hpp:9,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/base_realsense_node.h:6,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:4:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:526:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
         const int get_data_size() const
         ^~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1064:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1020:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1042:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1064:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from /opt/ros/eloquent/include/librealsense2/hpp/rs_sensor.hpp:8:0,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_device.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_record_playback.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_context.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/rs.hpp:9,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/base_realsense_node.h:6,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/realsense_node_factory.h:8,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/realsense_node_factory.cpp:4:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:526:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
         const int get_data_size() const
         ^~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1020:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1042:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1064:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp: In member function ‘void realsense2_camera::BaseRealSenseNode::setupFilters()’:
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:154:76: error: ‘hdr_merge’ is not a member of ‘rs2’
     _filters.push_back(std::make_shared<NamedFilter>(std::make_shared<rs2::hdr_merge>(), _parameters, _logger));
                                                                            ^~~~~~~~~
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:154:76: error: ‘hdr_merge’ is not a member of ‘rs2’
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:154:87: error: no matching function for call to ‘make_shared<<expression error> >()’
     _filters.push_back(std::make_shared<NamedFilter>(std::make_shared<rs2::hdr_merge>(), _parameters, _logger));
                                                                                       ^
In file included from /usr/include/c++/7/memory:81:0,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_types.hpp:18,
                 from /opt/ros/eloquent/include/librealsense2/rs.hpp:8,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/base_realsense_node.h:6,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:4:
/usr/include/c++/7/bits/shared_ptr.h:703:5: note: candidate: template<class _Tp, class ... _Args> std::shared_ptr<_Tp> std::make_shared(_Args&& ...)
     make_shared(_Args&&... __args)
     ^~~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:703:5: note:   template argument deduction/substitution failed:
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:154:87: error: template argument 1 is invalid
     _filters.push_back(std::make_shared<NamedFilter>(std::make_shared<rs2::hdr_merge>(), _parameters, _logger));
                                                                                       ^
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:155:76: error: ‘sequence_id_filter’ is not a member of ‘rs2’
     _filters.push_back(std::make_shared<NamedFilter>(std::make_shared<rs2::sequence_id_filter>(), _parameters, _logger));
                                                                            ^~~~~~~~~~~~~~~~~~
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:155:76: note: suggested alternative: ‘threshold_filter’
     _filters.push_back(std::make_shared<NamedFilter>(std::make_shared<rs2::sequence_id_filter>(), _parameters, _logger));
                                                                            ^~~~~~~~~~~~~~~~~~
                                                                            threshold_filter
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:155:76: error: ‘sequence_id_filter’ is not a member of ‘rs2’
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:155:76: note: suggested alternative: ‘threshold_filter’
     _filters.push_back(std::make_shared<NamedFilter>(std::make_shared<rs2::sequence_id_filter>(), _parameters, _logger));
                                                                            ^~~~~~~~~~~~~~~~~~
                                                                            threshold_filter
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:155:96: error: no matching function for call to ‘make_shared<<expression error> >()’
     _filters.push_back(std::make_shared<NamedFilter>(std::make_shared<rs2::sequence_id_filter>(), _parameters, _logger));
                                                                                                ^
In file included from /usr/include/c++/7/memory:81:0,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_types.hpp:18,
                 from /opt/ros/eloquent/include/librealsense2/rs.hpp:8,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/base_realsense_node.h:6,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:4:
/usr/include/c++/7/bits/shared_ptr.h:703:5: note: candidate: template<class _Tp, class ... _Args> std::shared_ptr<_Tp> std::make_shared(_Args&& ...)
     make_shared(_Args&&... __args)
     ^~~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:703:5: note:   template argument deduction/substitution failed:
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:155:96: error: template argument 1 is invalid
     _filters.push_back(std::make_shared<NamedFilter>(std::make_shared<rs2::sequence_id_filter>(), _parameters, _logger));
                                                                                                ^
In file included from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/base_realsense_node.h:7:0,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/parameters.cpp:4:
/opt/ros/eloquent/include/librealsense2/rsutil.h: At global scope:
/opt/ros/eloquent/include/librealsense2/rsutil.h:186:13: warning: ‘void rs2_project_color_pixel_to_depth_pixel(float*, const uint16_t*, float, float, float, const rs2_intrinsics*, const rs2_intrinsics*, const rs2_extrinsics*, const rs2_extrinsics*, const float*)’ defined but not used [-Wunused-function]
 static void rs2_project_color_pixel_to_depth_pixel(float to_pixel[2],
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/eloquent/include/librealsense2/rsutil.h:150:13: warning: ‘void rs2_fov(const rs2_intrinsics*, float*)’ defined but not used [-Wunused-function]
 static void rs2_fov(const struct rs2_intrinsics * intrin, float to_fov[2])
             ^~~~~~~
In file included from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/include/base_realsense_node.h:7:0,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/t265_realsense_node.h:6,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/t265_realsense_node.cpp:4:
/opt/ros/eloquent/include/librealsense2/rsutil.h: At global scope:
/opt/ros/eloquent/include/librealsense2/rsutil.h:186:13: warning: ‘void rs2_project_color_pixel_to_depth_pixel(float*, const uint16_t*, float, float, float, const rs2_intrinsics*, const rs2_intrinsics*, const rs2_extrinsics*, const rs2_extrinsics*, const float*)’ defined but not used [-Wunused-function]
 static void rs2_project_color_pixel_to_depth_pixel(float to_pixel[2],
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/eloquent/include/librealsense2/rsutil.h:150:13: warning: ‘void rs2_fov(const rs2_intrinsics*, float*)’ defined but not used [-Wunused-function]
 static void rs2_fov(const struct rs2_intrinsics * intrin, float to_fov[2])
             ^~~~~~~
In file included from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/base_realsense_node.h:7:0,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/realsense_node_factory.h:8,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/realsense_node_factory.cpp:4:
/opt/ros/eloquent/include/librealsense2/rsutil.h: At global scope:
/opt/ros/eloquent/include/librealsense2/rsutil.h:186:13: warning: ‘void rs2_project_color_pixel_to_depth_pixel(float*, const uint16_t*, float, float, float, const rs2_intrinsics*, const rs2_intrinsics*, const rs2_extrinsics*, const rs2_extrinsics*, const float*)’ defined but not used [-Wunused-function]
 static void rs2_project_color_pixel_to_depth_pixel(float to_pixel[2],
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/eloquent/include/librealsense2/rsutil.h:150:13: warning: ‘void rs2_fov(const rs2_intrinsics*, float*)’ defined but not used [-Wunused-function]
 static void rs2_fov(const struct rs2_intrinsics * intrin, float to_fov[2])
             ^~~~~~~
In file included from /opt/ros/eloquent/include/librealsense2/hpp/rs_sensor.hpp:8:0,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_device.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_record_playback.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_context.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/rs.hpp:9,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/base_realsense_node.h:6,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/rs_node_setup.cpp:4:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:526:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
         const int get_data_size() const
         ^~~~~
In file included from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/base_realsense_node.h:7:0,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:4:
/opt/ros/eloquent/include/librealsense2/rsutil.h: At global scope:
/opt/ros/eloquent/include/librealsense2/rsutil.h:186:13: warning: ‘void rs2_project_color_pixel_to_depth_pixel(float*, const uint16_t*, float, float, float, const rs2_intrinsics*, const rs2_intrinsics*, const rs2_extrinsics*, const rs2_extrinsics*, const float*)’ defined but not used [-Wunused-function]
 static void rs2_project_color_pixel_to_depth_pixel(float to_pixel[2],
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/eloquent/include/librealsense2/rsutil.h:150:13: warning: ‘void rs2_fov(const rs2_intrinsics*, float*)’ defined but not used [-Wunused-function]
 static void rs2_fov(const struct rs2_intrinsics * intrin, float to_fov[2])
             ^~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1020:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1042:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1064:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
make[2]: *** [CMakeFiles/realsense2_camera.dir/src/base_realsense_node.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/base_realsense_node.h:7:0,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/rs_node_setup.cpp:4:
/opt/ros/eloquent/include/librealsense2/rsutil.h: At global scope:
/opt/ros/eloquent/include/librealsense2/rsutil.h:186:13: warning: ‘void rs2_project_color_pixel_to_depth_pixel(float*, const uint16_t*, float, float, float, const rs2_intrinsics*, const rs2_intrinsics*, const rs2_extrinsics*, const rs2_extrinsics*, const float*)’ defined but not used [-Wunused-function]
 static void rs2_project_color_pixel_to_depth_pixel(float to_pixel[2],
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/eloquent/include/librealsense2/rsutil.h:150:13: warning: ‘void rs2_fov(const rs2_intrinsics*, float*)’ defined but not used [-Wunused-function]
 static void rs2_fov(const struct rs2_intrinsics * intrin, float to_fov[2])
             ^~~~~~~
make[1]: *** [CMakeFiles/realsense2_camera.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< realsense2_camera [59.6s, exited with code 2]

Summary: 3 packages finished [1min 6s]
  1 package failed: realsense2_camera
  1 package had stderr output: realsense2_camera
`
MartyG-RealSense commented 2 years ago

For a Jetson installation, it is recommendable to install the librealsense SDK first using a Jetson-specific installation procedure and then install the ROS wrapper afterwards from source code once you have confirmed that librealsense is working successfully.

You can install librealsense for Jetson from packages with apt-get installusing the instructions at the link below.

https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md#4-install-with-debian-packages

Then build the ros2-development ROS wrapper from source code for ROS2 using the colcon build procedure.

https://github.com/IntelRealSense/realsense-ros/#step-3-install-intel-realsense-ros2-wrapper-from-sources

ryanmaxwell96 commented 2 years ago

Ok I will try this when I can in a few days

ryanmaxwell96 commented 2 years ago

Screenshot from 2022-11-21 17-53-11

ryanmaxwell96 commented 2 years ago

So this is what I get when I run realsense-viewer so it seems to be working.

But when I follow the instructions on the link, https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md#4-install-with-debian-packages

I get this issue:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE Executing: /tmp/apt-key-gpghome.M6wHtmMduE/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE gpg: key C8B3A55A6F3EFCDE: ""CN = Intel(R) Intel(R) Realsense", O=Intel Corporation" not changed gpg: Total number processed: 1 gpg: unchanged: 1

I guess that it doesn't matter because the camera seems to be working?

ryanmaxwell96 commented 2 years ago

And it looks like I still basically get the same errors: colcon build [1.424s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces: 'turtlesim' is in: /opt/ros/eloquent If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time. If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.

If you understand the risks and want to override a package anyways, add the following to the command line: --allow-overriding turtlesim

This may be promoted to an error in a future release of colcon-override-check. Starting >>> realsense2_camera_msgs Starting >>> turtlesim Finished <<< realsense2_camera_msgs [2.20s]
Starting >>> realsense2_camera Starting >>> realsense2_description
Finished <<< realsense2_description [0.57s]
Finished <<< turtlesim [3.43s]
--- stderr: realsense2_camera
In file included from /opt/ros/eloquent/include/librealsense2/hpp/rs_sensor.hpp:8:0, from /opt/ros/eloquent/include/librealsense2/hpp/rs_device.hpp:8, from /opt/ros/eloquent/include/librealsense2/hpp/rs_record_playback.hpp:8, from /opt/ros/eloquent/include/librealsense2/hpp/rs_context.hpp:8, from /opt/ros/eloquent/include/librealsense2/rs.hpp:9, from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/include/ros_sensor.h:6, from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_sensor.cpp:4: /opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:526:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers] const int get_data_size() const ^~~~~ /opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function: /opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1020:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] frm.get_profile().stream_index() == index) f = frm;


/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1042:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1064:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from /opt/ros/eloquent/include/librealsense2/hpp/rs_sensor.hpp:8:0,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_device.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_record_playback.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_context.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/rs.hpp:9,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/base_realsense_node.h:6,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:4:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:526:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
         const int get_data_size() const
         ^~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1020:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1042:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1064:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from /opt/ros/eloquent/include/librealsense2/hpp/rs_sensor.hpp:8:0,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_device.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_record_playback.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_context.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/rs.hpp:9,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/include/ros_utils.h:10,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/include/dynamic_params.h:5,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/dynamic_params.cpp:4:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:526:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
         const int get_data_size() const
         ^~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1020:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1042:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1064:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from /opt/ros/eloquent/include/librealsense2/hpp/rs_sensor.hpp:8:0,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_device.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_record_playback.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_context.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/rs.hpp:9,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/include/ros_utils.h:10,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_utils.cpp:4:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:526:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
         const int get_data_size() const
         ^~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1020:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1042:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1064:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_sensor.cpp: In member function ‘void realsense2_camera::RosSensor::UpdateSequenceIdCallback()’:
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_sensor.cpp:91:19: error: ‘RS2_OPTION_SEQUENCE_ID’ was not declared in this scope
     if (!supports(RS2_OPTION_SEQUENCE_ID))
                   ^~~~~~~~~~~~~~~~~~~~~~
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_sensor.cpp:91:19: note: suggested alternative: ‘RS2_OPTION_SHARPNESS’
     if (!supports(RS2_OPTION_SEQUENCE_ID))
                   ^~~~~~~~~~~~~~~~~~~~~~
                   RS2_OPTION_SHARPNESS
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_sensor.cpp:94:55: error: ‘RS2_OPTION_SEQUENCE_ID’ was not declared in this scope
     int original_seq_id = static_cast<int>(get_option(RS2_OPTION_SEQUENCE_ID));   // To Set back to default.
                                                       ^~~~~~~~~~~~~~~~~~~~~~
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_sensor.cpp:94:55: note: suggested alternative: ‘RS2_OPTION_SHARPNESS’
     int original_seq_id = static_cast<int>(get_option(RS2_OPTION_SEQUENCE_ID));   // To Set back to default.
                                                       ^~~~~~~~~~~~~~~~~~~~~~
                                                       RS2_OPTION_SHARPNESS
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_sensor.cpp:99:40: error: ‘RS2_OPTION_SEQUENCE_SIZE’ was not declared in this scope
     unsigned int seq_size = get_option(RS2_OPTION_SEQUENCE_SIZE);
                                        ^~~~~~~~~~~~~~~~~~~~~~~~
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_sensor.cpp:99:40: note: suggested alternative: ‘RS2_OPTION_FRAMES_QUEUE_SIZE’
     unsigned int seq_size = get_option(RS2_OPTION_SEQUENCE_SIZE);
                                        ^~~~~~~~~~~~~~~~~~~~~~~~
                                        RS2_OPTION_FRAMES_QUEUE_SIZE
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_sensor.cpp: In lambda function:
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_sensor.cpp:126:28: error: ‘RS2_OPTION_SEQUENCE_ID’ is not captured
                 set_option(RS2_OPTION_SEQUENCE_ID, parameter.get_value<int>());
                            ^~~~~~~~~~~~~~~~~~~~~~
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_sensor.cpp:124:18: note: the lambda has no capture-default
             [this](const rclcpp::Parameter& parameter)
                  ^
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_sensor.cpp:94:55: note: ‘<typeprefixerror>RS2_OPTION_SEQUENCE_ID’ declared here
     int original_seq_id = static_cast<int>(get_option(RS2_OPTION_SEQUENCE_ID));   // To Set back to default.
                                                       ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/include/ros_utils.h:11:0,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/include/dynamic_params.h:5,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/dynamic_params.cpp:4:
/opt/ros/eloquent/include/librealsense2/rsutil.h: At global scope:
/opt/ros/eloquent/include/librealsense2/rsutil.h:186:13: warning: ‘void rs2_project_color_pixel_to_depth_pixel(float*, const uint16_t*, float, float, float, const rs2_intrinsics*, const rs2_intrinsics*, const rs2_extrinsics*, const rs2_extrinsics*, const float*)’ defined but not used [-Wunused-function]
 static void rs2_project_color_pixel_to_depth_pixel(float to_pixel[2],
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/eloquent/include/librealsense2/rsutil.h:150:13: warning: ‘void rs2_fov(const rs2_intrinsics*, float*)’ defined but not used [-Wunused-function]
 static void rs2_fov(const struct rs2_intrinsics * intrin, float to_fov[2])
             ^~~~~~~
In file included from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/include/ros_utils.h:11:0,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_utils.cpp:4:
/opt/ros/eloquent/include/librealsense2/rsutil.h: At global scope:
/opt/ros/eloquent/include/librealsense2/rsutil.h:186:13: warning: ‘void rs2_project_color_pixel_to_depth_pixel(float*, const uint16_t*, float, float, float, const rs2_intrinsics*, const rs2_intrinsics*, const rs2_extrinsics*, const rs2_extrinsics*, const float*)’ defined but not used [-Wunused-function]
 static void rs2_project_color_pixel_to_depth_pixel(float to_pixel[2],
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/eloquent/include/librealsense2/rsutil.h:150:13: warning: ‘void rs2_fov(const rs2_intrinsics*, float*)’ defined but not used [-Wunused-function]
 static void rs2_fov(const struct rs2_intrinsics * intrin, float to_fov[2])
             ^~~~~~~
In file included from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/include/ros_sensor.h:7:0,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/ros_sensor.cpp:4:
/opt/ros/eloquent/include/librealsense2/rsutil.h: At global scope:
/opt/ros/eloquent/include/librealsense2/rsutil.h:186:13: warning: ‘void rs2_project_color_pixel_to_depth_pixel(float*, const uint16_t*, float, float, float, const rs2_intrinsics*, const rs2_intrinsics*, const rs2_extrinsics*, const rs2_extrinsics*, const float*)’ defined but not used [-Wunused-function]
 static void rs2_project_color_pixel_to_depth_pixel(float to_pixel[2],
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/eloquent/include/librealsense2/rsutil.h:150:13: warning: ‘void rs2_fov(const rs2_intrinsics*, float*)’ defined but not used [-Wunused-function]
 static void rs2_fov(const struct rs2_intrinsics * intrin, float to_fov[2])
             ^~~~~~~
make[2]: *** [CMakeFiles/realsense2_camera.dir/src/ros_sensor.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /opt/ros/eloquent/include/librealsense2/hpp/rs_sensor.hpp:8:0,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_device.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_record_playback.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_context.hpp:8,
                 from /opt/ros/eloquent/include/librealsense2/rs.hpp:9,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/include/sensor_params.h:5,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/sensor_params.cpp:4:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:526:9: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
         const int get_data_size() const
         ^~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1020:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1042:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp: In lambda function:
/opt/ros/eloquent/include/librealsense2/hpp/rs_frame.hpp:1064:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                         frm.get_profile().stream_index() == index) f = frm;
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp: In member function ‘void realsense2_camera::BaseRealSenseNode::setupFilters()’:
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:154:76: error: ‘hdr_merge’ is not a member of ‘rs2’
 _back(std::make_shared<NamedFilter>(std::make_shared<rs2::hdr_merge>(), _parameters, _logger));
                                                           ^~~~~~~~~
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:154:76: error: ‘hdr_merge’ is not a member of ‘rs2’
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:154:87: error: no matching function for call to ‘make_shared<<expression error> >()’
 make_shared<NamedFilter>(std::make_shared<rs2::hdr_merge>(), _parameters, _logger));
                                                           ^
In file included from /usr/include/c++/7/memory:81:0,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_types.hpp:18,
                 from /opt/ros/eloquent/include/librealsense2/rs.hpp:8,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/base_realsense_node.h:6,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:4:
/usr/include/c++/7/bits/shared_ptr.h:703:5: note: candidate: template<class _Tp, class ... _Args> std::shared_ptr<_Tp> std::make_shared(_Args&& ...)
     make_shared(_Args&&... __args)
     ^~~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:703:5: note:   template argument deduction/substitution failed:
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:154:87: error: template argument 1 is invalid
 make_shared<NamedFilter>(std::make_shared<rs2::hdr_merge>(), _parameters, _logger));
                                                           ^
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:155:76: error: ‘sequence_id_filter’ is not a member of ‘rs2’
 _back(std::make_shared<NamedFilter>(std::make_shared<rs2::sequence_id_filter>(), _parameters, _logger));
                                                           ^~~~~~~~~~~~~~~~~~
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:155:76: note: suggested alternative: ‘threshold_filter’
 _back(std::make_shared<NamedFilter>(std::make_shared<rs2::sequence_id_filter>(), _parameters, _logger));
                                                           ^~~~~~~~~~~~~~~~~~
                                                                            threshold_filter
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:155:76: error: ‘sequence_id_filter’ is not a member of ‘rs2’
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:155:76: note: suggested alternative: ‘threshold_filter’
 _back(std::make_shared<NamedFilter>(std::make_shared<rs2::sequence_id_filter>(), _parameters, _logger));
                                                           ^~~~~~~~~~~~~~~~~~
                                                                            threshold_filter
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:155:96: error: no matching function for call to ‘make_shared<<expression error> >()’
 ed<NamedFilter>(std::make_shared<rs2::sequence_id_filter>(), _parameters, _logger));
                                                           ^
In file included from /usr/include/c++/7/memory:81:0,
                 from /opt/ros/eloquent/include/librealsense2/hpp/rs_types.hpp:18,
                 from /opt/ros/eloquent/include/librealsense2/rs.hpp:8,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/base_realsense_node.h:6,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:4:
/usr/include/c++/7/bits/shared_ptr.h:703:5: note: candidate: template<class _Tp, class ... _Args> std::shared_ptr<_Tp> std::make_shared(_Args&& ...)
     make_shared(_Args&&... __args)
     ^~~~~~~~~~~
/usr/include/c++/7/bits/shared_ptr.h:703:5: note:   template argument deduction/substitution failed:
/home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:155:96: error: template argument 1 is invalid
 ed<NamedFilter>(std::make_shared<rs2::sequence_id_filter>(), _parameters, _logger));
                                                           ^
In file included from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/include/ros_utils.h:11:0,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/include/dynamic_params.h:5,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/include/sensor_params.h:7,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/sensor_params.cpp:4:
/opt/ros/eloquent/include/librealsense2/rsutil.h: At global scope:
/opt/ros/eloquent/include/librealsense2/rsutil.h:186:13: warning: ‘void rs2_project_color_pixel_to_depth_pixel(float*, const uint16_t*, float, float, float, const rs2_intrinsics*, const rs2_intrinsics*, const rs2_extrinsics*, const rs2_extrinsics*, const float*)’ defined but not used [-Wunused-function]
 static void rs2_project_color_pixel_to_depth_pixel(float to_pixel[2],
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/eloquent/include/librealsense2/rsutil.h:150:13: warning: ‘void rs2_fov(const rs2_intrinsics*, float*)’ defined but not used [-Wunused-function]
 static void rs2_fov(const struct rs2_intrinsics * intrin, float to_fov[2])
             ^~~~~~~
In file included from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/../include/base_realsense_node.h:7:0,
                 from /home/nvidia/ros2_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:4:
/opt/ros/eloquent/include/librealsense2/rsutil.h: At global scope:
/opt/ros/eloquent/include/librealsense2/rsutil.h:186:13: warning: ‘void rs2_project_color_pixel_to_depth_pixel(float*, const uint16_t*, float, float, float, const rs2_intrinsics*, const rs2_intrinsics*, const rs2_extrinsics*, const rs2_extrinsics*, const float*)’ defined but not used [-Wunused-function]
 static void rs2_project_color_pixel_to_depth_pixel(float to_pixel[2],
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/eloquent/include/librealsense2/rsutil.h:150:13: warning: ‘void rs2_fov(const rs2_intrinsics*, float*)’ defined but not used [-Wunused-function]
 static void rs2_fov(const struct rs2_intrinsics * intrin, float to_fov[2])
             ^~~~~~~
make[2]: *** [CMakeFiles/realsense2_camera.dir/src/base_realsense_node.cpp.o] Error 1
make[1]: *** [CMakeFiles/realsense2_camera.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< realsense2_camera [24.6s, exited with code 2]

Summary: 3 packages finished [27.6s]
  1 package failed: realsense2_camera
  1 package had stderr output: realsense2_camera
ryanmaxwell96 commented 2 years ago

Update:

Following the librealsense download website: I still cannot get the line

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE to work. It always gives me

Executing: /tmp/apt-key-gpghome.jDj2WMkvS2/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE gpg: key C8B3A55A6F3EFCDE: ""CN = Intel(R) Intel(R) Realsense", O=Intel Corporation" not changed gpg: Total number processed: 1 gpg: unchanged: 1 So then I followed the instructions on https://askubuntu.com/questions/36507/how-do-i-import-a-public-key

using the key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE to get these lines copied into my key.txt file:

-----BEGIN PGP PUBLIC KEY BLOCK----- Comment: Hostname: Version: Hockeypuck 2.1.0-184-g50f1108

xsBNBFpUqDEBCADuIoVeNfgr3owUxn0keHq9OPak+Phxk4ye/paDZ5JZ6D407GXt QI0Ct6TVj2J9tWkcsK+G4DDxOQDPLIMf+mgjJYX0jwt6ruminSIhhp5fvh3Ol33e X/2P01Iul/GhVlpg6MspnIiJOnv0okYNbOzSLdgxpmTk6dyxP49pHbLdzI7JugsS tJljQgBeBP6pNlzBVTDvEvP2cXnqTVFxm2skiw9hyN2o2CXjGhGOz6Z5L6iOf/ee 8beYHomkEaaoNXc3Z+V5KzSg4uM1uYzqecxQ1InhrsYfb0ETjvAeJiNp1y+sSm+O CDJWNxJq8tNSFrwvKPZ+e6cvv15yN6hChkkRABEBAAHNNyJDTiA9IEludGVsKFIp IEludGVsKFIpIFJlYWxzZW5zZSIsIE89SW50ZWwgQ29ycG9yYXRpb27CwH4EEwEI ACgFAlpUqDECGwMFCRLNVIAGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEMiz pVpvPvzeGIAIAJiwFHVL/iqnDRVfzcI/Nm8gtoMDV2hU6QGcNkbwZn5JpoIyGGPh zR01rWYX6hvt9BzzZljW7MF6LPnfi0IXzZ8ml/wFx0GwF9u0acCkxCZr4aIReO4W t0Pe8u6uAIyhNdn9a4yacxFPdeU2W2w1xDTRUidiDO4V9vCllK4VGGHoBLi9ua6C qIZrdnRvX3ire6WybLz33JyDbEK9SlKqs8kwyz4uq9a0sry79oTQiK4jAgLxKGq/ JA5ixemTnVrVIa+CZgUHqMW0SrgZeJDVMh7x2ZPGilSxmPDMNniEd5mxrFetFrzy quh0EmUG2XwVM89VNH4Y45USyqal4RhISMw= =oqan -----END PGP PUBLIC KEY BLOCK-----

Then executed

sudo apt-key add key.txt

and got the OK confirmation.

But the first command for installing librealsense to register the public key (sudo apt-key adv ...) gives the same result:

gpg: Total number processed: 1 gpg: unchanged: 1

My question for this is, does it even matter?

The lines

sudo apt-get install librealsense2-utils sudo apt-get install librealsense2-dev

which are the step after the public key registration both seem to work. They give me this:

"sudo apt-get install librealsense2-utils Reading package lists... Done Building dependency tree
Reading state information... Done librealsense2-utils is already the newest version (2.51.1-0~realsense0.476). 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded."

and

"sudo apt-get install librealsense2-dev Reading package lists... Done Building dependency tree
Reading state information... Done librealsense2-dev is already the newest version (2.51.1-0~realsense0.476). 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. " Attempting to download the ROS2 Wrapper Installing dependencies seems to work fine: sudo apt-get install python3-rosdep -y Reading package lists... Done Building dependency tree
Reading state information... Done python3-rosdep is already the newest version (0.22.1-1). 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

sudo rosdep init # "sudo rosdep init --include-eol-distros" for Eloquent and earlier ERROR: default sources list file already exists: /etc/ros/rosdep/sources.list.d/20-default.list Please delete if you wish to re-initialize

rosdep update # "sudo rosdep update --include-eol-distros" for Eloquent and earlier reading in sources list data from /etc/ros/rosdep/sources.list.d Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml Skip end-of-life distro "ardent" Skip end-of-life distro "bouncy" Skip end-of-life distro "crystal" Skip end-of-life distro "dashing" Skip end-of-life distro "eloquent" Add distro "foxy" Add distro "galactic" Skip end-of-life distro "groovy" Add distro "humble" Skip end-of-life distro "hydro" Skip end-of-life distro "indigo" Skip end-of-life distro "jade" Skip end-of-life distro "kinetic" Skip end-of-life distro "lunar" Add distro "melodic" Add distro "noetic" Add distro "rolling" updated cache in /home/nvidia/.ros/rosdep/sources.cache`

`rosdep install -i --from-path src --rosdistro $ROS_DISTRO --skip-keys=librealsense2 -y

All required rosdeps installed successfully

But then the colcon build gives what I showed before

MartyG-RealSense commented 2 years ago

Thanks very much for your patience. I would recommend ensuring that the librealsense SDK is working correctly before proceeding onwards to building the ROS wrapper, as there is then less problems to diagnose simultaneously.

Is librealsense's RealSense Viewer able to run correctly in your package installation of the SDK, please?

ryanmaxwell96 commented 2 years ago

You mean does the command realsense-viewer run and show the camera output? Yes, it runs and it shows both the 2D RGB camera picture as well as the 3D picture

I think I should say that I tried different ways to get realsense-viewer to work and I don't know which one allowed realsense-viewer to work (coming from the librealsense download or somewhere else), or if that makes a difference.

MartyG-RealSense commented 2 years ago

If realsense-viewer works correctly then that is a good foundation for moving onwards to a ROS wrapper installation after that with confidence that the librealsense installation is okay.

After that, you attempted to build the ros2-development ROS2 wrapper from source code but encountered the problem with colcon build.

As your colcon build said that some packages were already installed, have you tried performing a RealSense wrapper launch in the ROS terminal yet?

ros2 launch realsense2_camera rs_launch.py

ryanmaxwell96 commented 2 years ago

Ok thanks for the terminal command. Unfortunately, the realsense2_camera package cannot be found

ryanmaxwell96 commented 2 years ago

Well shoot. I thought I had it figured out. I ran this exactly at first: sudo apt-get install python3-rosdep -y sudo rosdep init # "sudo rosdep init --include-eol-distros" for Eloquent and earlier rosdep update # "sudo rosdep update --include-eol-distros" for Eloquent and earlier rosdep install -i --from-path src --rosdistro $ROS_DISTRO --skip-keys=librealsense2 -y

But read it closer and realized I needed to use the commented out parts for sudo rosdep init and sudo rosdep update since I'm using Eloquent. Did this and still no luck - same colcon error message :(

Also, FYI I think I originally got realsense-viewer to work using the installation at the bottom of this page that is tested explicitly to work with Jetson AGX https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md that starts with the command ./scripts/patch-realsense-ubuntu-L4T.sh

MartyG-RealSense commented 2 years ago

So you used the Eloquent instructions like this?

sudo rosdep init --include-eol-distros
sudo rosdep update --include-eol-distros
rosdep install -i --from-path src --rosdistro $ROS_DISTRO --skip-keys=librealsense2 -y
colcon build
ryanmaxwell96 commented 2 years ago

Yes, I've tried both without and with the --include-eol-distros

MartyG-RealSense commented 2 years ago

I reviewed this case again from the beginning. A notable factor on your particular computer is that you are using turtlesim and received a warning about it after inputting colcon build.

https://github.com/IntelRealSense/realsense-ros/issues/2544#issuecomment-1322969415

If you are still receiving those turtlesim related errors then it may be worth considering following the log messages' advice to add --allow-overriding turtlesim to the command line if you have not tried this already.

ryanmaxwell96 commented 2 years ago

Ok I added the terms to remove the warning about turtlesim, but still have the same issues

MartyG-RealSense commented 2 years ago

It seems that turtlesim is not a factor in the problem. Your use of a Jetson AGX is also likely not a factor, since installing the ROS wrapper from source code is appropriate for Jetson boards.

The next action that we could try is building from source code the previous generation of ROS2 wrapper that also supports Eloquent. The final version of that wrapper was 3.2.3. It was designed for librealsense 2.50.0 but should work with 2.51.0 as 2.51.1 was mostly bug fixes rather than new features.

https://github.com/IntelRealSense/realsense-ros/releases/tag/3.2.3

The source code installation instructions for wrapper 3.2.3 are similar to 4.51.1 and also use colcon build but have a different git clone command.

https://github.com/IntelRealSense/realsense-ros/tree/ros2-legacy#step-3-install-intel-realsense-ros2-wrapper-from-sources


If that wrapper does not work either and multiple previous installation attempts have been made, doing a complete wipe of the computer and a fresh reinstall of Ubuntu, librealsense and the ROS wrapper can suddenly make previously unsolvable problems disappear.

ryanmaxwell96 commented 2 years ago

Ok. I was actually considering upgrading to Jetpack 5.0.2 and Ubuntu 20.04 and starting over with Foxy instead.

ryanmaxwell96 commented 2 years ago

Ok now I have Ubuntu 20.04 freshly installed as well as Jetpack 5.0.2. Will those two links you shared still work? On one it assumes Ubuntu 16/18

MartyG-RealSense commented 2 years ago

The librealsense SDK would not be a problem for Ubuntu 20.04.

Foxy or Galactic are recommended for the 3.2.3 wrapper when using 20.04.

Is there any possibility of upgrading your project from Eloquent to at least Foxy, please?

ryanmaxwell96 commented 2 years ago

Ok thanks! I am now on Ubuntu 20.04, Jetpack 5.0.2, with Foxy ROS2 distro and the camera seems to be working with colcon build successful, except for the Motion Module in the Realsense Viewer. Haven't looked into those errors yet that occur when I try to toggle the Motion Module.

For now, is there a way to not have to run the command ". install/local_setup.bash" inside ros2_ws on every new terminal? Is there a way to source it in .bashrc somehow?

ryanmaxwell96 commented 2 years ago

Nevermind. Got it with

ROS 2 Sourcing

source /opt/ros/foxy/setup.bash source ~/ros2_ws/install/setup.bash source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash

inside .bashrc

MartyG-RealSense commented 1 year ago

It's excellent to hear that you have made significant progress!

MartyG-RealSense commented 1 year ago

Hi @ryanmaxwell96 Do you require further assistance with this case, please? Thanks!

ryanmaxwell96 commented 1 year ago

Thanks for your help. I think you can close this as I was able to get Jetpack 5.0.2, Ubuntu 20.04, and ROS2 Foxy installed and successfully built

MartyG-RealSense commented 1 year ago

That's great to hear, @ryanmaxwell96 - thanks very much for the update! As you suggested, I will close the issue. Thanks again!

MartyG-RealSense commented 1 year ago

Hi @ryanmaxwell96 The new 2.54.1 version of librealsense with JetPack 5.0.2 support is now available.

https://github.com/IntelRealSense/librealsense/releases/tag/v2.54.1

Release notes: https://github.com/IntelRealSense/librealsense/wiki/Release-Notes#release-2541