-
Notifications
You must be signed in to change notification settings - Fork 95
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
Conversation
Signed-off-by: Steve Peters <[email protected]>
Include joint_state.sdf from model_state.sdf and state.sdf for //world/joint states. Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
This deprecates the //joint_state/angle element in favor of a joint state specification that supports multi-axis joints by mirroring the //joint/axis and //joint/axis2 elements with * //joint_state/axis_state * //joint_state/axis2_state Each axis state can specify position, velocity, and acceleration, each with an optional @Degrees attribute. Signed-off-by: Steve Peters <[email protected]>
Deprecate the //link_state/velocity and //link_state/acceleration elements since the `pose` type is not well-suited to represent vector6 data. Add pairs of vector3 angular_* and linear_* elements for velocity and acceleration to replace the pose-typed elements. Signed-off-by: Steve Peters <[email protected]>
also rephrase some element descriptions Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
Also use a larger values in an angular_velocity. Signed-off-by: Steve Peters <[email protected]>
update migration guide Signed-off-by: Steve Peters <[email protected]>
Migration.md
Outdated
### Deprecations | ||
|
||
1. **joint_state.sdf**: | ||
+ `//joint_state/angle` is deprecated in favor of `//axis_state/position` |
There was a problem hiding this comment.
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
.
+ `//joint_state/angle` is deprecated in favor of `//axis_state/position` | |
+ `//joint_state/angle` is deprecated in favor of `//joint_state/axis_state/position` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, will fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migration.md
Outdated
+ `//link_state/wrench` is deprecated in favor of `//link_state/angular_wrench` | ||
and `//link_state/linear_wrench`. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
sdf/1.12/joint_state.sdf
Outdated
|
||
<attribute name="degrees" type="bool" default="false" required="0"> | ||
<description> | ||
If true, the joint position is expressed in units of degrees [deg], |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sdf/1.12/joint_state.sdf
Outdated
|
||
<attribute name="degrees" type="bool" default="false" required="0"> | ||
<description> | ||
If true, the joint velocity is expressed in units of degrees per |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contains the state of the first joint axis. | ||
</description> | ||
|
||
<element name="position" type="double" default="0" required="0"> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
🎉 New feature
Closes #1366, #83
Summary
This makes several changes to the specification for the
<state/>
element in SDFormat 1.12. It does not include DOM objects, which will be implemented in a future pull request. Note that part of the motivation for these changes is to allow specification of initial model state in gz-sim (see prototype in gazebosim/gz-sim#2359).Link state changes
vector3
datatypes to represent twist, spatial acceleration, and wrenches instead of apose
datatype, which distorts the angular values by interpreting them as Euler angles. This resolves link_state velocity, acceleration, and wrench data should not use pose type #1366. The new elements for velocity and acceleration have names starting withlinear_
orangular_
, while the replacement forwrench
isforce
andtorque
://link_state/linear_velocity
//link_state/angular_velocity
//link_state/linear_acceleration
//link_state/angular_acceleration
//link_state/force
//link_state/torque
vector6
type and renamevelocity
to twist,acceleration
tospatial_acceleration
. While this could allow for shorter XML files, it would require features to be added to gz-math to supportmath::Vector6
and has the potential for error in remembering which order to specify the angular and linear coefficients. Using a pair ofvector3
types is more verbose but more clear and is already supported by gz-math and libsdformat.Joint state changes
//joint_state/angle
and//joint_state/angle/@axis
to//joint_state/axis_state/position
and//joint_state/axis2_state/position
. This more closely matches the structure of//joint/axis
and//joint/axis2
, and the rename fromangle
toposition
was suggested in add joint velocity and joint acceleration to state structure #83 (comment).velocity
,acceleration
, andeffort
to//joint_state
. The addition ofvelocity
andacceleration
was requested by add joint velocity and joint acceleration to state structure #83, andeffort
is added to matchwrench
used in link states.Link and Joint states: add boolean
@degrees
attribute to some angular types@degrees
attribute to the following elements://link_state/angular_velocity
//link_state/angular_acceleration
//joint_state/axis_state/position
//joint_state/axis_state/velocity
//joint_state/axis_state/acceleration
//joint_state/axis2_state/position
//joint_state/axis2_state/velocity
//joint_state/axis2_state/acceleration
deg
instead ofrad
,deg/s
instead ofrad/s
, ordeg/s^2
instead ofrad/s^2
. The attribute is not added to joint effort and link wrench types.Allow specification of model state within a model
//world/state
element. To allow a model to specify a default initial configuration or initial velocity, the//model/model_state
element is added. If a world contains both a//world/state
and a model that specifies its own state, I think the world state should take precedence.<include>
d, the//model/include/model_state
and//world/include/model_state
elements are added as well.Test it
The
INTEGRATION_nested_model
test has been updated to use some of the new//link_state
elements, but there are not yet any tests using the new//joint_state
or//model/model_state
elements.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.