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

gazebo_ros_control plugin is waiting for model URDF in parameter

asked 2017-08-12 12:40:31 -0600

balajithevoyager gravatar image

updated 2017-08-16 16:39:34 -0600

Please help.

Very few times the gazebo opens with the loaded model, almost 99 times it fails with the below error.

After searching for one day in all forums I tried the following, so far no luck :( 1) runnning verbose:=true 2) running rosrun gzclient and then the launch file 3) making sure box size is not zero in model description file 4) transmission type properly mentioned in model description file 5) gazebo ros control plugin installed and mentioned in model file 6) gazebo ros control plugin installed (please note that i was able to run the same launch before, suddenly this error is coming up) 7) checked namesapce

Launch file:

<?xml version="1.0" encoding="UTF-8"?>
<launch>

    <arg name="world" default="empty"/> 
    <arg name="paused" default="false"/>
    <arg name="use_sim_time" default="true"/>
    <arg name="gui" default="true"/>
    <arg name="headless" default="false"/>
    <arg name="debug" default="false"/>

    <arg name="x" default="0"/>
    <arg name="y" default="0"/>
    <arg name="x1" default="0"/>
    <arg name="y1" default="0"/>
    <arg name="z" default="0"/>
    <arg name="roll" default="0"/>
    <arg name="pitch" default="0"/>
    <arg name="yaw" default="0"/>

    <arg name="initial_pose_x" default="0"/>
    <arg name="initial_pose_y" default="0"/>
    <arg name="initial_pose_a" default="0.0"/>
    <arg name="take_break" default="5.0"/>
    <arg name="world_name" default="$(find robot_gazebo)/worlds/world_2.world" />

    <arg name="ns_1" default="first_pelican" />

    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" value="$(arg world_name)"/>
        <arg name="paused" value="$(arg paused)"/>
        <arg name="use_sim_time" value="$(arg use_sim_time)"/>
        <arg name="gui" value="$(arg gui)"/>
        <arg name="headless" value="$(arg headless)"/>
        <arg name="debug" value="$(arg debug)"/>
    </include>


    <group ns="$(arg ns_1)">
        <param name="robot_description" command="$(find xacro)/xacro.py '$(find robot_description)/urdf/robot.xacro' namesapce_deploy:=$(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" />

        <!-- Load joint controller configurations from YAML file to parameter server -->
        <rosparam file="$(find robot_gazebo)/config/robot_control.yaml" command="load"/>

        <!-- load the controllers -->
        <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
        output="screen" ns="/$(arg ns_1)" args="joint_state_controller joint1_position_controller"/>

        <!-- convert joint states to TF transforms for rviz, etc -->
        <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>

        <!--  ************** Red circle image detection  ***************  -->
        <node name="image_processing_node" pkg="image_processing" type="image_processing_node" output="screen">
            <param name="namesapce_deploy" value="$(arg ns_1)"/>
        </node>

        <!--  ************** Navigation  ***************  -->
        <node name="smart_exploration" type="smart_exploration" pkg="robot_exploration" output="screen">
            <param name="dist_x" value="$(arg x)"/>
            <param name="dist_y" value="$(arg y)"/>
            <param name="namesapce_deploy" value="$(arg ns_1)"/>
        </node>

    </group>

</launch>

Trace:

balaji@balaji:~/Documents/balaji/unl/Media/Downloads/robot_ws_final$ source devel/setup.bash 
balaji@balaji:~/Documents/balaji/unl/Media/Downloads/robot_ws_final$ roslaunch robot_gazebo robot_world.launch 
... logging to /home/balaji/.ros/log/e78e4fbc-7f83-11e7-9f51-9801a7b07983/roslaunch-balaji-31825.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
WARNING: disk usage in log directory [/home/balaji/.ros ...
(more)
edit retag flag offensive close merge delete

Comments

1

Can you post your launch file? I recently solved a very similar problem on my system. You might also get quicker assistance on the Gazebo Answers site.

rmck gravatar image rmck  ( 2017-08-15 20:14:23 -0600 )edit

Thanks rmck for replying back, please find the launch file above, I have edited my question

balajithevoyager gravatar image balajithevoyager  ( 2017-08-15 20:24:51 -0600 )edit

Which ROS version are you using?

You can get rid of the xacro error by changing your xacro line, remove .py and add --inorder between xacro and find

rmck gravatar image rmck  ( 2017-08-15 20:37:38 -0600 )edit

@balajithevoyager: Also, please use the Preformatted Text (101010) button. It makes it much easier to read your terminal output.

jayess gravatar image jayess  ( 2017-08-15 20:42:23 -0600 )edit

I am using ROS kinetic, I tried removing the .py and placed --inorder as given below, but still having the same issue

<param name="robot_description" command="$(find xacro)/xacro --inorder '$(find robot_description)/urdf/robot.xacro' namesapce_deploy:=$(arg ns_1)"/>
balajithevoyager gravatar image balajithevoyager  ( 2017-08-15 21:30:54 -0600 )edit

Where is your macros.xacro file?

jayess gravatar image jayess  ( 2017-08-16 17:07:21 -0600 )edit

Following is the macros.xacro file content

<?xml version="1.0"?>
<robot>
</robot>
balajithevoyager gravatar image balajithevoyager  ( 2017-08-16 18:18:04 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-08-15 23:09:56 -0600

jayess gravatar image

updated 2017-08-17 13:03:12 -0600

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/1928...


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.

edit flag offensive delete link more

Comments

1

There's also a repeated typo that may be affecting it, you've written namesapce rather than namespace

rmck gravatar image rmck  ( 2017-08-16 00:09:18 -0600 )edit

@rmck are you referring to me or @balajithevoyager? If you're referring to me I don't see it.

jayess gravatar image jayess  ( 2017-08-16 00:12:54 -0600 )edit

@balajithevoyager's use of namesapce seems to be consistent though so that may not be the issue.

jayess gravatar image jayess  ( 2017-08-16 00:17:29 -0600 )edit

@jayess, yeah, was referring to the original post.

rmck gravatar image rmck  ( 2017-08-16 00:24:47 -0600 )edit

I have changed /robot_description to /first_pelican/robot_description in the node name of "mybot_spawn", but unfortunately the issue is still present with same message:

gazebo_ros_control plugin is waiting for model URDF in parameter [/robot_description] on the ROS param server.
balajithevoyager gravatar image balajithevoyager  ( 2017-08-16 08:20:51 -0600 )edit

Thanks Jayess and rmck for helping out, I really aprreciate it. To better understand the issue, I am uploading the model file as well in the question, these are the files that I have in urdf folder

balajithevoyager gravatar image balajithevoyager  ( 2017-08-16 08:23:04 -0600 )edit

Hi Jayess, I tried to see about the dummy link warning, as per this website https://bitbucket.org/osrf/gazebo/iss... , I ensured all the links has intertial element but the issue is not resolved. Please let me know what changes need to be done other than this

balajithevoyager gravatar image balajithevoyager  ( 2017-08-16 14:40:58 -0600 )edit

That's a very old issue (2012) and I'm not sure that's it. Did you try creating a dummy link like I said? The problem is that the root link chassis cannot have an inertia. The workaround is to create a dummy one and give that one an inertia.

jayess gravatar image jayess  ( 2017-08-16 14:46:49 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2017-08-12 12:40:31 -0600

Seen: 5,944 times

Last updated: Aug 17 '17