diff --git a/Migration.md b/Migration.md index 341816cf2..5d036b71b 100644 --- a/Migration.md +++ b/Migration.md @@ -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/force` + + `//link_state/torque` + +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**, @@ -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 `//joint_state/axis_state/position` + and `//joint_state/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/torque` + and `//link_state/force`. + ## SDFormat specification 1.10 to 1.11 ### Additions diff --git a/sdf/1.12/joint_state.sdf b/sdf/1.12/joint_state.sdf index 2b64d832c..096b56965 100644 --- a/sdf/1.12/joint_state.sdf +++ b/sdf/1.12/joint_state.sdf @@ -9,11 +9,125 @@ Name of the joint - + Index of the axis. Angle of an axis + + + + Contains the state of the first joint axis. + + + + The position of the first joint axis. + + + + If this is a rotational axis and this attribute is true, + the joint position is expressed in units of degrees [deg], + otherwise it is expressed in radians [rad]. + If this axis is translational (such as a prismatic joint), the + units will be interpreted in meters [m] regardless of the value of + this attribute. + + + + + + The velocity of the first joint axis. + + + + If this is a rotational axis and this attribute is true, + the joint velocity is expressed in units of degrees per + second [deg/s], otherwise it is expressed in radians per second + [rad/s]. + If this axis is translational (such as a prismatic joint), the + units will be interpreted in meters per second [m/s] regardless of + the value of this attribute. + + + + + + The acceleration of the first joint axis. + + + + If this is a rotational axis and this attribute is 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]. + If this axis is translational (such as a prismatic joint), the + units will be interpreted in meters per second per second [m/s^2] + regardless of the value of this attribute. + + + + + + The effort applied at the first joint axis. + + + + + + Contains the state of the second joint axis. + + + + The position of the second joint axis. + + + + If this is a rotational axis and this attribute is true, + the joint position is expressed in units of degrees [deg], + otherwise it is expressed in radians [rad]. + If this axis is translational (such as a prismatic joint), the + units will be interpreted in meters [m] regardless of the value of + this attribute. + + + + + + The velocity of the second joint axis. + + + + If this is a rotational axis and this attribute is true, + the joint velocity is expressed in units of degrees per + second [deg/s], otherwise it is expressed in radians per second + [rad/s]. + If this axis is translational (such as a prismatic joint), the + units will be interpreted in meters per second [m/s] regardless of + the value of this attribute. + + + + + + The acceleration of the second joint axis. + + + + If this is a rotational axis and this attribute is 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]. + If this axis is translational (such as a prismatic joint), the + units will be interpreted in meters per second per second [m/s^2] + regardless of the value of this attribute. + + + + + + The effort applied at the second joint axis. + + diff --git a/sdf/1.12/link_state.sdf b/sdf/1.12/link_state.sdf index e59d9e0f1..d086e4856 100644 --- a/sdf/1.12/link_state.sdf +++ b/sdf/1.12/link_state.sdf @@ -10,21 +10,69 @@ Name of the link - + + Angular velocity of the link frame relative to the world frame. + + + + + 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]. + + + + + + Linear velocity of the link frame relative to the world frame. + + + + 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 - + + + Angular acceleration of the link frame relative to the world frame. + + + + + 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]. + + + + + + + Linear acceleration of the link frame relative to the world frame. + + + + 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 - + + Torque acting on the link relative to the world frame. + + + + + + Force acting on the link at the link frame relative to the world frame. + + + + 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 diff --git a/sdf/1.12/model.sdf b/sdf/1.12/model.sdf index 57dc83a01..de8b43130 100644 --- a/sdf/1.12/model.sdf +++ b/sdf/1.12/model.sdf @@ -62,6 +62,7 @@ URI to a resource, such as a model + @@ -85,6 +86,8 @@ + + If set to true, all links in the model will be affected by the wind. Can be overriden by the link wind property. diff --git a/sdf/1.12/world.sdf b/sdf/1.12/world.sdf index 6235e193b..d39ad8819 100644 --- a/sdf/1.12/world.sdf +++ b/sdf/1.12/world.sdf @@ -40,6 +40,7 @@ Override the static value of the included entity. + diff --git a/test/integration/nested_model.cc b/test/integration/nested_model.cc index 813d04021..54859c95e 100644 --- a/test/integration/nested_model.cc +++ b/test/integration/nested_model.cc @@ -118,25 +118,34 @@ TEST(NestedModel, State) << " 0 0 0.5 0 0 0" << " " << " 0 0 0.5 0 0 0" - << " 0.001 0 0 0 0 0" - << " 0 0.006121 0 0.012288 0 0.001751" - << " 0 0.006121 0 0 0 0" + << " 0.001 0 0" + << " -0.1 5.0 -0.1" + << " 0 0.006121 0" + << " 0.012288 0 0.001751" + << " 0 0.006121 0" + << " 0 0 0" << " " << " " << " 1 0 0.5 0 0 0" << " " << " 1.25 0 0.5 0 0 0" - << " 0 -0.001 0 0 0 0" - << " 0 0.000674 0 -0.001268 0 0" - << " 0 0.000674 0 0 0 0" + << " 0 -0.001 0" + << " 0 0 0" + << " 0 0.000674 0" + << " -0.001268 0 0" + << " 0 0.000674 0" + << " 0 0 0" << " " << " " << " 1 1 0.5 0 0 0" << " " << " 1.25 1 0.5 0 0 0" - << " 0 0 0.001 0 0 0" - << " 0 0 0 0 0 0" - << " 0 0 0 0 0 0" + << " 0 0 0.001" + << " 0 0 0" + << " 0 0 0" + << " 0 0 0" + << " 0 0 0" + << " 0 0 0" << " " << " " << " " @@ -175,15 +184,27 @@ TEST(NestedModel, State) EXPECT_TRUE(linkStateElem->HasElement("pose")); EXPECT_EQ(linkStateElem->Get("pose"), gz::math::Pose3d(0, 0, 0.5, 0, 0, 0)); - EXPECT_TRUE(linkStateElem->HasElement("velocity")); - EXPECT_EQ(linkStateElem->Get("velocity"), - gz::math::Pose3d(0.001, 0, 0, 0, 0, 0)); - EXPECT_TRUE(linkStateElem->HasElement("acceleration")); - EXPECT_EQ(linkStateElem->Get("acceleration"), - gz::math::Pose3d(0, 0.006121, 0, 0.012288, 0, 0.001751)); - EXPECT_TRUE(linkStateElem->HasElement("wrench")); - EXPECT_EQ(linkStateElem->Get("wrench"), - gz::math::Pose3d(0, 0.006121, 0, 0, 0, 0)); + EXPECT_FALSE(linkStateElem->HasElement("velocity")); + EXPECT_TRUE(linkStateElem->HasElement("angular_velocity")); + EXPECT_TRUE(linkStateElem->HasElement("linear_velocity")); + EXPECT_EQ(linkStateElem->Get("linear_velocity"), + gz::math::Vector3d(0.001, 0, 0)); + EXPECT_EQ(linkStateElem->Get("angular_velocity"), + gz::math::Vector3d(-0.1, 5.0, -0.1)); + EXPECT_FALSE(linkStateElem->HasElement("acceleration")); + EXPECT_TRUE(linkStateElem->HasElement("angular_acceleration")); + EXPECT_TRUE(linkStateElem->HasElement("linear_acceleration")); + EXPECT_EQ(linkStateElem->Get("linear_acceleration"), + gz::math::Vector3d(0, 0.006121, 0)); + EXPECT_EQ(linkStateElem->Get("angular_acceleration"), + gz::math::Vector3d(0.012288, 0, 0.001751)); + EXPECT_FALSE(linkStateElem->HasElement("wrench")); + EXPECT_TRUE(linkStateElem->HasElement("torque")); + EXPECT_TRUE(linkStateElem->HasElement("force")); + EXPECT_EQ(linkStateElem->Get("force"), + gz::math::Vector3d(0, 0.006121, 0)); + EXPECT_EQ(linkStateElem->Get("torque"), + gz::math::Vector3d(0, 0, 0)); // nested model sdf EXPECT_TRUE(modelStateElem->HasElement("model_state")); @@ -206,15 +227,29 @@ TEST(NestedModel, State) EXPECT_TRUE(nestedLinkStateElem->HasElement("pose")); EXPECT_EQ(nestedLinkStateElem->Get("pose"), gz::math::Pose3d(1.25, 0, 0.5, 0, 0, 0)); - EXPECT_TRUE(nestedLinkStateElem->HasElement("velocity")); - EXPECT_EQ(nestedLinkStateElem->Get("velocity"), - gz::math::Pose3d(0, -0.001, 0, 0, 0, 0)); - EXPECT_TRUE(nestedLinkStateElem->HasElement("acceleration")); - EXPECT_EQ(nestedLinkStateElem->Get("acceleration"), - gz::math::Pose3d(0, 0.000674, 0, -0.001268, 0, 0)); - EXPECT_TRUE(nestedLinkStateElem->HasElement("wrench")); - EXPECT_EQ(nestedLinkStateElem->Get("wrench"), - gz::math::Pose3d(0, 0.000674, 0, 0, 0, 0)); + EXPECT_FALSE(nestedLinkStateElem->HasElement("velocity")); + EXPECT_TRUE(nestedLinkStateElem->HasElement("angular_velocity")); + EXPECT_TRUE(nestedLinkStateElem->HasElement("linear_velocity")); + EXPECT_EQ(nestedLinkStateElem->Get("linear_velocity"), + gz::math::Vector3d(0, -0.001, 0)); + EXPECT_EQ(nestedLinkStateElem->Get("angular_velocity"), + gz::math::Vector3d(0, 0, 0)); + EXPECT_FALSE(nestedLinkStateElem->HasElement("acceleration")); + EXPECT_TRUE(nestedLinkStateElem->HasElement("angular_acceleration")); + EXPECT_TRUE(nestedLinkStateElem->HasElement("linear_acceleration")); + EXPECT_EQ( + nestedLinkStateElem->Get("linear_acceleration"), + gz::math::Vector3d(0, 0.000674, 0)); + EXPECT_EQ( + nestedLinkStateElem->Get("angular_acceleration"), + gz::math::Vector3d(-0.001268, 0, 0)); + EXPECT_FALSE(nestedLinkStateElem->HasElement("wrench")); + EXPECT_TRUE(nestedLinkStateElem->HasElement("torque")); + EXPECT_TRUE(nestedLinkStateElem->HasElement("force")); + EXPECT_EQ(nestedLinkStateElem->Get("force"), + gz::math::Vector3d(0, 0.000674, 0)); + EXPECT_EQ(nestedLinkStateElem->Get("torque"), + gz::math::Vector3d(0, 0, 0)); // double nested model sdf EXPECT_TRUE(nestedModelStateElem->HasElement("model_state")); @@ -235,15 +270,29 @@ TEST(NestedModel, State) EXPECT_TRUE(nestedLinkStateElem->HasElement("pose")); EXPECT_EQ(nestedLinkStateElem->Get("pose"), gz::math::Pose3d(1.25, 1, 0.5, 0, 0, 0)); - EXPECT_TRUE(nestedLinkStateElem->HasElement("velocity")); - EXPECT_EQ(nestedLinkStateElem->Get("velocity"), - gz::math::Pose3d(0, 0, 0.001, 0, 0, 0)); - EXPECT_TRUE(nestedLinkStateElem->HasElement("acceleration")); - EXPECT_EQ(nestedLinkStateElem->Get("acceleration"), - gz::math::Pose3d(0, 0, 0, 0, 0, 0)); - EXPECT_TRUE(nestedLinkStateElem->HasElement("wrench")); - EXPECT_EQ(nestedLinkStateElem->Get("wrench"), - gz::math::Pose3d(0, 0, 0, 0, 0, 0)); + EXPECT_FALSE(nestedLinkStateElem->HasElement("velocity")); + EXPECT_TRUE(nestedLinkStateElem->HasElement("angular_velocity")); + EXPECT_TRUE(nestedLinkStateElem->HasElement("linear_velocity")); + EXPECT_EQ(nestedLinkStateElem->Get("linear_velocity"), + gz::math::Vector3d(0, 0, 0.001)); + EXPECT_EQ(nestedLinkStateElem->Get("angular_velocity"), + gz::math::Vector3d(0, 0, 0)); + EXPECT_FALSE(nestedLinkStateElem->HasElement("acceleration")); + EXPECT_TRUE(nestedLinkStateElem->HasElement("angular_acceleration")); + EXPECT_TRUE(nestedLinkStateElem->HasElement("linear_acceleration")); + EXPECT_EQ( + nestedLinkStateElem->Get("linear_acceleration"), + gz::math::Vector3d(0, 0, 0)); + EXPECT_EQ( + nestedLinkStateElem->Get("angular_acceleration"), + gz::math::Vector3d(0, 0, 0)); + EXPECT_FALSE(nestedLinkStateElem->HasElement("wrench")); + EXPECT_TRUE(nestedLinkStateElem->HasElement("torque")); + EXPECT_TRUE(nestedLinkStateElem->HasElement("force")); + EXPECT_EQ(nestedLinkStateElem->Get("force"), + gz::math::Vector3d(0, 0, 0)); + EXPECT_EQ(nestedLinkStateElem->Get("torque"), + gz::math::Vector3d(0, 0, 0)); } ////////////////////////////////////////