Skip to content

踩坑Robotics Stack Exchange8 个月前

Gazebo Harmonic四轮差速里程计与RViz不一致 ​

本文由 AI 根据公开内容整理,可能有误,请以原文为准:Gazebo odometry is not the same as RVIz one(Robotics Stack Exchange #118031)

状态:已解决

问题 ​

在Ubuntu 24.04/ROS2 Jazzy/Gazebo Harmonic环境下,将Navigation 2教程机器人从双轮改为前后两组四轮差速配置后,gz-sim-diff-drive-system计算的里程计数据与RViz显示不一致。原配置在DiffDrive插件中直接定义了odom_topic、tf_topic及frame_id等输出参数导致异常。

环境 ​

Ubuntu 24.04, ROS2 Jazzy, Gazebo Harmonic, gz-sim-diff-drive-system, gz-sim-odometry-publisher-system

解决办法 ​

  1. 修改 gz-sim-diff-drive-system 插件配置,保留四个关节定义(drivewhl_l_joint, drivewhl_r_joint, drivewhl_l_b_joint, drivewhl_r_b_joint)及运动学参数,但必须删除 <odom_topic>、<tf_topic>、<frame_id> 和 <child_frame_id> 标签,仅保留 /demo/cmd_vel 输入话题。
  2. 新增 gz-sim-odometry-publisher-system 插件,设置 <odom_frame>odom</odom_frame> 和 <robot_base_frame>base_link</robot_base_frame>。
  3. 在新插件中配置 <odom_publish_frequency>50</odom_publish_frequency>、`<odom_topic>/demo/o…

原问题作者:Mattia Dutto;采纳答案作者:Mattia Dutto。原内容依 CC BY-SA 4.0 授权,本页摘要同样依 CC BY-SA 4.0 授权。

来源

本页事实对应的公开页面,以原文为准。

  1. Robotics Stack Exchange #118031:Gazebo odometry is not the same as RVIz one访问 2026-10-27