These are packages for using Intel RealSense cameras with ROS2 and get the point cloud x,y,z coordinates.
For more detail about Intenl RealSense cameras with ROS2. Please see realsense-ros
- Ubuntu 20.04
- ROS2-foxy
- Intel® RealSense™ DEPTH CAMERA D435i
(If your already install the enviroment and realsense2-camera. Please jump to the Fourth step.)
You should download ROS2. For me I'm using ROS2 foxy on Ubuntu 20.04.
sudo apt-get install ros-foxy-realsense2-camera
if you are using another ROS2 distro, just change "foxy" to which distro you are using.
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
-
Clone the ROS2 Intel® RealSense™ Intel from IntelRealSense,realsense-ros
git clone --depth 1 --branch `git ls-remote --tags https://github.com/IntelRealSense/realsense-ros.git | grep -Po "(?<=tags/)3.\d+\.\d+" | sort -V | tail -1` https://github.com/IntelRealSense/realsense-ros.git
-
Clone the ROS2_get_point_cloud to
~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/WZS666/ros2_get_point_cloud_xyz
cd ~/ros2_ws
sudo apt-get install python3-rosdep -y
sudo rosdep init
rosdep update
rosdep install -i --from-path src --rosdistro foxy -y
sudo apt purge ros-foxy-librealsense2 -y
sudo apt-get install ros-foxy-sensor-msgs-py
source /opt/ros/foxy/setup.bash
colcon build
(If you got the error about Intel RealSense SDK 2.0 is missing, please check your SDK from installation here)
you should do it at every new terminal
source install/local_setup.bash
if it pop out the ros2 can't found error please enter the source /opt/ros/foxy/setup.bash
ros2 launch realsense2_camera rs_launch.py enable_pointcloud:=true device_type:=d435
ros2 run ros2_get_point_cloud_xyz get_point_cloud_xyz
https://github.com/intelrealsense/realsense-ros/tree/ros2
https://github.com/ros2/common_interfaces/blob/master/sensor_msgs_py/sensor_msgs_py/point_cloud2.py
https://answers.ros.org/question/379029/how-to-get-xyz-coordinates-of-pointcloud-using-intel-real-sense-d415/
https://docs.ros.org/en/foxy/Tutorials/Creating-Your-First-ROS2-Package.html