<launch>
<group>
<let name="robot_description" value="$(command 'xacro $(find-pkg-share gazebo_pkg)/urdf/total.xacro')"/>
<node pkg="robot_state_publisher" exec="robot_state_publisher">
<param name="robot_description" value="$(var robot_description)"/>
</node>
<node name="joint_state_publisher" exec="joint_state_publisher" pkg="joint_state_publisher"/>
<node pkg="rviz2" exec="rviz2"/>
</group>
</launch>
?3个包一个都不能少
可以看到rviz订阅了/robot_description? ? ? ? 所以我们才需要param参数robot_description
来看看是谁发布的/robot_description????????
?/joint_state_publisher订阅了/robot_state_publisher
?/robot_state_publisher是发布了/robot_description,另外2个节点(rviz2和joint_state_publisher)订阅了这个节点
为什么没有/joint_state_publisher会无法正常显示轮子呢?
应该就是/joint_state_publisher还发布了/parameter_events,二rviz2订阅了这个吧。