< >
Home » ROS2与传感器教程 » ros2与传感器-整合深度相机d435i和T265

ros2与传感器-整合深度相机d435i和T265

ros2与传感器-整合深度相机d435i和T265

说明:

  • 介绍如何在ros2下使用深度相机d435i和T265
  • 测试环境:nuc 20.04
  • 具体产品,点击淘宝地址

realsense2 SDK安装步骤:

  • 添加KEY
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
  • 添加库
sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u
  • 安装SDK
sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
  • 测试运行
 realsense-viewer

realsense2-camera安装步骤:

  • APT安装
sudo apt install ros-$ROS_DISTRO-realsense2-camera
sudo apt install ros-$ROS_DISTRO-realsense2-description

测试:

  • 查看点云
ros2 launch realsense2_camera demo_pointcloud_launch.py
  • 默认启动
ros2 launch realsense2_camera rs_launch.py
  • 指定激活点云,定制设备型号
ros2 launch realsense2_camera rs_launch.py enable_pointcloud:=true device_type:=d435i
  • 指定配置文件
ros2 launch realsense2_camera rs_launch.py config_file:="'$COLCON_PREFIX_PATH/realsense2_camera/share/realsense2_camera/config/d435i.yaml'"
  • 使用rosrun启动
ros2 run realsense2_camera realsense2_camera_node --ros-args -p filters:=colorizer
  • 发布的话题
$ ros2 topic list
/camera/color/camera_info
/camera/color/image_raw
/camera/color/image_raw/compressed
/camera/color/image_raw/compressedDepth
/camera/color/image_raw/theora
/camera/color/metadata
/camera/depth/camera_info
/camera/depth/image_rect_raw
/camera/depth/image_rect_raw/compressed
/camera/depth/image_rect_raw/compressedDepth
/camera/depth/image_rect_raw/theora
/camera/depth/metadata
/camera/extrinsics/depth_to_color
/parameter_events
/rosout
/tf
/tf_static
  • 通过设备类型打开多个设备
ros2 launch realsense2_camera rs_multi_camera_launch.py camera_name1:=my_D435 device_type1:=d435 camera_name2:=my_d415 device_type2:=d415
  • 通过序列号打开多个设备
ros2 launch realsense2_camera rs_multi_camera_launch.py serial_no1:=_036522070660 serial_no2:=_725112060349
  • 打开T265
ros2 launch realsense2_camera rs_t265_launch.py
  • 同时打开T265和rviz
ros2 launch realsense2_camera demo_t265_launch.py
  • 打开相机模型
ros2 launch realsense2_description view_model.launch.py model:=test_d415_camera.urdf.xacro
  • 显示所有模型
ros2 launch realsense2_description view_model.launch.py

参考:

  • https://index.ros.org/r/realsense2_camera/

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: ros2与传感器