Hi all,
I've updated my Gazebo that came packaged with ROS Groovy as my laptop graphics card hated it. And am now running Gazebo 1.4.
I can spawn urdf models and have the ros api plugin working fine. When it comes to getting my robot controller plugin working I seem to hit a bit of a wall. Here is an example bit of code that has the same issue, which is taken from this tutorial.
<?xml version="1.0" ?>
<robot name="single_joint">
<gazebo reference="base">
<material>Gazebo/GrassFloor</material>
</gazebo>
<link name="world"/>
<joint name="link_joint" type="continuous">
<axis xyz="0 0 1"/>
<parent link="world"/>
<origin rpy="0 0 0" xyz="0 0 1"/>
<child link="link"/>
<limit effort="100" velocity="100" k_velocity="0" />
<joint_properties damping="0.1" friction="1.0" />
</joint>
<link name="link">
<inertial>
<mass value="10"/>
<origin xyz="0 0 0"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="0.1" iyz="0.0" izz="0.1"/>
</inertial>
<visual>
<origin rpy="0 0 1" xyz="0 0 0"/>
<geometry>
<box size="0.2 1.0 0.2"/>
</geometry>
</visual>
<collision>
<origin rpy="0 0 1" xyz="0 0 0"/>
<geometry>
<box size="0.2 1.0 0.2"/>
</geometry>
</collision>
</link>
<gazebo reference="link">
<material>Gazebo/GrassFloor</material>
<turnGravityOff>true</turnGravityOff>
</gazebo>
<gazebo>
<controller:gazebo_ros_force name="gazebo_ros_force" plugin="libgazebo_ros_force.so">
<alwaysOn>true</alwaysOn>
<update>100</update>
<updateRate>100.0</updateRate>
<bodyName>link</bodyName>
<topicName>force</topicName>
</controller:gazebo_ros_force>
</gazebo>
</robot>
and running with the usual;
rosmake gazebo_worlds
roslaunch gazebo_worlds empty_world.launch
rosrun gazebo spawn_model -file object.urdf -urdf -z 1 -model my_object
I get;
...
[ INFO] [1365999923.235584629, 0.076000000]: Starting to spin physics dynamic reconfigure node...
Warning [parser.cc:377] SDF has no <sdf> element in file[data-string]
Error [parser.cc:712] XML Element[turnGravityOff], child of element[link] not defined in SDF. Ignoring.[link]
Error [parser.cc:703] Error reading element <link>
Error [parser.cc:703] Error reading element <model>
Error [parser.cc:369] Unable to read element <sdf>
Error [parser.cc:319] parse as old deprecated model file failed.
Error [World.cc:1299] Unable to read sdf string
...
I have found that the urdf method of getting gazebo to load the plugin seems to fail in the parser.cc which then results in gazebo falling back to try parse it as a sdf, which it then fails further on.
Now I know the intent is to do away with urdf's eventually, but this method of plugging in the plugin into gazebo seemed to work on my other machine with ROS-Fuerte and Gazebo 1.2, and even seems to work on my colleges laptop with ROS-Groovy and the inbuilt ROS gazebo (1.3).
Bit of a head scratcher. Should I;
- update my Gazebo to 1.5/1.6 instead? (i.e. is 1.4 a bit of a dog?)
- revert my gazebo to a standalone 1.3.
- bite the bullet and figure out a way to convert all my xacro'd urdf's to sdf?
Originally posted by JezzaC on Gazebo Answers with karma: 1 on 2013-04-15
Post score: 0
Original comments
Comment by ffurrer on 2013-04-16:
Did the exact code above work on your other machine?