最新消息:

Turtlebot3-ROS2入门教程-键盘控制

ROS2/二代机器人系统 少儿编程 2318浏览 0评论
Turtlebot3ROS2教程

Turtlebot3-ROS2入门教程-键盘控制

说明:

  • 介绍如何在ROS2机器人控制系统中利用键盘控制turtlebot3

操作步骤:

  • [Remote PC , TurtleBot] 同步时间
$ sudo ntpdate ntp.ubuntu.com
  • [TurtleBot] Run MicroRTPSAgent for OpenCR
$ cd ~/turtlebot3
$ MicroRTPSAgent serial /dev/ttyACM0
  • [TurtleBot] Run MicroRTPSAgent for Lidar
$ cd ~/turtlebot3
$ MicroRTPSAgent udp 2018
  • [TurtleBot] 运行雷达
$ cd ~/turtlebot3
$ ./turtlebot3_lidar
  • [Remote PC] 运行 turtlebot3_remote.launch.py
$ ros2 launch turtlebot3_bringup turtlebot3_remote.launch.py
  • 运行成功时会出现以下信息
[INFO] [launch]: process[robot_state_publisher-1]: started with pid [21355]
[INFO] [launch]: process[time_sync-2]: started with pid [21356]
[INFO] [launch]: process[odometry_publisher-3]: started with pid [21357]
[INFO] [launch]: process[tf_publisher-4]: started with pid [21358]
[INFO] [launch]: process[joint_states_publisher-5]: started with pid [21359]
[INFO] [launch]: process[scan_publisher-6]: started with pid [21360]
Initialize urdf model from file: /home/darby/ros2_overlay_ws/install/turtlebot3_description/share/turtlebot3_description/urdf/turtlebot3_burger.urdf
Parsing robot urdf xml string.
Link base_link had 5 children
Link caster_back_link had 0 children
Link imu_link had 0 children
Link base_scan had 0 children
Link wheel_left_link had 0 children
Link wheel_right_link had 0 children
got segment base_footprint
got segment base_link
got segment base_scan
got segment caster_back_link
got segment imu_link
got segment wheel_left_link
got segment wheel_right_link
[INFO] [time_sync]: Init System Time publisher
Adding fixed segment from base_footprint to base_link
Adding fixed segment from base_link to caster_back_link
Adding fixed segment from base_link to imu_link
Adding fixed segment from base_link to base_scan
Adding moving segment from base_link to wheel_left_link
Adding moving segment from base_link to wheel_right_link
[INFO] [joint_states_publisher]: Init joint_states publisher
[INFO] [scan_publisher]: Init scan publisher
[INFO] [tf_publisher]: Init tf publisher
[INFO] [odometry_publisher]: Init Odometry publisher
  • [Remote PC] 查看话题列表
$ ros2 topic list

/clock
/cmd_vel
/imu
/joint_states
/motor_power
/odom
/parameter_events
/reset
/robot_description
/scan
/scan_half
/sensor_state
/sound
/tf
/tf_static
/time_sync
/version_info
  • [Remote PC] 运行键盘控制节点
$ ros2 run turtlebot3_teleop turtlebot3_teleop_key

Control Your TurtleBot3!
---------------------------
Moving around:
        w
   a    s    d
        x

w/x : increase/decrease linear velocity (Burger : ~ 0.22, Waffle and Waffle Pi : ~ 0.26)
a/d : increase/decrease angular velocity (Burger : ~ 2.84, Waffle and Waffle Pi : ~ 1.82)

space key, s : force stop

CTRL-C to quit

Turtlebot3-ROS2入门教程-键盘控制

您必须 登录 才能发表评论!