writing a revolute joint
I'm trying to build a door model but I can't seem to get the coding for revolute joints right. the "base_link" is the wall and "door" is the door.
My code "door.xml" is here
<?xml version="1.0"?>
<robot name="door">
<link name="base_link">
<visual>
<geometry>
<box size="0.6 0.05 0.6"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0.3"/>
<material name="white">
<color rgba="1 1 1 1"/>
</material>
</visual>
<!--<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="100.0" iyz="0.0" izz="1.0" />
</inertia>-->
</link>
<link name="door">
<visual>
<geometry>
<box size="0.3 0.05 0.6"/>
</geometry>
<origin rpy="0 0 0" xyz="0.15 -0.025 0"/>
</visual>
</link>
<joint name="hinge" type="revolute">
<limit upper="0" lower="-1.57"velocity="10" effort="10"/>
<origin xyz="0.3 0.025 .3"/>
<axis xyz="0 0 1" />
<parent link="base_link"/>
<child link="door"/>
</joint>
</robot>
I yield the following error
Traceback (most recent call last):
File "/opt/ros/fuerte/stacks/robot_model_visualization/joint_state_publisher/joint_state_publisher", line 202, in <module>
jsp = JointStatePublisher()
File "/opt/ros/fuerte/stacks/robot_model_visualization/joint_state_publisher/joint_state_publisher", line 25, in __init__
robot = xml.dom.minidom.parseString(description).getElementsByTagName('robot')[0]
File "/usr/lib/python2.7/xml/dom/minidom.py", line 1930, in parseString
return expatbuilder.parseString(string)
File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 940, in parseString
return builder.parseString(string)
File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 223, in parseString
parser.Parse(string, True)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 47, column 34
Here's a picture of how it looks like on rviz when I run roslaunch urdf_tutorial display.launch model:=door.xml door.png
The visualization on rviz works perfectly find when I use continuous or fixed joints. So I'm not sure whether it is due to my code or some python related script. I'm running on Ubuntu 12.04, Fuerte.
Thanks!
I wouldn't define origin of the "door" link. It's excessive. Instead define it in the joint declaration.
Peter>> How do you define it in joint declaration? I want the joint to be connected to the side of the door rather than right smack in the middle. The only way I know how to shift it is to declare origin for the door. >.<
This guy is very handsome and might answer your question: https://www.youtube.com/watch?v=g9WHxOpAUns&t=16m34s