<gazebo>
<plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
<rosDebugLevel>Debug</rosDebugLevel>
<publishWheelTF>true</publishWheelTF>
<robotNamespace>/</robotNamespace>
<publishTf>1</publishTf>
<publishWheelJointState>true</publishWheelJointState>
<alwaysOn>true</alwaysOn>
<updateRate>100.0</updateRate>
<legacyMode>true</legacyMode>
<leftJoint>tail_left_joint</leftJoint>
<rightJoint>tail_right_joint</rightJoint>
<wheelSeparation>0.2</wheelSeparation>
<wheelDiameter>${2*wheel_radius}</wheelDiameter>
<broadcastTF>1</broadcastTF>
<wheelTorque>30</wheelTorque>
<wheelAcceleration>1.8</wheelAcceleration>
<commandTopic>cmd_vel</commandTopic>
<odometryFrame>odom</odometryFrame>
<odometryTopic>odom</odometryTopic>
<robotBaseFrame>base_footprint</robotBaseFrame>
</plugin>
</gazebo>
最近学习gazebo仿真,发现启动gazebo之后并没有cmd_vel话题,虽然在机器人模型中已经加入了机器人的差分运动(如上述代码),后来辗转几次发现,libgazebo_ros_diff_drive.so这个插件在我的/opt/ros/kenitic/lib里没有。开始想着去重新下载一个gazebo7后来发现卸载之后在安装也没用,只能重新安装ros-kenitic,安装方式建议参考https://ismango.blog.csdn.net/article/details/106049992这个博客。安装之后就可以显示了。
另外如果你gazebo一直出现正在准备环境的界面,可能是你的网速导致模型加载过慢,建议你先将模型下载好。https://www.jianshu.com/p/6d91255bb57b
可以参考这个方式。