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

Error adding controller script in simple urdf model to be simulated on GAZEBO.

asked 2013-02-12 16:45:10 -0500

Bharadwaj gravatar image

updated 2013-02-13 06:52:23 -0500

I have URDF model of the single leg of a robot. My goal is to be able to give the joints a effort command and make it stand eventually. My URDF file is as follows.

<?xml version="1.0" ?>
<robot name="huboleg" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <link name="Body_LHP">
    <inertial>
      <mass value="2.8201"/>
      <inertia ixx="0.0295102" ixy="0.000184399" ixz="-0.000370291" iyy="0.0273771" iyz="0.00065658" izz="0.00838035"/>
      <origin xyz="0.0195049 -0.0595775 -0.175202"/>
    </inertial>
    <visual>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LHP_vis.dae"/>
      </geometry>
      <material name="random">
        <color rgba="0.800000 0.800000 0.500000 1"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LHP_col.dae"/>
      </geometry>
    </collision>
  </link>
  <link name="Body_LKP">
    <inertial>
      <mass value="1.80912"/>
      <inertia ixx="0.0232156" ixy="0.000251648" ixz="-0.00129343" iyy="0.0208342" iyz="0.00278068" izz="0.0059204"/>
      <origin xyz="0.0128254 -0.00727567 -0.171431"/>
    </inertial>
    <visual>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LKP_vis.dae"/>
      </geometry>
      <material name="random">
        <color rgba="0.800000 0.800000 0.500000 1"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LKP_col.dae"/>
      </geometry>
    </collision>
  </link>
  <link name="Body_LAP">
    <inertial>
      <mass value="1.63501"/>
      <inertia ixx="0.00231659" ixy="1.87402e-05" ixz="0.000369899" iyy="0.00330411" iyz="6.38153e-05" izz="0.00279495"/>
      <origin xyz="0.0198702 -0.0459693 0.0115069"/>
    </inertial>
    <visual>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LAP_vis.dae"/>
      </geometry>
      <material name="random">
        <color rgba="0.800000 0.800000 0.500000 1"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LAP_col.dae"/>
      </geometry>
    </collision>
  </link>
  <link name="Body_LAR">
    <inertial>
      <mass value="1.20318"/>
      <inertia ixx="0.00295183" ixy="3.23211e-05" ixz="0.000141769" iyy="0.00524792" iyz="5.95404e-05" izz="0.00516817"/>
      <origin xyz="-0.0515094 0.00216398 -0.0693881"/>
    </inertial>
    <visual>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LAR_vis.dae"/>
      </geometry>
      <material name="random">
        <color rgba="0.800000 0.800000 0.500000 1"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LAR_col.dae"/>
      </geometry>
    </collision>
  </link>
  <joint name="LKP" type="revolute">
    <origin rpy="0 -0 0" xyz="0.000766364 -0.0445011 -0.280007"/>
    <parent link="Body_LHP"/>
    <child link="Body_LKP"/>
    <axis xyz="0 1 0"/>
    <limit effort="10.0" lower="-0.0698132" upper="2.60054" velocity="1.0"/>
  </joint>
  <joint name="LAP" type="revolute">
    <origin rpy="0 -0 0" xyz="7.20248e-06 0.0247555 -0.279942"/>
    <parent link="Body_LKP"/>
    <child link="Body_LAP"/>
    <axis xyz="0 1 0"/>
    <limit effort="10.0" lower="-1.29154" upper="1.69297" velocity="1.0"/>
  </joint>
  <joint name="LAR" type="revolute">
    <origin rpy="0 -0 0" xyz="0.0711787 -0.0466006 -1.04e-10"/>
    <parent link="Body_LAP"/>
    <child link="Body_LAR"/>
    <axis xyz="1 0 0"/>
    <limit effort="10.0" lower="-0.191986" upper="0.191986" velocity="1.0"/>
  </joint>
  <gazebo>
    <!-- robot model offset -->
    <pose>0 0 .66 0 0 0</pose>
  </gazebo>
  <transmission name="LKP_trans" type="pr2_mechanism_model/SimpleTransmission">
    <actuator name="LKP_motor" />
    <joint name="LKP" />
    <mechanicalReduction>1</mechanicalReduction>
    <motorTorqueConstant>1</motorTorqueConstant>
  </transmission>
  <transmission name="LAP_trans" type ...
(more)
edit retag flag offensive close merge delete

Comments

I have the same problem with Gazebo 1.5: http://answers.gazebosim.org/question/2389/plugins-via-urdf-not-parsing/ I believe it is because Gazebo > V1.3 doesn't parse urdf plugins like it use to so it fails parsing the file as a urdf and then attempts to parse as a sdf instead (and fails).

Jeremy Corbett gravatar image Jeremy Corbett  ( 2013-05-17 14:32:22 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-08-14 23:11:12 -0500

Alex2309 gravatar image

Maybe I'm late, but I have had the same problem and I find this page googling, the quick solution is:

Change from this

<controller:gazebo_ros_controller_manager name="gazebo_ros_controller_manager" plugin="libgazebo_ros_controller_manager.so">
    <alwaysOn>true</alwaysOn>
    <updateRate>1000.0</updateRate>
  </controller:gazebo_ros_controller_manager>

to this

   <plugin filename="libgazebo_ros_controller_manager.so" name="gazebo_ros_controller_manager">
  <alwaysOn>true</alwaysOn>
  <updateRate>1000.0</updateRate>
  <interface:audio name="gazebo_ros_controller_manager_dummy_iface" />
</plugin>
edit flag offensive delete link more
1

answered 2013-02-12 21:59:00 -0500

davinci gravatar image

Which version of Gazebo are you using and how do you spawn your robot? Do you use the -urdf option? It is trying to spawn it as if it was a newer sdf file. You can also try to update the rest of the model to the newer sdf syntax.

edit flag offensive delete link more

Comments

<node name="my_controller_spawner" pkg="pr2_controller_manager" type="spawner" output="screen" args="my_controller_name" /> This is what I use in my launch file to launch the robot with the controller started with it.

Bharadwaj gravatar image Bharadwaj  ( 2013-02-13 03:39:55 -0500 )edit

<node name="spawn_single_link" pkg="gazebo" type="spawn_model" args="-urdf -param robot_description -model pr2 -z 0.5" respawn="false" output="screen" /> Is this what I should use ? I am not able to follow what these two are doing. Can you please tell what each element is doing ? Thank You

Bharadwaj gravatar image Bharadwaj  ( 2013-02-13 03:41:33 -0500 )edit

@davinci : I have added all my launch files in the question , Can you please tell how I should change the node parameters. Can you also tell me if with this can I simulate the robot and the controller on GAZEBO, if now can you tell me what are the elements I have to change , Thanks a lot

Bharadwaj gravatar image Bharadwaj  ( 2013-02-13 06:57:11 -0500 )edit

I can't debug the sdf syntax for you, look in the sdf documentation here: http://gazebosim.org/sdf.html Debugging is easier if you spawn your model in command line: rosrun gazebo spawn_model -file model.model -gazebo -name model (perhaps renaming to .model and using -gazebo helps)

davinci gravatar image davinci  ( 2013-02-13 10:16:31 -0500 )edit

I can't debug the sdf syntax for you, look in the sdf documentation here: http://gazebosim.org/sdf.html

davinci gravatar image davinci  ( 2013-02-13 10:16:45 -0500 )edit

@Bharadwaj

Your problem is solved? Unfortunately I got the same problem

salman gravatar image salman  ( 2013-04-16 04:29:20 -0500 )edit

@salman :Sorry for my late reply. Yeah I did figure out to control joints when we have the URDF file. I was searching for answers in the wrong location. Follow the Gazebo tutorials and you will be able to arrive at the right answers. http://gazebosim.org/wiki/Tutorials/1.3/intermediate/control_model

Bharadwaj gravatar image Bharadwaj  ( 2014-03-29 15:25:46 -0500 )edit

Question Tools

Stats

Asked: 2013-02-12 16:45:10 -0500

Seen: 867 times

Last updated: Aug 14 '13