< >
Home » ROS2版Turbot3-Multi仿真教程 » ROS2与Turbot3-Multi仿真教程-环境测试

ROS2与Turbot3-Multi仿真教程-环境测试

文章说明

  • 本教程主要介绍如何进行仿真任务前的基本测试
  • 测试环境:Ubuntu 24.04 + ROS2 Jazzy + Gazebo Harmonic

相关设备

操作步骤

  • 新开终端, 启动Gazebo
$ ./sim_scripts/sim_gazebo.sh
  • 启动后会自动加载turbot3_house的world环境

turbot3_house修改自turtlebot3_house,删除容易碰撞上的桌子和将房门位置封闭起来

请输入图片描述

  • Gazebo运行时CPU占用高,可以选择打开Gazebo后不打开图像界面
$ ./sim_scripts/sim_gazebo.sh gui:=false
  • 新开终端, 单独加载单台机器人
$ ./sim_scripts/sim_single_robot.sh
  • 默认不带参数的情况是加载tb3_0机器人到Gazebo中,且位置为(0,0)

请输入图片描述

  • 同样也可以继续加载机器人到gazebo中
# 加载名为tb3_1和tb3_2的机器人到Gazebo中,且位置为(0,-2)和(2,-2)
$ ./sim_scripts/sim_single_robot.sh 1 x_pose:=0 y_pose:=-2
$ ./sim_scripts/sim_single_robot.sh 2 x_pose:=2 y_pose:=-2

请输入图片描述

  • 查看tf
$ ros2 run rqt_tf_tree rqt_tf_tree

请输入图片描述

  • 查看话题
$ ros2 topic list
/clock
/parameter_events
/rosout
/tb3_0/cmd_vel
/tb3_0/imu
/tb3_0/joint_states
/tb3_0/odom
/tb3_0/robot_description
/tb3_0/scan
/tb3_1/cmd_vel
/tb3_1/imu
/tb3_1/joint_states
/tb3_1/odom
/tb3_1/robot_description
/tb3_1/scan
/tb3_2/cmd_vel
/tb3_2/imu
/tb3_2/joint_states
/tb3_2/odom
/tb3_2/robot_description
/tb3_2/scan
/tf
/tf_static
  • 新开终端, 单独启动tb3_1的机器人的键盘控制程序
$ ./sim_scripts/sim_single_key.sh 1
  • 测试控制是否正常

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

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


标签: ros2版turbot3-multi仿真教程