connect gazebo and ros, robot's links separates?

asked 2021-09-02 09:50:06 -0500

marui gravatar image

When following the tutorials from http://gazebosim.org/tutorials?tut=ro..., I found when I start the simulation, some links including links connected to the robot body through fixed joint drop to the ground.

<!--Load controller config yaml file into parameter server-->
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <!-- <arg name="GAZEBO_MODEL_PATH" value="$(find myrobot_gazebo)/"/> -->
    <arg name="world_name" value="$(find myrobot_gazebo)/worlds/empty.world" />
    <arg name="paused" value="true"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="headless" value="false"/>
    <arg name="debug" value="false"/>
    <arg name="verbose" value="true"/>
    <arg name="gui" value="true"/>
</include>
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model"
    args="-urdf -param robot_description -model myrobot -x 0.0 -y 0.0 -z 1.5" output="screen" />
<include file="$(find myrobot_description)/launch/load.launch"/>

<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="myrobot" args="position_controller joint_state_publisher"/>

<node name="wlr_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
    respawn="false" output="screen" ns="myrobot">
    <remap from="/joint_states" to="/myrobot/joint_states" />
</node>

This is content of launch file and I have tried not spawn the joint position controller, everything is fine. How do I fix this problem.Thanks in advance.

edit retag flag offensive close merge delete