< >
Home » ROS2与Nav2应用opennav仿真教程 » ROS2与Nav2应用opennav仿真教程-启动仿真

ROS2与Nav2应用opennav仿真教程-启动仿真

说明

  • 介绍如何启动仿真和查看相关传感器数据

步骤

  • 启动仿真
ros2 launch honeybee_bringup robot.launch.py  use_simulation:=true use_sim_time:=true
  • gazebo效果图

请输入图片描述

查看话题列表

ubuntu@WALKING-ARM-V400:~/ros2_opennav_ws$ ros2 topic list
/clock
/cmd_vel
/diagnostics
/joint_state_broadcaster/transition_event
/joy_teleop/cmd_vel         
/joy_teleop/emergency_stop
/joy_teleop/joy
/joy_teleop/joy/set_feedback
/parameter_events
/platform/cmd_vel_unstamped
/platform/dynamic_joint_states
/platform/joint_states
/platform/odom             #底盘原始里程
/platform/odom/filtered    #robot_localiation 融合imu的里程
/platform_velocity_controller/transition_event
/rc_teleop/cmd_vel
/robot_description         #模型
/rosout
/sensors/camera_0/camera_info
/sensors/camera_0/color/image    #相机普通图像
/sensors/camera_0/depth/image    #相机深度图
/sensors/camera_0/depth_image/compressed  #压缩的相机深度图
/sensors/camera_0/depth_image/compressedDepth
/sensors/camera_0/depth_image/theora
/sensors/camera_0/image/compressed
/sensors/camera_0/image/compressedDepth
/sensors/camera_0/image/theora
/sensors/camera_0/points   #相机点云图
/sensors/gps_0/fix   #GPS数据
/sensors/imu_0/data  #IMU0滤波后数据
/sensors/imu_0/data_raw  #imu0原始数据
/sensors/imu_1/data  #IMU1数据
/sensors/lidar_0/points #雷达3D点云
/sensors/lidar_0/scan   #雷达2D数据
/set_pose
/tf
/tf_static

查看2D激光数据

  • 查看方法
#执行命令:
$ros2 topic echo /sensors/lidar_0/scan

#效果图
---
header:
  stamp:
    sec: 987
    nanosec: 702000000
  frame_id: os0_sensor
angle_min: -3.1415927410125732
angle_max: 3.1415927410125732
angle_increment: 0.012269999831914902
time_increment: 0.0
scan_time: 0.10000000149011612
range_min: 0.0
range_max: 25.0
ranges:
- 6.956625938415527
- 6.953227519989014
- 6.952084064483643
- 6.954678535461426
- 6.9585065841674805
- 6.96042013168335
- '...'
intensities: []
---

查看激光点云数据

  • 查看方法
#执行命令
$ros2 topic echo /sensors/lidar_0/points

#效果图
---
header:
  stamp:
    sec: 4795
    nanosec: 302000000
  frame_id: os0_sensor
height: 32
width: 512
fields:
- name: x
  offset: 0
  datatype: 7
  count: 1
- name: y
  offset: 4
  datatype: 7
  count: 1
- name: z
  offset: 8
  datatype: 7
  count: 1
- name: intensity
  offset: 16
  datatype: 7
  count: 1
- name: ring
  offset: 24
  datatype: 4
  count: 1
is_bigendian: false
point_step: 32
row_step: 16384
data:
- 0
- 0
- 128
- 255
- 0
- 0
- 0
- '...'
is_dense: false
---

查看相机内容

  • 查看方法
ros2 run rqt_image_view rqt_image_view 
  • image_view效果图

请输入图片描述

请输入图片描述

查看TF

  • 查看方法
ros2 run rqt_tf_tree rqt_tf_tree 
  • rqt_tf_tree 效果图

请输入图片描述

查看里程

  • 查看方法
#执行命令
ros2 topic echo /platform/odom/filtered

#效果
---
header:
  stamp:
    sec: 5155
    nanosec: 731000000
  frame_id: odom
child_frame_id: base_link
pose:
  pose:
    position:
      x: 0.0
      y: 0.0
      z: 0.0
    orientation:
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0
  covariance:
  - 2725107860669.5864
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 2725107860669.5864
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 9.981549771093918e-07
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 9.963234931470355e-07
  - 2.322798902949128e-47
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - -2.322798902968046e-47
  - 9.963234931470355e-07
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 84.2238000154067
twist:
  twist:
    linear:
      x: 0.0
      y: 0.0
      z: 0.0
    angular:
      x: 0.0
      y: 0.0
      z: -1.1532705123907247e-18
  covariance:
  - 9219904.219843812
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 9219904.219843812
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 9.972375538377388e-07
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 9.891294661536792e-07
  - 2.2783782473206132e-55
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - -2.2783782473218923e-55
  - 9.891294661536792e-07
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 9.999944445061722e-10
---

查看GPS

  • 查看方法
#执行命令
$ ros2 topic echo /sensors/gps_0/fix

#效果
---
header:
  stamp:
    sec: 5180
    nanosec: 1000000
  frame_id: gps_0_link
status:
  status: 0
  service: 0
latitude: 38.16148013501569
longitude: -122.45472332975721
altitude: 488.2450044397265
position_covariance:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
position_covariance_type: 0
---

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

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


标签: ros2与nav2应用opennav仿真教程