ROS2学习遇到的问题1---TF_OLD_DATA

ROS2学习遇到的问题1—TF_OLD_DATA

以下只是想记录一下自己学习ROS过程中的问题

问题1
我使用的是humble版本的ROS2,配置是双系统UBUNTU22.04,在进行NAVIGATION2学习时进行第一步设置机器人时,运行lunch文件:

ros2 launch sam_bot_description display.launch.py

会报出以下警告:

[ekf_node-5] Warning: TF_OLD_DATA ignoring data from the past for frame drivewhl_r_link at time 40.052000 according to authority Authority undetectable
[ekf_node-5] Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
[ekf_node-5]          at line 292 in ./src/buffer_core.cpp
[ekf_node-5] Warning: TF_OLD_DATA ignoring data from the past for frame drivewhl_l_link at time 40.052000 according to authority Authority undetectable
[ekf_node-5] Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
[ekf_node-5]          at line 292 in ./src/buffer_core.cpp
[rviz2-6] Warning: TF_OLD_DATA ignoring data from the past for frame drivewhl_l_link at time 40.052000 according to authority Authority undetectable
[rviz2-6] Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
[rviz2-6]          at line 292 in ./src/buffer_core.cpp
[rviz2-6] Warning: TF_OLD_DATA ignoring data from the past for frame drivewhl_r_link at time 40.062000 according to authority Authority undetectable
[rviz2-6] Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
[rviz2-6]          at line 292 in ./src/buffer_core.cpp
[rviz2-6] Warning: TF_OLD_DATA ignoring data from the past for frame drivewhl_l_link at time 40.062000 according to authority Authority undetectable
[rviz2-6] Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
[rviz2-6]          at line 292 in ./src/buffer_core.cpp

解决方法如下:
在差速轮的设置中按照如下配置:

<gazebo>
    <plugin name='diff_drive' filename='libgazebo_ros_diff_drive.so'>
      <ros>
        <namespace>/demo</namespace>
      </ros>
  
      <!-- wheels -->
      <left_joint>drivewhl_l_joint</left_joint>
      <right_joint>drivewhl_r_joint</right_joint>
  
      <!-- kinematics -->
      <wheel_separation>0.4</wheel_separation>
      <wheel_diameter>0.2</wheel_diameter>
  
      <!-- limits -->
      <max_wheel_torque>20</max_wheel_torque>
      <max_wheel_acceleration>1.0</max_wheel_acceleration>
  
      <!-- output -->
      <publish_odom>true</publish_odom>
      <publish_odom_tf>true</publish_odom_tf>
      <publish_wheel_tf>false</publish_wheel_tf>
  
      <odometry_frame>odom</odometry_frame>
      <robot_base_frame>base_link</robot_base_frame>
    </plugin>
  </gazebo>

其中最重要的下面参数的设置:

	<publish_odom>true</publish_odom>
      <publish_odom_tf>true</publish_odom_tf>
      <publish_wheel_tf>false</publish_wheel_tf>

然后保证:

robot_localization_node = launch_ros.actions.Node(
       package='robot_localization',
       executable='ekf_node',
       name='ekf_filter_node',
       output='screen',
       parameters=[os.path.join(pkg_share, 'config/ekf.yaml'), {'use_sim_time':True}]
    )

将use_sim_time设置为true即可

问题相关话题:
github描述

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小猴同学编代码

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值