Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for the URDF xsd specification #200

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 88 additions & 13 deletions xsd/urdf.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,19 @@

-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.ros.org"
xmlns="http://www.ros.org"
elementFormDefault="qualified">
elementFormDefault="unqualified">

<!-- data type definitions -->
<xs:simpleType name="JointType">
<xs:restriction base="xs:string">
<xs:enumeration value="revolute"/>
<xs:enumeration value="continuous"/>
<xs:enumeration value="prismatic"/>
<xs:enumeration value="fixed"/>
<xs:enumeration value="floating"/>
<xs:enumeration value="planar"/>
</xs:restriction>
</xs:simpleType>

<!-- pose node type -->
<xs:complexType name="pose">
Expand Down Expand Up @@ -142,20 +152,16 @@
<xs:element name="verbose"
type="verbose" minOccurs="0" maxOccurs="1" />
</xs:sequence>
<!-- FIXME: used but not documented -->
<xs:attribute name="name" type="xs:string" />
</xs:complexType>

<!-- link node type -->
<xs:complexType name="link">
<xs:all>
<xs:element name="inertial"
type="inertial" minOccurs="0" maxOccurs="1" />
<xs:element name="visual"
type="visual" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="collision"
type="collision" minOccurs="0" maxOccurs="unbounded" />
</xs:all>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="inertial" type="inertial" minOccurs="0" maxOccurs="1" />
<xs:element name="visual" type="visual" />
<xs:element name="collision" type="collision" />
</xs:choice>
<xs:attribute name="name" type="xs:string" use="required" />

<!-- FIXME: undocumented but used by PR2 -->
Expand Down Expand Up @@ -270,6 +276,69 @@
<xs:attribute name="type" type="xs:string" use="required" />
</xs:complexType>

<!-- image node type -->
<xs:complexType name="image">
<xs:attribute name="width" type="xs:unsignedInt" use="required" />
<xs:attribute name="height" type="xs:unsignedInt" use="required" />
<xs:attribute name="format" type="xs:string" use="required" />
<xs:attribute name="hfov" type="xs:double" use="required" />
<xs:attribute name="near" type="xs:double" use="required" />
<xs:attribute name="far" type="xs:double" use="required" />
</xs:complexType>

<!-- camera node type -->
<xs:complexType name="camera">
<xs:sequence>
<xs:element name="image"
type="image" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:complexType>

<!-- horizontal ray node type -->
<xs:complexType name="LaserRay">
<xs:attribute name="samples" type="xs:unsignedInt" default="1" />
<xs:attribute name="resolution" type="xs:unsignedInt" default="1"/>
<xs:attribute name="min_angle" type="xs:double" default="0" />
<xs:attribute name="max_angle" type="xs:double" default="0" />
</xs:complexType>

<!-- ray node type -->
<xs:complexType name="ray">
<xs:sequence>
<xs:element name="horizontal"
type="LaserRay" minOccurs="0" maxOccurs="1" />
<xs:element name="vertical"
type="LaserRay" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:complexType>

<!-- sensor node type -->
<xs:complexType name="sensor">
<xs:sequence>
<xs:element name="origin"
type="pose" minOccurs="0" maxOccurs="1" />
<xs:element name="parent"
type="parent" minOccurs="1" maxOccurs="1" />
<xs:choice>
<xs:element name="camera" type="camera" minOccurs="0" maxOccurs="1"/>
<xs:element name="ray" type="ray" minOccurs="0" maxOccurs="1" />
</xs:choice>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="update_rate" type="xs:string" />
</xs:complexType>

<xs:complexType name="gazebo">
<!-- Allow any content within gazebo -->
<!-- for Gazebo Classic:
https://classic.gazebosim.org/tutorials?tut=ros_urdf&cat=connect_ros -->
<!-- for newest Gazebo:
http://sdformat.org/tutorials?tut=sdformat_urdf_extensions&cat=specification&-->
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax" />
</xs:sequence>
</xs:complexType>

<!-- joint node type -->
<xs:complexType name="joint">
<xs:all>
Expand All @@ -293,7 +362,7 @@
type="mimic" minOccurs="0" maxOccurs="1" />
</xs:all>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="type" type="xs:string" use="required" />
<xs:attribute name="type" type="JointType" use="required" />
</xs:complexType>

<!-- root node is always robot -->
Expand All @@ -314,6 +383,12 @@
type="transmission" minOccurs="0" maxOccurs="unbounded" />

<!-- FIXME: gazebo extension not supported -->
<xs:element name="gazebo"
type="gazebo" minOccurs="0" maxOccurs="unbounded" />

<xs:element name="sensor"
type="sensor" minOccurs="0" maxOccurs="unbounded" />

</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />

Expand Down