From 1885d518ebf80b6fe6c2ba595be06027ce7306da Mon Sep 17 00:00:00 2001 From: Yuval Tassa Date: Sun, 10 Dec 2023 03:26:49 -0800 Subject: [PATCH] Use the string `(rot:lin)` in mjdata.h to clarify where 6D motion vectors use the Featherstone convention. Also add clarifying text to the appropriate note in the documentation. Fixes #982. PiperOrigin-RevId: 589556339 Change-Id: I3e7ff185a089715a386694321d4b89d09d481cf9 --- doc/APIreference/APItypes.rst | 6 +++--- doc/includes/references.h | 6 +++--- include/mujoco/mjdata.h | 6 +++--- introspect/structs.py | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/APIreference/APItypes.rst b/doc/APIreference/APItypes.rst index 684e810b..ee8de505 100644 --- a/doc/APIreference/APItypes.rst +++ b/doc/APIreference/APItypes.rst @@ -1219,9 +1219,9 @@ a frame at the center-of-mass of the local kinematic subtree (``mjData.subtree_c This choice increases the precision of kinematic computations for mechanisms that are distant from the global origin. ``cdof``: - These 6D motion vectors describe the instantaneous axis of a degree-of-freedom and are used by all Jacobian functions. - Therefore, the minimal computation required for analytic Jacobians is :ref:`mj_kinematics` followed by - :ref:`mj_comPos`. + These 6D motion vectors (3 rotation, 3 translation) describe the instantaneous axis of a degree-of-freedom and are + used by all Jacobian functions. The minimal computation required for analytic Jacobians is :ref:`mj_kinematics` + followed by :ref:`mj_comPos`. ``cinert``: These 10-vectors describe the inertial properties of a body in the c-frame and are used by the Composite Rigid Body diff --git a/doc/includes/references.h b/doc/includes/references.h index f4aedde9..79302849 100644 --- a/doc/includes/references.h +++ b/doc/includes/references.h @@ -237,7 +237,7 @@ struct mjData_ { // computed by mj_fwdPosition/mj_comPos mjtNum* subtree_com; // center of mass of each subtree (nbody x 3) - mjtNum* cdof; // com-based motion axis of each dof (nv x 6) + mjtNum* cdof; // com-based motion axis of each dof (rot:lin) (nv x 6) mjtNum* cinert; // com-based body inertia and mass (nbody x 10) // computed by mj_fwdPosition/mj_flex @@ -285,8 +285,8 @@ struct mjData_ { mjtNum* actuator_velocity; // actuator velocities (nu x 1) // computed by mj_fwdVelocity/mj_comVel - mjtNum* cvel; // com-based velocity [3D rot; 3D tran] (nbody x 6) - mjtNum* cdof_dot; // time-derivative of cdof (nv x 6) + mjtNum* cvel; // com-based velocity (rot:lin) (nbody x 6) + mjtNum* cdof_dot; // time-derivative of cdof (rot:lin) (nv x 6) // computed by mj_fwdVelocity/mj_rne (without acceleration) mjtNum* qfrc_bias; // C(qpos,qvel) (nv x 1) diff --git a/include/mujoco/mjdata.h b/include/mujoco/mjdata.h index a3609b8b..1fc6fe19 100644 --- a/include/mujoco/mjdata.h +++ b/include/mujoco/mjdata.h @@ -265,7 +265,7 @@ struct mjData_ { // computed by mj_fwdPosition/mj_comPos mjtNum* subtree_com; // center of mass of each subtree (nbody x 3) - mjtNum* cdof; // com-based motion axis of each dof (nv x 6) + mjtNum* cdof; // com-based motion axis of each dof (rot:lin) (nv x 6) mjtNum* cinert; // com-based body inertia and mass (nbody x 10) // computed by mj_fwdPosition/mj_flex @@ -313,8 +313,8 @@ struct mjData_ { mjtNum* actuator_velocity; // actuator velocities (nu x 1) // computed by mj_fwdVelocity/mj_comVel - mjtNum* cvel; // com-based velocity [3D rot; 3D tran] (nbody x 6) - mjtNum* cdof_dot; // time-derivative of cdof (nv x 6) + mjtNum* cvel; // com-based velocity (rot:lin) (nbody x 6) + mjtNum* cdof_dot; // time-derivative of cdof (rot:lin) (nv x 6) // computed by mj_fwdVelocity/mj_rne (without acceleration) mjtNum* qfrc_bias; // C(qpos,qvel) (nv x 1) diff --git a/introspect/structs.py b/introspect/structs.py index a1fa3159..eea7f6cc 100644 --- a/introspect/structs.py +++ b/introspect/structs.py @@ -4493,7 +4493,7 @@ STRUCTS: Mapping[str, StructDecl] = dict([ type=PointerType( inner_type=ValueType(name='mjtNum'), ), - doc='com-based motion axis of each dof (nv x 6)', # pylint: disable=line-too-long + doc='com-based motion axis of each dof (rot:lin) (nv x 6)', # pylint: disable=line-too-long ), StructFieldDecl( name='cinert', @@ -4703,14 +4703,14 @@ STRUCTS: Mapping[str, StructDecl] = dict([ type=PointerType( inner_type=ValueType(name='mjtNum'), ), - doc='com-based velocity [3D rot; 3D tran] (nbody x 6)', # pylint: disable=line-too-long + doc='com-based velocity (rot:lin) (nbody x 6)', # pylint: disable=line-too-long ), StructFieldDecl( name='cdof_dot', type=PointerType( inner_type=ValueType(name='mjtNum'), ), - doc='time-derivative of cdof (nv x 6)', # pylint: disable=line-too-long + doc='time-derivative of cdof (rot:lin) (nv x 6)', # pylint: disable=line-too-long ), StructFieldDecl( name='qfrc_bias',