ROS2与turtlebot4仿真入门教程-测试雷达和相机
原创
©著作权归作者所有:来自51CTO博客作者创客智造ROS的原创作品,请联系作者获取转载授权,否则将追究法律责任
说明:
- 介绍如何仿真下测试雷达和相机
- 如果没有雷达或相机数据,可以查看issue,确认模型的传感器引擎是否是ogre2
步骤:
ros2 launch turtlebot4_ignition_bringup ignition.launch.py
- 点一下左下角的三角图标开始仿真, 并按一下右上角的开关键右边的unlock按钮(两个点的图标),让机器人离开充电桩
测试雷达:
---
header:
stamp:
sec: 172
nanosec: 816000000
frame_id: turtlebot4/rplidar_link/rplidar
angle_min: -3.1415927410125732
angle_max: 3.1415927410125732
angle_increment: 0.009832840412855148
time_increment: 0.0
scan_time: 0.0
range_min: 0.164000004529953
range_max: 12.0
ranges:
- 7.365904331207275
- 3.948739528656006
- 3.907142400741577
- 8.883407592773438
- 8.94767951965332
- 9.012924194335938
- 9.079118728637695
- 9.146242141723633
- 9.214299201965332
- 9.82641887664795
- 9.902118682861328
- 9.978501319885254
- 10.055573463439941
- .inf
- .inf
- '...'
intensities:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- '...'
---
ros2 launch turtlebot3_viz view_robot.launch.py
- 设置Fixed Frame为base_link, LaserScan的style为Boxes, Size为0.1
- 效果如图:
测试相机:
ros2 topic echo /color/image
ros2 topic echo /color/
ros2 run rqt_image_view rqt_image_view
- 选择深度图话题/stereo/depth
- 效果图:
- 通过rviz查看雷达数据
- 打开rviz
ros2 launch turtlebot3_viz view_robot.launch.py
- 设置Fixed Frame为base_link, 添加通过image话题,选择话题/color/image
- 效果图: