记录使用gazebo仿真的一个警告

<robot xmlns:xacro="http://ros.org/wiki/xacro">

    <!-- 定义传动实现宏 -->
    <xacro:macro name="joint_trans" params="joint_name">
        <transmission name="${joint_name}_trans">
            <type>transmission_interface/SimpleTransmission</type>
            <joint name="${joint_name}">
                <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
            </joint>
            <actuator name="${joint_name}_motor">
                <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
                <mechanicalReduction>1</mechanicalReduction>
            </actuator>
        </transmission>
    </xacro:macro>

    <!-- 为每个驱动轮添加传动装置 -->
    <xacro:joint_trans joint_name="joint_left_front" />
    <xacro:joint_trans joint_name="joint_left_back" />
    <xacro:joint_trans joint_name="joint_right_front" />
    <xacro:joint_trans joint_name="joint_right_back" />

    <!-- 添加差速驱动控制插件 -->
    <gazebo>
        <plugin name="differential_drive_controller_front" filename="libgazebo_ros_diff_drive.so">
            <rosDebugLevel>na</rosDebugLevel>
            <publishWheelTF>false</publishWheelTF>
            <robotNamespace>/</robotNamespace>
            <publishTf>true</publishTf>
            <publishWheelJointState>false</publishWheelJointState>
            <alwaysOn>true</alwaysOn>
            <updateRate>30.0</updateRate>
            <legacyMode>true</legacyMode>
            <leftJoint>joint_left_front</leftJoint>
            <rightJoint>joint_right_front</rightJoint>
            <wheelSeparation>${shaft_spacing_f + shaft_spacing_b}</wheelSeparation>
            <wheelDiameter>0.254</wheelDiameter>
            <broadcastTF>1</broadcastTF>
            <wheelTorque>50</wheelTorque>
            <wheelAcceleration>1.8</wheelAcceleration>
            <commandTopic>cmd_vel</commandTopic>
            <odometryFrame>odom</odometryFrame>
            <odometryTopic>odom</odometryTopic>
            <odometrySource>world</odometrySource>
            <robotBaseFrame>base_footprint</robotBaseFrame>
            <publishOdomTF>true</publishOdomTF>
        </plugin>
    </gazebo>

    <gazebo>
        <plugin name="differential_drive_controller_back" filename="libgazebo_ros_diff_drive.so">
            <rosDebugLevel>na</rosDebugLevel>
            <publishWheelTF>false</publishWheelTF>
            <robotNamespace>/</robotNamespace>
            <publishTf>true</publishTf>
            <publishWheelJointState>false</publishWheelJointState>
            <alwaysOn>true</alwaysOn>
            <updateRate>30.0</updateRate>
            <legacyMode>true</legacyMode>
            <leftJoint>joint_left_back</leftJoint>
            <rightJoint>joint_right_back</rightJoint>
            <wheelSeparation>${shaft_spacing_f + shaft_spacing_b}</wheelSeparation>
            <wheelDiameter>0.254</wheelDiameter>
            <broadcastTF>1</broadcastTF>
            <wheelTorque>50</wheelTorque>
            <wheelAcceleration>1.8</wheelAcceleration>
            <commandTopic>cmd_vel</commandTopic>
            <odometryFrame>odom</odometryFrame>
            <odometryTopic>odom</odometryTopic>
            <odometrySource>world</odometrySource>
            <robotBaseFrame>base_footprint</robotBaseFrame>
            <publishOdomTF>true</publishOdomTF>
        </plugin>
    </gazebo>

</robot>

为四轮驱动的机器人定义了前后两个差速驱动控制插件,会有这样的警告信息[ WARN] [1718978018.120461363, 41.720000000]: TF_REPEATED_DATA ignoring data with redundant timestamp for frame base_footprint (parent odom) at time 41.720000 according to authority unknown_publisher

我的测试中删除其中一个 <publishOdomTF>true</publishOdomTF> 标签似乎没有用,可能是因为即使标签未明确设置,默认行为仍会导致重复发布。需要将其中一个改为false,就不会再不停地刷上面的警告了

修改其中一个 <publishOdomTF>true</publishOdomTF> 标签不会影响 odom 坐标系的位置,因为里程计数据的发布只需要一个插件进行。只要有一个插件在正确发布 odom 坐标系的变换,机器人在仿真中的行为和里程计数据的计算不会受到影响。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值