解决了,自问自答一下,正确的配置示例如下:
<model name="pedestrian_0" canonical_link="link"> <pose relative_to="world">-4 7 0.1 0 0 0</pose> <static>false</static> <link name="link" > <pose relative_to="__model__">0 0 0 0 0 0</pose> <inertial> <mass>55</mass> <inertia> <ixx>0.5807</ixx><ixy>0</ixy><ixz>0</ixz> <iyy>0.5807</iyy><iyz>0</iyz> <izz>0.7948</izz> </inertia> </inertial> <collision name="collision"> <geometry> <cylinder> <radius>0.17</radius> <length>0.2</length> </cylinder> </geometry> </collision> <visual name="visual"> <geometry> <cylinder> <radius>0.17</radius> <length>0.2</length> </cylinder> </geometry> <material> <ambient>0.2 0.2 0.2 1</ambient> <diffuse>0.2 0.2 0.2 1</diffuse> </material> </visual> </link> <plugin filename="libignition-gazebo-velocity-control-system.so" name="ignition::gazebo::systems::VelocityControl"> <initial_linear>0.0 0.0 0.0</initial_linear> <initial_angular>0.0 0.0 0.0</initial_angular> <topic>/pedestrian_0/cmd_vel</topic> <!-- <link_name>link</link_name> --> </plugin> <plugin filename="libignition-gazebo-pose-publisher-system.so" name="ignition::gazebo::systems::PosePublisher"> <publish_link_pose>true</publish_link_pose> <publish_nested_model_pose>true</publish_nested_model_pose> <publish_visual_pose>false</publish_visual_pose> <static_publisher>false</static_publisher> <use_pose_vector_msg>true</use_pose_vector_msg> </plugin> </model>需要注意canonical_link属性和link标签下<pose relative_to="__model__">0 0 0 0 0 0</pose>的配置