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

Move specification from ROS wiki to the urdfdom repo #183

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
19d414a
Add first page of specification
traversaro May 9, 2023
6dd05b6
Update README.md
traversaro May 9, 2023
1ce7ef7
Create joint.md
traversaro May 9, 2023
740f78e
Rename joint.md to link.md
traversaro May 9, 2023
7a616d9
Add files via upload
traversaro May 9, 2023
84f6ca1
Update README.md
traversaro May 9, 2023
5960e8a
Update link.md
traversaro May 9, 2023
8724dc5
Update
traversaro May 9, 2023
7f760db
Update link.md
traversaro May 9, 2023
ce50021
Update link.md
traversaro May 9, 2023
26e3b0c
Update link.md
traversaro May 9, 2023
b63f715
Update link.md
traversaro May 9, 2023
efb57e6
Merge branch 'master' into movespecification
traversaro Jan 20, 2024
e317633
add robot and link
harleylara Feb 15, 2024
5e9b5b4
add sensor and gazebo element
harleylara Feb 15, 2024
b941359
Merge pull request #1 from harleylara/movespecification
traversaro Feb 15, 2024
134b839
Support checking a URDF given on stdin (#171)
nickswalker Aug 28, 2023
bde3e64
Upgrade from tinyxml to tinyxml2 (#186)
felixf4xu Dec 6, 2023
3472d7a
Do not install CMake config files in a different directory (#188)
traversaro Dec 6, 2023
89cd02f
Remove tinyxml2 from public dependencies. (#190)
clalancette Dec 8, 2023
1e2932f
CMakeLists.txt: Some fixes for Relocatable package (#179)
DasRoteSkelett Dec 20, 2023
4134022
Deprecate the APIs that we think are unused. (#191)
clalancette Dec 20, 2023
6a5a7e6
4.0.0
clalancette Dec 26, 2023
7455f50
add robot and link
harleylara Feb 15, 2024
384b855
add sensor and gazebo element
harleylara Feb 15, 2024
ef9da3a
Merge branch 'movespecification' of github.com:traversaro/urdfdom int…
harleylara Feb 15, 2024
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ urdfdom

The URDF (U-Robot Description Format) library provides core data structures and a simple XML parsers for populating the class data structures from an URDF file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The URDF (U-Robot Description Format) library provides core data structures and a simple XML parsers for populating the class data structures from an URDF file.
The URDF (Unified Robot Description Format) library provides core data structures and a simple XML parsers for populating the class data structures from an URDF file.


For now, the details of the URDF specifications reside on http://ros.org/wiki/urdf
The details of the URDF specifications reside in the [specification folder](specification) in this repo.


### Using with ROS

Expand Down
47 changes: 47 additions & 0 deletions specification/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# XML Robot Description Format (URDF)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# XML Robot Description Format (URDF)
# Unified Robot Description Format (URDF)

?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely it is Unified 😂... For some reason in the wiki is written as "XML ..."

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess keeping consistency would be prefered ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one please where I think we should make a change from the wiki, and call it "Unified" as is appropriate.


The Unified Robot Description Format (URDF) is an XML specification to describe a robot. We attempt to keep this specification as general as possible, but obviously the specification cannot describe all robots. The main limitation at this point is that only tree structures can be represented, ruling out all parallel robots. Also, the specification assumes the robot consists of rigid links connected by joints; flexible elements are not supported. The specification covers:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, nowadays we prefer one-sentence-per-line. That's so that review on particular sentences are easier in the future. So I'll suggest doing that here, as well as in all places it makes sense below.


* Kinematic and dynamic description of the robot
* Visual representation of the robot
* Collision model of the robot

<img src="link.png" alt="Link" height="472">

The description of a robot consists of a set of [link elements](./link.md), and a set of [joint elements](./joint.md) connecting the links together. So a typical robot description looks something like this:

~~~xml
<?xml version="1.0"?>
<?xml-model href="https://raw.githubusercontent.com/ros/urdfdom/master/xsd/urdf.xsd"?>
<robot name="pr2" xmlns="http://www.ros.org">
<link> ... </link>
<link> ... </link>
<link> ... </link>

<joint> .... </joint>
<joint> .... </joint>
<joint> .... </joint>
</robot>
~~~

You can see that the root element of the URDF format is a `<robot>` element.

## `<robot>` element

The `<robot>` element describes all properties of a robot. For details on the root description format, check out the [robot element](./robot.md) page.

## `<link>` element

For details on the `<link>` description format, check out the [link element](./link.md) page.

## `<joint>` element

For details on the `<joint>` description format, check out the [joint element](./joint.md) page.

## `<gazebo>` element

For details on the `<gazebo>` description format, check out the [gazebo element](./gazebo.md) page.

## `<sensor>` element

For details on the `<senosr>` description format, check out the [sensor element](./sensor.md) page.
Comment on lines +33 to +47
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I almost think that all of these should be removed. This is changing a bit from the source material, but I also think that since all of these have to be under the <robot> heading, it makes more sense to structure it that way.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also got confused here

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree... the specification/README.md we can try to keep it with general information about the specification, such as the spec target, current limitations, current version, among others matters.

Binary file added specification/cylinder_coordinates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions specification/gazebo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# `<gazebo>` element

The gazebo element is an extension to the URDF robot description format, used for simulation purposes in the [Gazebo](https://gazebosim.org/) simulator.

For full documentation of the Gazebo element, see [Using A URDF In Gazebo](http://gazebosim.org/tutorials?tut=ros_urdf&cat=connect_ros) (for Gazebo Classic) or [SDFormat extensions to URDF (the `<gazebo>` tag)](http://sdformat.org/tutorials?tut=sdformat_urdf_extensions&cat=specification&) (for new Gazebo).
Binary file added specification/inertial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
132 changes: 132 additions & 0 deletions specification/joint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# `<joint>` element

The joint element describes the kinematics and dynamics of the joint and also specifies the [safety limits](http://wiki.ros.org/pr2_controller_manager/safety_limits) of the joint.

![example-joint](./joint.png)

## Attributes

| attribute | type | use | default value | description |
| --------- | ----------- | -------- | ------------- | ------------------------------------------------------------------------------ |
| `name` | `string` | required | NA | Specifies a unique name of the join. |
| `type` | `JointType` | required | NA | Specifies the type of joint, see "Type: `JointType`" section for more details. |

### Type: `JointType`

where type can be one of the following:
- `revolute`: a hinge joint that rotates along the axis and has a limited range specified by the upper and lower limits.
- `continuous`: a continuous hinge joint that rotates around the axis and has no upper and lower limits.
- `prismatic`: a sliding joint that slides along the axis, and has a limited range specified by the upper and lower limits.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `prismatic`: a sliding joint that slides along the axis, and has a limited range specified by the upper and lower limits.
- `prismatic`: a sliding joint that slides along the axis, and has a limited range specified by the upper and lower limits. The joint can only slide along the axis and cannot rotate along it (imagine a rectangular piston, not a cylindrical one).

- `fixed`: this is not really a joint because it cannot move. All degrees of freedom are locked. This type of joint does not require the `<axis>`, `<calibration>`, `<dynamics>`, `<limits>` or `<safety_controller>`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `fixed`: this is not really a joint because it cannot move. All degrees of freedom are locked. This type of joint does not require the `<axis>`, `<calibration>`, `<dynamics>`, `<limits>` or `<safety_controller>`.
- `fixed`: this is not really a joint because it cannot move. All degrees of freedom are locked. This type of joint does not require the `<axis>`, `<calibration>`, `<dynamics>`, `<limits>` or `<safety_controller>`. It is used to rigidly connect logical parts of the robot.

- `floating`: this joint allows motion for all 6 degrees of freedom.
- `planar`: this joint allows motion in a plane perpendicular to the axis.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `planar`: this joint allows motion in a plane perpendicular to the axis.
- `planar`: this joint allows motion in a plane perpendicular to the axis and intersecting the joint frame origin.


## Elements

The joint element has following elements:

| element | use |
| ------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| [`<parent>`](#parent) | required |
| [`<child>`](#child) | required |
| [`<origin>`](#origin) | optional: defaults to identity if not specified |
| [`<axis>`](#axis) | optional: defaults to (1,0,0) |
| [`<calibration>`](#calibration) | optional |
| [`<dynamics>`](#dynamics) | optional |
| [`<limit>`](#limit) | required only for revolute and prismatic joint |
| [`<mimic>`](#mimic) | optional (New with ROS Groovy. See [issue](https://github.com/ros/robot_state_publisher/issues/1)) |
| [`<safety_controller>`](#safety_controller) | optional |

### `<origin>`

This is the transform from the parent link to the child link. The joint is located at the origin of the child link, as shown in the figure above.

| attribute | type | use | default value | description |
| --------- | -------- | -------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `xyz` | `string` | optional | zero vector | Represents the x, y, z offset. All positions are specified in metres. |
| `rpy` | `string` | optional | zero vector | Represents the rotation around fixed axis: first roll around x, then pitch around y and finally yaw around z. All angles are specified in radians. |

### `<parent>`

| attribute | type | use | default value | description |
| --------- | -------- | -------- | ------------- | --------------------------------------------------------------------------------- |
| `link` | `string` | required | NA | The name of the link that is the parent of this link in the robot tree structure. |

### `<child>`

| attribute | type | use | default value | description |
| --------- | ------ | -------- | ------------- | -------------------------------------------- |
| `link` | `string` | required | NA | The name of the link that is the child link. |

### `<axis>`

The joint axis specified in the joint frame. This is the axis of rotation for revolute joints, the axis of translation for prismatic joints, and the surface normal for planar joints. The axis is specified in the joint frame of reference. Fixed and floating joints do not use the axis field.

| attribute | type | use | default value | description |
| --------- | -------- | -------- | ------------- | --------------------------------------------------------------------------------- |
| `xyz` | `string` | required | NA | Represents the (x, y, z) components of a vector. The vector should be normalized. |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `xyz` | `string` | required | NA | Represents the (x, y, z) components of a vector. The vector should be normalized. |
| `xyz` | `string` | required for some joint types | NA | Represents the (x, y, z) components of a vector. The vector should be normalized. |


### `<calibration>`

The reference positions of the joint, used to calibrate the absolute position of the joint.

| attribute | type | use | default value | description |
| --------- | -------- | -------- | ------------- | -------------------------------------------------------------------------------------------------- |
| `rising` | `double` | optional | ??? | When the joint moves in a positive direction, this reference position will trigger a rising edge. |
| `falling` | `double` | optional | ??? | When the joint moves in a positive direction, this reference position will trigger a falling edge. |

### `<dynamics>`

An element specifying physical properties of the joint. These values are used to specify modeling properties of the joint, particularly useful for simulation.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
An element specifying physical properties of the joint. These values are used to specify modeling properties of the joint, particularly useful for simulation.
An element specifying physics-related properties of the joint. These values are used to specify modelling properties of the joint, particularly useful for simulation.


| attribute | type | use | default value | description |
| ---------- | -------- | -------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `damping` | `double` | optional | defaults to 0 | The physical damping value of the joint (in newton-seconds per metre [N∙s/m] for prismatic joints, in newton-metre-seconds per radian [N∙m∙s/rad] for revolute joints). |
| `friction` | `double` | optional | defaults to 0 | The physical static friction value of the joint (in newtons [N] for prismatic joints, in newton-metres [N∙m] for revolute joints). |

### `<limit>`

(required only for revolute and prismatic joint)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(required only for revolute and prismatic joint)
(applies only to revolute and prismatic joints)


| attribute | type | use | default value | description |
| ---------- | -------- | -------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `effort` | `double` | required | NA | An attribute for enforcing the maximum joint effort (\|applied effort\| < \|effort\|). See safety limits. |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `effort` | `double` | required | NA | An attribute for enforcing the maximum joint effort (\|applied effort\| < \|effort\|). See safety limits. |
| `effort` | `double` | required | NA | An attribute for enforcing the maximum joint effort in Newtons or Newton-meters (\|applied effort\| < \|effort\|). See safety limits. |

| `velocity` | `double` | required | NA | An attribute for enforcing the maximum joint velocity (in radians per second [rad/s] for revolute joints, in metres per second [m/s] for prismatic joints). [See safety limits](http://wiki.ros.org/pr2_controller_manager/safety_limits). |
| `lower` | `double` | optional | defaults to 0 | An attribute specifying the lower joint limit (in radians for revolute joints, in metres for prismatic joints). Omit if joint is continuous. |
| `upper` | `double` | optional | defaults to 0 | An attribute specifying the upper joint limit (in radians for revolute joints, in metres for prismatic joints). Omit if joint is continuous. |

### `<mimic>`

(optional) (New with ROS Groovy. See issue)

This tag is used to specify that the defined joint mimics another existing joint. The value of this joint can be computed as value = multiplier * other_joint_value + offset.

| attribute | type | use | default value | description |
| ------------ | -------- | -------- | ------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `joint` | `string` | required | NA | This specifies the name of the joint to mimic. |
| `multiplier` | `double` | optional | defaults to 1 | Specifies the multiplicative factor in the formula above. |
| `offset` | `double` | optional | defaults to 0 | Specifies the offset to add in the formula above. Defaults to 0 (radians for revolute joints, meters for prismatic joints) |

### `<safety_controller>`

| attribute | type | use | default value | description |
| ------------------ | -------- | -------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `k_velocity` | `double` | required | NA | An attribute specifying the relation between effort and velocity limits. See See safety limits for more details. |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `k_velocity` | `double` | required | NA | An attribute specifying the relation between effort and velocity limits. See See safety limits for more details. |
| `k_velocity` | `double` | required | NA | An attribute specifying the relation between effort and velocity limits. See safety limits for more details. |

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed we should take this fix now.

| `soft_lower_limit` | `double` | optional | defaults to 0 | An attribute specifying the lower joint boundary where the safety controller starts limiting the position of the joint. This limit needs to be larger than the lower joint limit (see above). See [safety limits](http://wiki.ros.org/pr2_controller_manager/safety_limits) for more details. |
| `soft_upper_limit` | `double` | optional | defaults to 0 | An attribute specifying the upper joint boundary where the safety controller starts limiting the position of the joint. This limit needs to be smaller than the upper joint limit (see above). See [safety limits](http://wiki.ros.org/pr2_controller_manager/safety_limits) for more details. |
| `k_position` | `double` | optional | defaults to 0 | An attribute specifying the relation between position and velocity limits. See [safety limits](http://wiki.ros.org/pr2_controller_manager/safety_limits) for more details. |

## Example

```xml
<joint name="my_joint" type="floating">
<origin xyz="0 0 1" rpy="0 0 3.1416"/>
<parent link="link1"/>
<child link="link2"/>

<calibration rising="0.0"/>
<dynamics damping="0.0" friction="0.0"/>
<limit effort="30" velocity="1.0" lower="-2.2" upper="0.7" />
<safety_controller k_velocity="10" k_position="15" soft_lower_limit="-2.0" soft_upper_limit="0.5" />
</joint>
```
Binary file added specification/joint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading