ROS自主导航机器人

PIBOT移植ROS2记录(4)

2022-05-06  本文已影响0人  PIBOT导航机器人

1. odom topic

  tf2::Quaternion q;
  q.setRPY(0.0, 0.0, th);

2. odom tf

...
find_package(tf2_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
...
ament_target_dependencies(pibot_driver 
                      rclcpp
                      geometry_msgs
                      nav_msgs
                      tf2_msgs
                      tf2_ros)

3. 运行测试

ros2 launch  pibot_bringup bringup_launch.py
➜  ros2 topic list    
/cmd_vel
/odom
/parameter_events
/rosout
/tf

可以使用ros2 topic echo /odom查看topic的输出

本文代码https://gitee.com/pibot/pibot_bringup/tree/3b8d945f3924aa0fd58d95fc8539145abc65dfd3

上一篇下一篇

猜你喜欢

热点阅读