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

Spec 1.12: link_state, joint_state changes #1461

Merged
merged 21 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b979877
Spec 1.12: add _state suffix to state subelements
scpeters Feb 27, 2024
f5d2571
Define //joint_state in joint_state.sdf
scpeters Jul 7, 2024
f84706e
Update Migration guide
scpeters Jul 8, 2024
e577e15
Merge branch 'main' into scpeters/state_1_12_suffix
scpeters Jul 8, 2024
a6fccc3
Merge branch 'main' into scpeters/state_1_12_suffix
scpeters Jul 9, 2024
53a5378
Merge branch 'main' into scpeters/state_1_12_suffix
scpeters Jul 10, 2024
9af6119
update migration guide
scpeters Jul 20, 2024
13229e0
joint_state: add axis[2]?_state, deprecate angle
scpeters Jul 7, 2024
a0e86e6
link_state: add vector3 linear/angular components
scpeters Jul 8, 2024
f0e5536
Merge branch 'main' into scpeters/state_1_12
scpeters Aug 19, 2024
d7a887f
Add //link_state/angular_*/@degrees
scpeters Aug 20, 2024
4e07a21
Add //link_state/*_wrench, //joint_state/*/effort
scpeters Aug 20, 2024
a266d6b
Specify model_state within a model
scpeters Aug 20, 2024
56e59f8
nested_model test: Update state syntax
scpeters Aug 22, 2024
de15ea6
Add //world/include/model_state
scpeters Aug 26, 2024
17c8efd
Merge branch 'sdf15' into scpeters/state_1_12
scpeters Aug 26, 2024
3ecd891
Merge branch 'sdf15' into scpeters/state_1_12
scpeters Aug 27, 2024
3fa2308
Clarify element path in migration guide
scpeters Aug 28, 2024
8521907
Use force, torque instead of angular/linear_wrench
scpeters Aug 28, 2024
107146b
Merge remote-tracking branch 'origin/sdf15' into scpeters/state_1_12
scpeters Aug 28, 2024
1b77045
Clarify that degrees is only for rotational axes
scpeters Aug 28, 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
41 changes: 41 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,33 @@ ABI was broken for `sdf::Element`, and restored on version 11.2.1.

## SDFormat specification 1.11 to 1.12

### Additions

1. **joint_state.sdf**:
+ `//joint_state/axis_state/position`
+ `//joint_state/axis_state/velocity`
+ `//joint_state/axis_state/acceleration`
+ `//joint_state/axis_state/effort`
+ `//joint_state/axis2_state/position`
+ `//joint_state/axis2_state/velocity`
+ `//joint_state/axis2_state/acceleration`
+ `//joint_state/axis2_state/effort`

1. **link_state.sdf**:
+ `//link_state/linear_velocity`
+ `//link_state/angular_velocity`
+ `//link_state/linear_acceleration`
+ `//link_state/angular_acceleration`
+ `//link_state/linear_wrench`
+ `//link_state/angular_wrench`

1. **model.sdf**:
+ `//model/model_state`
+ `//model/include/model_state`

1. **world.sdf**:
+ `//world/include/model_state`

### Modifications

1. **state.sdf**, **model_state.sdf**, **joint_state.sdf**, **link_state.sdf**,
Expand All @@ -645,6 +672,20 @@ ABI was broken for `sdf::Element`, and restored on version 11.2.1.
`//world/joint` and `//state/insertions/joint` can represent inserted
`//world/joint` elements.

### Deprecations

1. **joint_state.sdf**:
+ `//joint_state/angle` is deprecated in favor of `//axis_state/position`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just to make it clear that it's still within joint_state.

Suggested change
+ `//joint_state/angle` is deprecated in favor of `//axis_state/position`
+ `//joint_state/angle` is deprecated in favor of `//joint_state/axis_state/position`

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, will fix

Copy link
Member Author

Choose a reason for hiding this comment

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

and `//axis2_state/position`.

1. **link_state.sdf**:
+ `//link_state/velocity` is deprecated in favor of `//link_state/angular_velocity`
and `//link_state/linear_velocity`.
+ `//link_state/acceleration` is deprecated in favor of `//link_state/angular_acceleration`
and `//link_state/linear_acceleration`.
+ `//link_state/wrench` is deprecated in favor of `//link_state/angular_wrench`
and `//link_state/linear_wrench`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I've commonly seen the term wrench refer to the 6D vector that represents torques and forces. If we split them into two 3D vectors, would it make sense to call them torque and force instead of angular_wrench and linear_wrench?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, that's a good point; I was trying to keep symmetry with angular_ and liner_ prefixes, but force and torque are better. I will update this

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated the pull request description with force and torque as well


## SDFormat specification 1.10 to 1.11

### Additions
Expand Down
92 changes: 91 additions & 1 deletion sdf/1.12/joint_state.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,101 @@
<description>Name of the joint</description>
</attribute>

<element name="angle" type="double" default="0" required="+">
<element name="angle" type="double" default="0" required="-1">
<attribute name="axis" type="unsigned int" default="0" required="1">
<description>Index of the axis.</description>
</attribute>

<description>Angle of an axis</description>
</element>

<element name="axis_state" required="0">
<description>
Contains the state of the first joint axis.
</description>

<element name="position" type="double" default="0" required="0">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't position be a vector?

Copy link
Member Author

Choose a reason for hiding this comment

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

this position element is under //joint_state/axis_state and represents the position of the first axis / degree of freedom. there is another position element under //joint_state/axis2_state for the second axis. this mirrors the specification of the //joint/axis and //joint/axis2 elements

<description>The position of the first joint axis.</description>

<attribute name="degrees" type="bool" default="false" required="0">
<description>
If true, the joint position is expressed in units of degrees [deg],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you specify that this would not apply to prismatic joints and the unit will be meters regardless of this attribute?

Copy link
Member Author

Choose a reason for hiding this comment

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

otherwise it is expressed in radians [rad].
</description>
</attribute>
</element>

<element name="velocity" type="double" default="0" required="0">
<description>The velocity of the first joint axis.</description>

<attribute name="degrees" type="bool" default="false" required="0">
<description>
If true, the joint velocity is expressed in units of degrees per
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to the position, can you add a qualifier for prismatic joints?

Copy link
Member Author

Choose a reason for hiding this comment

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

second [deg/s], otherwise it is expressed in radians per second
[rad/s].
</description>
</attribute>
</element>

<element name="acceleration" type="double" default="0" required="0">
<description>The acceleration of the first joint axis.</description>

<attribute name="degrees" type="bool" default="false" required="0">
<description>
If true, the joint acceleration is expressed in units of degrees per
second per second [deg/s^2], otherwise it is expressed in radians per
second per second [rad/s^2].
</description>
</attribute>
</element>

<element name="effort" type="double" default="0" required="0">
<description>The effort applied at the first joint axis.</description>
</element>
</element>

<element name="axis2_state" required="0">
<description>
Contains the state of the second joint axis.
</description>

<element name="position" type="double" default="0" required="0">
<description>The position of the second joint axis.</description>

<attribute name="degrees" type="bool" default="false" required="0">
<description>
If true, the joint position is expressed in units of degrees [deg],
otherwise it is expressed in radians [rad].
</description>
</attribute>
</element>

<element name="velocity" type="double" default="0" required="0">
<description>The velocity of the second joint axis.</description>

<attribute name="degrees" type="bool" default="false" required="0">
<description>
If true, the joint velocity is expressed in units of degrees per
second [deg/s], otherwise it is expressed in radians per second
[rad/s].
</description>
</attribute>
</element>

<element name="acceleration" type="double" default="0" required="0">
<description>The acceleration of the second joint axis.</description>

<attribute name="degrees" type="bool" default="false" required="0">
<description>
If true, the joint acceleration is expressed in units of degrees per
second per second [deg/s^2], otherwise it is expressed in radians per
second per second [rad/s^2].
</description>
</attribute>
</element>

<element name="effort" type="double" default="0" required="0">
<description>The effort applied at the second joint axis.</description>
</element>
</element>
</element> <!-- End Joint -->
55 changes: 52 additions & 3 deletions sdf/1.12/link_state.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,70 @@
<description>Name of the link</description>
</attribute>

<element name="velocity" type="pose" default="0 0 0 0 0 0" required="0">
<element name="angular_velocity" type="vector3" default="0 0 0" required="0">
<description>Angular velocity of the link frame relative to the world frame.
</description>

<attribute name="degrees" type="bool" default="false" required="0">
<description>
If true, the angular velocity is expressed in units of degrees per
second [deg/s], otherwise it is expressed in radians per second [rad/s].
</description>
</attribute>
</element>

<element name="linear_velocity" type="vector3" default="0 0 0" required="0">
<description>Linear velocity of the link frame relative to the world frame.
</description>
</element>

<element name="velocity" type="pose" default="0 0 0 0 0 0" required="-1">
<description>Velocity of the link. The x, y, z components of the pose
correspond to the linear velocity of the link, and the roll, pitch, yaw
components correspond to the angular velocity of the link
</description>
</element>

<element name="acceleration" type="pose" default="0 0 0 0 0 0" required="0">
<element name="angular_acceleration" type="vector3" default="0 0 0" required="0">
<description>
Angular acceleration of the link frame relative to the world frame.
</description>

<attribute name="degrees" type="bool" default="false" required="0">
<description>
If true, the angular acceleration is expressed in units of degrees per
second per second [deg/s^2], otherwise it is expressed in radians per
second per second [rad/s^2].
</description>
</attribute>
</element>

<element name="linear_acceleration" type="vector3" default="0 0 0" required="0">
<description>
Linear acceleration of the link frame relative to the world frame.
</description>
</element>

<element name="acceleration" type="pose" default="0 0 0 0 0 0" required="-1">
<description>Acceleration of the link. The x, y, z components of the pose
correspond to the linear acceleration of the link, and the roll,
pitch, yaw components correspond to the angular acceleration of the link
</description>
</element>

<element name="wrench" type="pose" default="0 0 0 0 0 0" required="0">
<element name="angular_wrench" type="vector3" default="0 0 0" required="0">
<description>Angular wrench (torque) acting on the link relative to the world frame.
</description>
</element>

<element name="linear_wrench" type="vector3" default="0 0 0" required="0">
<description>
Linear wrench (force) acting on the link at the link frame relative to
the world frame.
</description>
</element>

<element name="wrench" type="pose" default="0 0 0 0 0 0" required="-1">
<description>Force and torque applied to the link. The x, y, z components
of the pose correspond to the force applied to the link, and the roll,
pitch, yaw components correspond to the torque applied to the link
Expand Down
3 changes: 3 additions & 0 deletions sdf/1.12/model.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<description>URI to a resource, such as a model</description>
</element>

<include filename="model_state.sdf" required="0"/>
<include filename="pose.sdf" required="0"/>
<include filename="plugin.sdf" required="*"/>

Expand All @@ -85,6 +86,8 @@
</attribute>
</element>

<include filename="model_state.sdf" required="0"/>

<element name="enable_wind" type="bool" default="false" required="0">
<description>If set to true, all links in the model will be affected by the wind. Can be overriden by the link wind property.</description>
</element>
Expand Down
1 change: 1 addition & 0 deletions sdf/1.12/world.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<description>Override the static value of the included entity.</description>
</element>

<include filename="model_state.sdf" required="0"/>
<include filename="pose.sdf" required="0"/>
<include filename="plugin.sdf" required="*"/>

Expand Down
Loading
Loading