ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The problem is that gazebo_ros_control is looking for /robot_description, but that hasn't been set. You set /first_pelican/robot_description instead.

The solution is to change

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

to

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param /first_pelican/robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

The problem is that gazebo_ros_control is looking for /robot_description, but that hasn't been set. You set /first_pelican/robot_description instead.

The solution is to change

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

to

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param /first_pelican/robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

Edit:

This line may be the culprit

The root link chassis has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.

Try adding a dummy link and move the inertia to that one. https://answers.ros.org/question/192817/error-msg-the-root-link_base-has-an-inertia-specified-in-the-urdf-but-kdl/?answer=192861#post-id-192861

The problem is that gazebo_ros_control is looking for /robot_description, but that hasn't been set. You set /first_pelican/robot_description instead.

The solution is to change

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

to

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param /first_pelican/robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

Edit:

This line warning may be the culprit

The root link chassis has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.

Try adding a dummy link and move the inertia to that one. https://answers.ros.org/question/192817/error-msg-the-root-link_base-has-an-inertia-specified-in-the-urdf-but-kdl/?answer=192861#post-id-192861

The problem is that gazebo_ros_control is looking for /robot_description, but that hasn't been set. You set /first_pelican/robot_description instead.

The solution is to change

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

to

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param /first_pelican/robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

Edit:

This warning may be the culprit

The root link chassis has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.

Try adding a dummy link and move the inertia to that one. https://answers.ros.org/question/192817/error-msg-the-root-link_base-has-an-inertia-specified-in-the-urdf-but-kdl/?answer=192861#post-id-192861


Edit 2:

I'm not too familiar with URDF so this may not be exactly the solution but it should be a good starting point:

<link name="chassis_dummy">
  <inertial>
    <mass value="15.0"/>
    <origin xyz="0 0 0" rpy=" 0 0 0"/>
    <inertia
        ixx="0.1" ixy="0" ixz="0"
        iyy="0.1" iyz="0"
        izz="0.1"
    />
  </inertial>
</link>

<joint name="chassis_to_chassis_dummy" type="fixed">
  <parent link="chassis"/>
  <child link="chassis_dummy"/>
</joint>

The problem is that gazebo_ros_control is looking for /robot_description, but that hasn't been set. You set /first_pelican/robot_description instead.

The solution is to change

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

to

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param /first_pelican/robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

Edit:

This warning may be the culprit

The root link chassis has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.

Try adding a dummy link and move the inertia to that one. https://answers.ros.org/question/192817/error-msg-the-root-link_base-has-an-inertia-specified-in-the-urdf-but-kdl/?answer=192861#post-id-192861


Edit 2:

I'm not too familiar with URDF so this may not be exactly the solution but it should be a good starting point:

<link name="chassis_dummy">
  <inertial>
    <mass value="15.0"/>
    <origin xyz="0 0 0" rpy=" 0 0 0"/>
    <inertia
        ixx="0.1" ixy="0" ixz="0"
        iyy="0.1" iyz="0"
        izz="0.1"
    />
  </inertial>
</link>

<joint name="chassis_to_chassis_dummy" type="fixed">
  <parent link="chassis"/>
  <child link="chassis_dummy"/>
</joint>

And remove the inertial tags and everything between it (in the chassis link) because I moved it into this dummy link. For additional help refer to the URDF tutorials (which is how I came up with this).

The problem is that gazebo_ros_control is looking for /robot_description, but that hasn't been set. You set /first_pelican/robot_description instead.

The solution is to change

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

to

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param /first_pelican/robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

Edit:

This warning may be the culprit

The root link chassis has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.

Try adding a dummy link and move the inertia to that one. https://answers.ros.org/question/192817/error-msg-the-root-link_base-has-an-inertia-specified-in-the-urdf-but-kdl/?answer=192861#post-id-192861


Edit 2:

I'm not too familiar with URDF so this may not be exactly the solution but it should be a good starting point:

<link name="chassis_dummy">
  <inertial>
    <mass value="15.0"/>
    <origin xyz="0 0 0" rpy=" 0 0 0"/>
    <inertia
        ixx="0.1" ixy="0" ixz="0"
        iyy="0.1" iyz="0"
        izz="0.1"
    />
  </inertial>
</link>

<joint name="chassis_to_chassis_dummy" type="fixed">
  <parent link="chassis"/>
  <child link="chassis_dummy"/>
</joint>

And remove the inertial tags and everything between it them (in the chassis link) link only!) because I moved it into this dummy link. For additional help refer to the URDF tutorials (which is how I came up with this).

The problem is that gazebo_ros_control is looking for /robot_description, but that hasn't been set. You set /first_pelican/robot_description instead.

The solution is to change

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

to

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param /first_pelican/robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

Edit:

This warning may be the culprit

The root link chassis has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.

Try adding a dummy link and move the inertia to that one. https://answers.ros.org/question/192817/error-msg-the-root-link_base-has-an-inertia-specified-in-the-urdf-but-kdl/?answer=192861#post-id-192861


Edit 2:

I'm not too familiar with URDF so this may not be exactly the solution but it should be a good starting point:

<link name="chassis_dummy">
  <inertial>
    <mass value="15.0"/>
    <origin xyz="0 0 0" rpy=" 0 0 0"/>
    <inertia
        ixx="0.1" ixy="0" ixz="0"
        iyy="0.1" iyz="0"
        izz="0.1"
    />
  </inertial>
</link>

<joint name="chassis_to_chassis_dummy" type="fixed">
  <parent link="chassis"/>
  <child link="chassis_dummy"/>
</joint>

And remove the inertial tags and everything between them (in the chassis link only!) because I moved it into this dummy link. For additional help refer to the URDF tutorials (which is how I came up with this).


Edit 3:

I was finally able to get your robot to load in Gazebo by setting the robot_description parameter outside of the <group> tags. I then loaded (spawned) the URDF (robot) in Gazebo inside the <group> tags:

<arg name="robot_description"
     default="$(find urdf_test_pkg)/model/robot.xacro"/>
<param name="/robot_description"
   command="$(find xacro)/xacro --inorder $(arg robot_description) namesapce_deploy:=$(arg ns_1)"/>

<group ns="$(arg ns_1)">
    <node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param /robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

    <!-- convert joint states to TF transforms for rviz, etc -->
    <!-- Notice the leading '/' in '/robot_description'
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="false" output="screen">
        <remap from="/joint_states" to="/$(arg ns_1)/joint_states" />
    </node>
</group>

Notice when I'm spawning the robot I specifically attach the leading / to /robot_description. This causes the spawner to grab the global parameter /robot_description. This should solve the issue of spawning the robot.

The problem is that gazebo_ros_control is looking for /robot_description, but that hasn't been set. You set /first_pelican/robot_description instead.

The solution is to change

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

to

<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param /first_pelican/robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

Edit:

This warning may be the culprit

The root link chassis has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.

Try adding a dummy link and move the inertia to that one. https://answers.ros.org/question/192817/error-msg-the-root-link_base-has-an-inertia-specified-in-the-urdf-but-kdl/?answer=192861#post-id-192861


Edit 2:

I'm not too familiar with URDF so this may not be exactly the solution but it should be a good starting point:

<link name="chassis_dummy">
  <inertial>
    <mass value="15.0"/>
    <origin xyz="0 0 0" rpy=" 0 0 0"/>
    <inertia
        ixx="0.1" ixy="0" ixz="0"
        iyy="0.1" iyz="0"
        izz="0.1"
    />
  </inertial>
</link>

<joint name="chassis_to_chassis_dummy" type="fixed">
  <parent link="chassis"/>
  <child link="chassis_dummy"/>
</joint>

And remove the inertial tags and everything between them (in the chassis link only!) because I moved it into this dummy link. For additional help refer to the URDF tutorials (which is how I came up with this).


Edit 3:

I was finally able to get your robot to load in Gazebo by setting the robot_description parameter outside of the <group> tags. I then loaded (spawned) the URDF (robot) in Gazebo inside the <group> tags:

<arg name="robot_description"
     default="$(find urdf_test_pkg)/model/robot.xacro"/>
<param name="/robot_description"
   command="$(find xacro)/xacro --inorder $(arg robot_description) namesapce_deploy:=$(arg ns_1)"/>

<group ns="$(arg ns_1)">
    <node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
    args="-urdf -param /robot_description -model mybot_$(arg ns_1)
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" respawn="false" />

    <!-- convert joint states to TF transforms for rviz, etc -->
    <!-- Notice the leading '/' in '/robot_description'
'/robot_description' -->
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="false" output="screen">
        <remap from="/joint_states" to="/$(arg ns_1)/joint_states" />
    </node>
</group>

Notice when I'm spawning the robot I specifically attach the leading / to /robot_description. This causes the spawner to grab the global parameter /robot_description. This should solve the issue of spawning the robot.