参考:ubuntu20.08下获取realsense内参(使用ros功能包)_realsense相机内参-CSDN博客
1. 下载realsense的ros2包
sudo apt-get install ros-humble-realsense2-camera
2. launch测试一下
ros2 launch realsense2_camera rs_launch.py
中间我运行过下面👇的命令,不知道有没有影响:
colcon build
source ./install/setup.sh
3. 获取realsense相机内参
ros2 topic echo /camera/camera/color/camera_info
结果:
k:
- 908.4378662109375 fx
- 0.0
- 648.5411376953125 cx
- 0.0
- 908.0997314453125 fy
- 380.6193542480469 cy
4. ROS ROS2 指令对比
roslaunch realsense2_camera rs_camera.launch
ros2 launch realsense2_camera rs_launch.py
catkin_make
colcon build
source ~/catkin_ws/devel/setup.bash
source ~/dev_ws/install/setup.sh
rostopic list
ros2 topic list