pydrake.multibody.tree¶
Bindings for MultibodyTree and related components.
-
pydrake.multibody.tree.
BallRpyJoint
¶
-
template
pydrake.multibody.tree.
BallRpyJoint_
¶ Instantiations:
BallRpyJoint_[float]
,BallRpyJoint_[AutoDiffXd]
,BallRpyJoint_[Expression]
-
class
BallRpyJoint_[float]
¶ Bases:
pydrake.multibody.tree.Joint_[float]
This Joint allows two bodies to rotate freely relative to one another. That is, given a frame F attached to the parent body P and a frame M attached to the child body B (see the Joint class’s documentation), this Joint allows frame M to rotate freely with respect to F, while the origins, Mo and Fo, of frames M and F respectively remain coincident. The orientation of M relative to F is parameterized with space
x-y-z
Euler angles.-
__init__
(self: pydrake.multibody.tree.BallRpyJoint_[float], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[float], frame_on_child: pydrake.multibody.tree.Frame_[float], damping: float = 0) → None¶ Constructor to create a ball rpy joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B rotate freely relative to one another. See this class’s documentation for further details on the definition of these frames, get_angles() for an explanation of the angles defining orientation, and get_angular_velocity() for an explanation of the generalized velocities. This constructor signature creates a joint with no joint limits, i.e. the joint position, velocity and acceleration limits are the pair
(-∞, ∞)
. These can be set using the Joint methods set_position_limits(), set_velocity_limits() and set_acceleration_limits(). The first three arguments to this constructor are those of the Joint class constructor. See the Joint class’s documentation for details. The additional parameters are:- Parameter
damping
: - Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. See documentation of damping() for details on modelling of the damping torque.
Raises: RuntimeError if damping is negative. - Parameter
-
get_angles
(self: pydrake.multibody.tree.BallRpyJoint_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[3, 1]]¶ Gets the rotation angles of
this
joint fromcontext
.The orientation
R_FM
of the child frame M in parent frame F is parameterized with spacex-y-z
Euler angles (also known as extrinsic angles). That is, the angles θr, θp, θy, correspond to a sequence of rotations about the x̂, ŷ, ẑ axes of parent frame F, respectively. Mathematically, rotationR_FM
is given in terms of angles θr, θp, θy by:R_FM(q) = Rz(θy) * Ry(θp) * Rx(θr)
where
Rx(θ)
, Ry(θ) andRz(θ)
correspond to the elemental rotations in amount of θ about the x, y and z axes respectively. Zero θr, θp, θy angles corresponds to frames F and M being coincident. Angles θr, θp, θy are defined to be positive according to the right-hand-rule with the thumb aligned in the direction of their respective axes.Note
Space
x-y-z
angles (extrinsic) are equivalent to Bodyz-y-x
angles (intrinsic).Note
This particular choice of angles θr, θp, θy for this joint are many times referred to as the roll, pitch and yaw angles by many dynamicists. They are also known as the Tait-Bryan angles or Cardan angles.
- Parameter
context
: - The context of the model this joint belongs to.
Returns: The angle coordinates of this
joint stored in thecontext
ordered as θr, θp, θy.- Parameter
-
get_angular_velocity
(self: pydrake.multibody.tree.BallRpyJoint_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[3, 1]]¶ Retrieves from
context
the angular velocityw_FM
of the child frame M in the parent frame F, expressed in F.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
w_FM
: - A vector in ℝ³ with the angular velocity of the child frame M in the parent frame F, expressed in F. Refer to this class’s documentation for further details and definitions of these frames.
- Parameter
-
set_angles
(self: pydrake.multibody.tree.BallRpyJoint_[float], context: pydrake.systems.framework.Context_[float], angles: numpy.ndarray[numpy.float64[3, 1]]) → pydrake.multibody.tree.BallRpyJoint_[float]¶ Sets the
context
so that the generalized coordinates corresponding to the rotation angles ofthis
joint equalsangles
.- Parameter
context
: - The context of the model this joint belongs to.
- Parameter
angles
: - The desired angles in radians to be stored in
context
ordered as θr, θp, θy. See get_angles() for details.
Returns: a constant reference to this
joint.- Parameter
-
set_angular_velocity
(self: pydrake.multibody.tree.BallRpyJoint_[float], context: pydrake.systems.framework.Context_[float], w_FM: numpy.ndarray[numpy.float64[3, 1]]) → pydrake.multibody.tree.BallRpyJoint_[float]¶ Sets in
context
the state forthis
joint so that the angular velocity of the child frame M in the parent frame F isw_FM
.- Parameter
context
: - The context of the model this joint belongs to.
- Parameter
w_FM
: - A vector in ℝ³ with the angular velocity of the child frame M in the parent frame F, expressed in F. Refer to this class’s documentation for further details and definitions of these frames.
Returns: a constant reference to this
joint.- Parameter
-
set_random_angles_distribution
(self: pydrake.multibody.tree.BallRpyJoint_[float], angles: numpy.ndarray[object[3, 1]]) → None¶ Sets the random distribution that angles of this joint will be randomly sampled from. See get_angles() for details on the angle representation.
-
-
class
-
class
pydrake.multibody.tree.
BallRpyJoint_[AutoDiffXd]
¶ Bases:
pydrake.multibody.tree.Joint_[AutoDiffXd]
This Joint allows two bodies to rotate freely relative to one another. That is, given a frame F attached to the parent body P and a frame M attached to the child body B (see the Joint class’s documentation), this Joint allows frame M to rotate freely with respect to F, while the origins, Mo and Fo, of frames M and F respectively remain coincident. The orientation of M relative to F is parameterized with space
x-y-z
Euler angles.-
__init__
(self: pydrake.multibody.tree.BallRpyJoint_[AutoDiffXd], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[AutoDiffXd], frame_on_child: pydrake.multibody.tree.Frame_[AutoDiffXd], damping: float = 0) → None¶ Constructor to create a ball rpy joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B rotate freely relative to one another. See this class’s documentation for further details on the definition of these frames, get_angles() for an explanation of the angles defining orientation, and get_angular_velocity() for an explanation of the generalized velocities. This constructor signature creates a joint with no joint limits, i.e. the joint position, velocity and acceleration limits are the pair
(-∞, ∞)
. These can be set using the Joint methods set_position_limits(), set_velocity_limits() and set_acceleration_limits(). The first three arguments to this constructor are those of the Joint class constructor. See the Joint class’s documentation for details. The additional parameters are:- Parameter
damping
: - Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. See documentation of damping() for details on modelling of the damping torque.
Raises: RuntimeError if damping is negative. - Parameter
-
get_angles
(self: pydrake.multibody.tree.BallRpyJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → numpy.ndarray[object[3, 1]]¶ Gets the rotation angles of
this
joint fromcontext
.The orientation
R_FM
of the child frame M in parent frame F is parameterized with spacex-y-z
Euler angles (also known as extrinsic angles). That is, the angles θr, θp, θy, correspond to a sequence of rotations about the x̂, ŷ, ẑ axes of parent frame F, respectively. Mathematically, rotationR_FM
is given in terms of angles θr, θp, θy by:R_FM(q) = Rz(θy) * Ry(θp) * Rx(θr)
where
Rx(θ)
, Ry(θ) andRz(θ)
correspond to the elemental rotations in amount of θ about the x, y and z axes respectively. Zero θr, θp, θy angles corresponds to frames F and M being coincident. Angles θr, θp, θy are defined to be positive according to the right-hand-rule with the thumb aligned in the direction of their respective axes.Note
Space
x-y-z
angles (extrinsic) are equivalent to Bodyz-y-x
angles (intrinsic).Note
This particular choice of angles θr, θp, θy for this joint are many times referred to as the roll, pitch and yaw angles by many dynamicists. They are also known as the Tait-Bryan angles or Cardan angles.
- Parameter
context
: - The context of the model this joint belongs to.
Returns: The angle coordinates of this
joint stored in thecontext
ordered as θr, θp, θy.- Parameter
-
get_angular_velocity
(self: pydrake.multibody.tree.BallRpyJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → numpy.ndarray[object[3, 1]]¶ Retrieves from
context
the angular velocityw_FM
of the child frame M in the parent frame F, expressed in F.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
w_FM
: - A vector in ℝ³ with the angular velocity of the child frame M in the parent frame F, expressed in F. Refer to this class’s documentation for further details and definitions of these frames.
- Parameter
-
set_angles
(self: pydrake.multibody.tree.BallRpyJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], angles: numpy.ndarray[object[3, 1]]) → pydrake.multibody.tree.BallRpyJoint_[AutoDiffXd]¶ Sets the
context
so that the generalized coordinates corresponding to the rotation angles ofthis
joint equalsangles
.- Parameter
context
: - The context of the model this joint belongs to.
- Parameter
angles
: - The desired angles in radians to be stored in
context
ordered as θr, θp, θy. See get_angles() for details.
Returns: a constant reference to this
joint.- Parameter
-
set_angular_velocity
(self: pydrake.multibody.tree.BallRpyJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], w_FM: numpy.ndarray[object[3, 1]]) → pydrake.multibody.tree.BallRpyJoint_[AutoDiffXd]¶ Sets in
context
the state forthis
joint so that the angular velocity of the child frame M in the parent frame F isw_FM
.- Parameter
context
: - The context of the model this joint belongs to.
- Parameter
w_FM
: - A vector in ℝ³ with the angular velocity of the child frame M in the parent frame F, expressed in F. Refer to this class’s documentation for further details and definitions of these frames.
Returns: a constant reference to this
joint.- Parameter
-
set_random_angles_distribution
(self: pydrake.multibody.tree.BallRpyJoint_[AutoDiffXd], angles: numpy.ndarray[object[3, 1]]) → None¶ Sets the random distribution that angles of this joint will be randomly sampled from. See get_angles() for details on the angle representation.
-
-
class
pydrake.multibody.tree.
BallRpyJoint_[Expression]
¶ Bases:
pydrake.multibody.tree.Joint_[Expression]
This Joint allows two bodies to rotate freely relative to one another. That is, given a frame F attached to the parent body P and a frame M attached to the child body B (see the Joint class’s documentation), this Joint allows frame M to rotate freely with respect to F, while the origins, Mo and Fo, of frames M and F respectively remain coincident. The orientation of M relative to F is parameterized with space
x-y-z
Euler angles.-
__init__
(self: pydrake.multibody.tree.BallRpyJoint_[Expression], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[Expression], frame_on_child: pydrake.multibody.tree.Frame_[Expression], damping: float = 0) → None¶ Constructor to create a ball rpy joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B rotate freely relative to one another. See this class’s documentation for further details on the definition of these frames, get_angles() for an explanation of the angles defining orientation, and get_angular_velocity() for an explanation of the generalized velocities. This constructor signature creates a joint with no joint limits, i.e. the joint position, velocity and acceleration limits are the pair
(-∞, ∞)
. These can be set using the Joint methods set_position_limits(), set_velocity_limits() and set_acceleration_limits(). The first three arguments to this constructor are those of the Joint class constructor. See the Joint class’s documentation for details. The additional parameters are:- Parameter
damping
: - Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. See documentation of damping() for details on modelling of the damping torque.
Raises: RuntimeError if damping is negative. - Parameter
-
get_angles
(self: pydrake.multibody.tree.BallRpyJoint_[Expression], context: pydrake.systems.framework.Context_[Expression]) → numpy.ndarray[object[3, 1]]¶ Gets the rotation angles of
this
joint fromcontext
.The orientation
R_FM
of the child frame M in parent frame F is parameterized with spacex-y-z
Euler angles (also known as extrinsic angles). That is, the angles θr, θp, θy, correspond to a sequence of rotations about the x̂, ŷ, ẑ axes of parent frame F, respectively. Mathematically, rotationR_FM
is given in terms of angles θr, θp, θy by:R_FM(q) = Rz(θy) * Ry(θp) * Rx(θr)
where
Rx(θ)
, Ry(θ) andRz(θ)
correspond to the elemental rotations in amount of θ about the x, y and z axes respectively. Zero θr, θp, θy angles corresponds to frames F and M being coincident. Angles θr, θp, θy are defined to be positive according to the right-hand-rule with the thumb aligned in the direction of their respective axes.Note
Space
x-y-z
angles (extrinsic) are equivalent to Bodyz-y-x
angles (intrinsic).Note
This particular choice of angles θr, θp, θy for this joint are many times referred to as the roll, pitch and yaw angles by many dynamicists. They are also known as the Tait-Bryan angles or Cardan angles.
- Parameter
context
: - The context of the model this joint belongs to.
Returns: The angle coordinates of this
joint stored in thecontext
ordered as θr, θp, θy.- Parameter
-
get_angular_velocity
(self: pydrake.multibody.tree.BallRpyJoint_[Expression], context: pydrake.systems.framework.Context_[Expression]) → numpy.ndarray[object[3, 1]]¶ Retrieves from
context
the angular velocityw_FM
of the child frame M in the parent frame F, expressed in F.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
w_FM
: - A vector in ℝ³ with the angular velocity of the child frame M in the parent frame F, expressed in F. Refer to this class’s documentation for further details and definitions of these frames.
- Parameter
-
set_angles
(self: pydrake.multibody.tree.BallRpyJoint_[Expression], context: pydrake.systems.framework.Context_[Expression], angles: numpy.ndarray[object[3, 1]]) → pydrake.multibody.tree.BallRpyJoint_[Expression]¶ Sets the
context
so that the generalized coordinates corresponding to the rotation angles ofthis
joint equalsangles
.- Parameter
context
: - The context of the model this joint belongs to.
- Parameter
angles
: - The desired angles in radians to be stored in
context
ordered as θr, θp, θy. See get_angles() for details.
Returns: a constant reference to this
joint.- Parameter
-
set_angular_velocity
(self: pydrake.multibody.tree.BallRpyJoint_[Expression], context: pydrake.systems.framework.Context_[Expression], w_FM: numpy.ndarray[object[3, 1]]) → pydrake.multibody.tree.BallRpyJoint_[Expression]¶ Sets in
context
the state forthis
joint so that the angular velocity of the child frame M in the parent frame F isw_FM
.- Parameter
context
: - The context of the model this joint belongs to.
- Parameter
w_FM
: - A vector in ℝ³ with the angular velocity of the child frame M in the parent frame F, expressed in F. Refer to this class’s documentation for further details and definitions of these frames.
Returns: a constant reference to this
joint.- Parameter
-
set_random_angles_distribution
(self: pydrake.multibody.tree.BallRpyJoint_[Expression], angles: numpy.ndarray[object[3, 1]]) → None¶ Sets the random distribution that angles of this joint will be randomly sampled from. See get_angles() for details on the angle representation.
-
-
class
pydrake.multibody.tree.
BallRpyJoint_[float]
¶ Bases:
pydrake.multibody.tree.Joint_[float]
This Joint allows two bodies to rotate freely relative to one another. That is, given a frame F attached to the parent body P and a frame M attached to the child body B (see the Joint class’s documentation), this Joint allows frame M to rotate freely with respect to F, while the origins, Mo and Fo, of frames M and F respectively remain coincident. The orientation of M relative to F is parameterized with space
x-y-z
Euler angles.-
__init__
(self: pydrake.multibody.tree.BallRpyJoint_[float], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[float], frame_on_child: pydrake.multibody.tree.Frame_[float], damping: float = 0) → None¶ Constructor to create a ball rpy joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B rotate freely relative to one another. See this class’s documentation for further details on the definition of these frames, get_angles() for an explanation of the angles defining orientation, and get_angular_velocity() for an explanation of the generalized velocities. This constructor signature creates a joint with no joint limits, i.e. the joint position, velocity and acceleration limits are the pair
(-∞, ∞)
. These can be set using the Joint methods set_position_limits(), set_velocity_limits() and set_acceleration_limits(). The first three arguments to this constructor are those of the Joint class constructor. See the Joint class’s documentation for details. The additional parameters are:- Parameter
damping
: - Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. See documentation of damping() for details on modelling of the damping torque.
Raises: RuntimeError if damping is negative. - Parameter
-
get_angles
(self: pydrake.multibody.tree.BallRpyJoint_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[3, 1]]¶ Gets the rotation angles of
this
joint fromcontext
.The orientation
R_FM
of the child frame M in parent frame F is parameterized with spacex-y-z
Euler angles (also known as extrinsic angles). That is, the angles θr, θp, θy, correspond to a sequence of rotations about the x̂, ŷ, ẑ axes of parent frame F, respectively. Mathematically, rotationR_FM
is given in terms of angles θr, θp, θy by:R_FM(q) = Rz(θy) * Ry(θp) * Rx(θr)
where
Rx(θ)
, Ry(θ) andRz(θ)
correspond to the elemental rotations in amount of θ about the x, y and z axes respectively. Zero θr, θp, θy angles corresponds to frames F and M being coincident. Angles θr, θp, θy are defined to be positive according to the right-hand-rule with the thumb aligned in the direction of their respective axes.Note
Space
x-y-z
angles (extrinsic) are equivalent to Bodyz-y-x
angles (intrinsic).Note
This particular choice of angles θr, θp, θy for this joint are many times referred to as the roll, pitch and yaw angles by many dynamicists. They are also known as the Tait-Bryan angles or Cardan angles.
- Parameter
context
: - The context of the model this joint belongs to.
Returns: The angle coordinates of this
joint stored in thecontext
ordered as θr, θp, θy.- Parameter
-
get_angular_velocity
(self: pydrake.multibody.tree.BallRpyJoint_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[3, 1]]¶ Retrieves from
context
the angular velocityw_FM
of the child frame M in the parent frame F, expressed in F.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
w_FM
: - A vector in ℝ³ with the angular velocity of the child frame M in the parent frame F, expressed in F. Refer to this class’s documentation for further details and definitions of these frames.
- Parameter
-
set_angles
(self: pydrake.multibody.tree.BallRpyJoint_[float], context: pydrake.systems.framework.Context_[float], angles: numpy.ndarray[numpy.float64[3, 1]]) → pydrake.multibody.tree.BallRpyJoint_[float]¶ Sets the
context
so that the generalized coordinates corresponding to the rotation angles ofthis
joint equalsangles
.- Parameter
context
: - The context of the model this joint belongs to.
- Parameter
angles
: - The desired angles in radians to be stored in
context
ordered as θr, θp, θy. See get_angles() for details.
Returns: a constant reference to this
joint.- Parameter
-
set_angular_velocity
(self: pydrake.multibody.tree.BallRpyJoint_[float], context: pydrake.systems.framework.Context_[float], w_FM: numpy.ndarray[numpy.float64[3, 1]]) → pydrake.multibody.tree.BallRpyJoint_[float]¶ Sets in
context
the state forthis
joint so that the angular velocity of the child frame M in the parent frame F isw_FM
.- Parameter
context
: - The context of the model this joint belongs to.
- Parameter
w_FM
: - A vector in ℝ³ with the angular velocity of the child frame M in the parent frame F, expressed in F. Refer to this class’s documentation for further details and definitions of these frames.
Returns: a constant reference to this
joint.- Parameter
-
set_random_angles_distribution
(self: pydrake.multibody.tree.BallRpyJoint_[float], angles: numpy.ndarray[object[3, 1]]) → None¶ Sets the random distribution that angles of this joint will be randomly sampled from. See get_angles() for details on the angle representation.
-
-
pydrake.multibody.tree.
Body
¶ alias of
pydrake.multibody.tree.Body_[float]
-
template
pydrake.multibody.tree.
Body_
¶ Instantiations:
Body_[float]
,Body_[AutoDiffXd]
,Body_[Expression]
-
class
Body_[float]
¶ %Body provides the general abstraction of a body with an API that makes no assumption about whether a body is rigid or deformable and neither does it make any assumptions about the underlying physical model or approximation. As an element or component of a MultibodyTree, a body is a MultibodyElement, and therefore it has a unique index of type BodyIndex within the multibody tree it belongs to.
A Body contains a unique BodyFrame; see BodyFrame class documentation for more information.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
AddInForce
(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float], p_BP_E: numpy.ndarray[numpy.float64[3, 1]], F_Bp_E: pydrake.multibody.math.SpatialForce_[float], frame_E: pydrake.multibody.tree.Frame_[float], forces: drake::multibody::MultibodyForces<double>) → None¶ Adds the spatial force on
this
body B, applied at point P and expressed in a frame E intoforces
.- Parameter
context
: - The context containing the current state of the model.
- Parameter
p_BP_E
: - The position of point P in B, expressed in a frame E.
- Parameter
F_Bp_E
: - The spatial force to be applied on body B at point P, expressed in frame E.
- Parameter
frame_E
: - The expressed-in frame E.
- Parameter
forces
: - A multibody forces objects that on output will have
F_Bp_E
added.
Raises: - RuntimeError if
forces
is nullptr or if it is not consistent - with the model to which
this
body belongs.
- Parameter
-
AddInForceInWorld
(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float], F_Bo_W: pydrake.multibody.math.SpatialForce_[float], forces: drake::multibody::MultibodyForces<double>) → None¶ Adds the spatial force on
this
body B, applied at body B’s origin Bo and expressed in the world frame W intoforces
.
-
body_frame
(self: pydrake.multibody.tree.Body_[float]) → pydrake.multibody.tree.BodyFrame_[float]¶ Returns a const reference to the associated BodyFrame.
-
GetForceInWorld
(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float], forces: drake::multibody::MultibodyForces<double>) → pydrake.multibody.math.SpatialForce_[float]¶ Gets the sptatial force on
this
body B fromforces
as F_BBo_W: applied at body B’s origin Bo and expressed in world world frame W.
-
index
(self: pydrake.multibody.tree.Body_[float]) → pydrake.multibody.tree.BodyIndex¶
-
is_floating
(self: pydrake.multibody.tree.Body_[float]) → bool¶ (Advanced) Returns
True
ifthis
body is granted 6-dofs by a Mobilizer.Note
A floating body is not necessarily modeled with a quaternion mobilizer, see has_quaternion_dofs(). Alternative options include a space XYZ parametrization of rotations, see SpaceXYZMobilizer.
Raises: - RuntimeError if called pre-finalize, see
- MultibodyPlant::Finalize().
-
model_instance
(self: pydrake.multibody.tree.Body_[float]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.Body_[float]) → str¶ Gets the
name
associated withthis
body.
-
-
class
-
class
pydrake.multibody.tree.
Body_[AutoDiffXd]
¶ %Body provides the general abstraction of a body with an API that makes no assumption about whether a body is rigid or deformable and neither does it make any assumptions about the underlying physical model or approximation. As an element or component of a MultibodyTree, a body is a MultibodyElement, and therefore it has a unique index of type BodyIndex within the multibody tree it belongs to.
A Body contains a unique BodyFrame; see BodyFrame class documentation for more information.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
AddInForce
(self: pydrake.multibody.tree.Body_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], p_BP_E: numpy.ndarray[object[3, 1]], F_Bp_E: pydrake.multibody.math.SpatialForce_[AutoDiffXd], frame_E: pydrake.multibody.tree.Frame_[AutoDiffXd], forces: drake::multibody::MultibodyForces<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >) → None¶ Adds the spatial force on
this
body B, applied at point P and expressed in a frame E intoforces
.- Parameter
context
: - The context containing the current state of the model.
- Parameter
p_BP_E
: - The position of point P in B, expressed in a frame E.
- Parameter
F_Bp_E
: - The spatial force to be applied on body B at point P, expressed in frame E.
- Parameter
frame_E
: - The expressed-in frame E.
- Parameter
forces
: - A multibody forces objects that on output will have
F_Bp_E
added.
Raises: - RuntimeError if
forces
is nullptr or if it is not consistent - with the model to which
this
body belongs.
- Parameter
-
AddInForceInWorld
(self: pydrake.multibody.tree.Body_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], F_Bo_W: pydrake.multibody.math.SpatialForce_[AutoDiffXd], forces: drake::multibody::MultibodyForces<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >) → None¶ Adds the spatial force on
this
body B, applied at body B’s origin Bo and expressed in the world frame W intoforces
.
-
body_frame
(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → pydrake.multibody.tree.BodyFrame_[AutoDiffXd]¶ Returns a const reference to the associated BodyFrame.
-
GetForceInWorld
(self: pydrake.multibody.tree.Body_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], forces: drake::multibody::MultibodyForces<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >) → pydrake.multibody.math.SpatialForce_[AutoDiffXd]¶ Gets the sptatial force on
this
body B fromforces
as F_BBo_W: applied at body B’s origin Bo and expressed in world world frame W.
-
index
(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → pydrake.multibody.tree.BodyIndex¶
-
is_floating
(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → bool¶ (Advanced) Returns
True
ifthis
body is granted 6-dofs by a Mobilizer.Note
A floating body is not necessarily modeled with a quaternion mobilizer, see has_quaternion_dofs(). Alternative options include a space XYZ parametrization of rotations, see SpaceXYZMobilizer.
Raises: - RuntimeError if called pre-finalize, see
- MultibodyPlant::Finalize().
-
model_instance
(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → str¶ Gets the
name
associated withthis
body.
-
-
class
pydrake.multibody.tree.
Body_[Expression]
¶ %Body provides the general abstraction of a body with an API that makes no assumption about whether a body is rigid or deformable and neither does it make any assumptions about the underlying physical model or approximation. As an element or component of a MultibodyTree, a body is a MultibodyElement, and therefore it has a unique index of type BodyIndex within the multibody tree it belongs to.
A Body contains a unique BodyFrame; see BodyFrame class documentation for more information.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
AddInForce
(self: pydrake.multibody.tree.Body_[Expression], context: pydrake.systems.framework.Context_[Expression], p_BP_E: numpy.ndarray[object[3, 1]], F_Bp_E: pydrake.multibody.math.SpatialForce_[Expression], frame_E: pydrake.multibody.tree.Frame_[Expression], forces: drake::multibody::MultibodyForces<drake::symbolic::Expression>) → None¶ Adds the spatial force on
this
body B, applied at point P and expressed in a frame E intoforces
.- Parameter
context
: - The context containing the current state of the model.
- Parameter
p_BP_E
: - The position of point P in B, expressed in a frame E.
- Parameter
F_Bp_E
: - The spatial force to be applied on body B at point P, expressed in frame E.
- Parameter
frame_E
: - The expressed-in frame E.
- Parameter
forces
: - A multibody forces objects that on output will have
F_Bp_E
added.
Raises: - RuntimeError if
forces
is nullptr or if it is not consistent - with the model to which
this
body belongs.
- Parameter
-
AddInForceInWorld
(self: pydrake.multibody.tree.Body_[Expression], context: pydrake.systems.framework.Context_[Expression], F_Bo_W: pydrake.multibody.math.SpatialForce_[Expression], forces: drake::multibody::MultibodyForces<drake::symbolic::Expression>) → None¶ Adds the spatial force on
this
body B, applied at body B’s origin Bo and expressed in the world frame W intoforces
.
-
body_frame
(self: pydrake.multibody.tree.Body_[Expression]) → pydrake.multibody.tree.BodyFrame_[Expression]¶ Returns a const reference to the associated BodyFrame.
-
GetForceInWorld
(self: pydrake.multibody.tree.Body_[Expression], context: pydrake.systems.framework.Context_[Expression], forces: drake::multibody::MultibodyForces<drake::symbolic::Expression>) → pydrake.multibody.math.SpatialForce_[Expression]¶ Gets the sptatial force on
this
body B fromforces
as F_BBo_W: applied at body B’s origin Bo and expressed in world world frame W.
-
index
(self: pydrake.multibody.tree.Body_[Expression]) → pydrake.multibody.tree.BodyIndex¶
-
is_floating
(self: pydrake.multibody.tree.Body_[Expression]) → bool¶ (Advanced) Returns
True
ifthis
body is granted 6-dofs by a Mobilizer.Note
A floating body is not necessarily modeled with a quaternion mobilizer, see has_quaternion_dofs(). Alternative options include a space XYZ parametrization of rotations, see SpaceXYZMobilizer.
Raises: - RuntimeError if called pre-finalize, see
- MultibodyPlant::Finalize().
-
model_instance
(self: pydrake.multibody.tree.Body_[Expression]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.Body_[Expression]) → str¶ Gets the
name
associated withthis
body.
-
-
class
pydrake.multibody.tree.
Body_[float]
¶ %Body provides the general abstraction of a body with an API that makes no assumption about whether a body is rigid or deformable and neither does it make any assumptions about the underlying physical model or approximation. As an element or component of a MultibodyTree, a body is a MultibodyElement, and therefore it has a unique index of type BodyIndex within the multibody tree it belongs to.
A Body contains a unique BodyFrame; see BodyFrame class documentation for more information.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
AddInForce
(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float], p_BP_E: numpy.ndarray[numpy.float64[3, 1]], F_Bp_E: pydrake.multibody.math.SpatialForce_[float], frame_E: pydrake.multibody.tree.Frame_[float], forces: drake::multibody::MultibodyForces<double>) → None¶ Adds the spatial force on
this
body B, applied at point P and expressed in a frame E intoforces
.- Parameter
context
: - The context containing the current state of the model.
- Parameter
p_BP_E
: - The position of point P in B, expressed in a frame E.
- Parameter
F_Bp_E
: - The spatial force to be applied on body B at point P, expressed in frame E.
- Parameter
frame_E
: - The expressed-in frame E.
- Parameter
forces
: - A multibody forces objects that on output will have
F_Bp_E
added.
Raises: - RuntimeError if
forces
is nullptr or if it is not consistent - with the model to which
this
body belongs.
- Parameter
-
AddInForceInWorld
(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float], F_Bo_W: pydrake.multibody.math.SpatialForce_[float], forces: drake::multibody::MultibodyForces<double>) → None¶ Adds the spatial force on
this
body B, applied at body B’s origin Bo and expressed in the world frame W intoforces
.
-
body_frame
(self: pydrake.multibody.tree.Body_[float]) → pydrake.multibody.tree.BodyFrame_[float]¶ Returns a const reference to the associated BodyFrame.
-
GetForceInWorld
(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float], forces: drake::multibody::MultibodyForces<double>) → pydrake.multibody.math.SpatialForce_[float]¶ Gets the sptatial force on
this
body B fromforces
as F_BBo_W: applied at body B’s origin Bo and expressed in world world frame W.
-
index
(self: pydrake.multibody.tree.Body_[float]) → pydrake.multibody.tree.BodyIndex¶
-
is_floating
(self: pydrake.multibody.tree.Body_[float]) → bool¶ (Advanced) Returns
True
ifthis
body is granted 6-dofs by a Mobilizer.Note
A floating body is not necessarily modeled with a quaternion mobilizer, see has_quaternion_dofs(). Alternative options include a space XYZ parametrization of rotations, see SpaceXYZMobilizer.
Raises: - RuntimeError if called pre-finalize, see
- MultibodyPlant::Finalize().
-
model_instance
(self: pydrake.multibody.tree.Body_[float]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.Body_[float]) → str¶ Gets the
name
associated withthis
body.
-
-
pydrake.multibody.tree.
BodyFrame
¶
-
template
pydrake.multibody.tree.
BodyFrame_
¶ Instantiations:
BodyFrame_[float]
,BodyFrame_[AutoDiffXd]
,BodyFrame_[Expression]
-
class
BodyFrame_[float]
¶ Bases:
pydrake.multibody.tree.Frame_[float]
A BodyFrame is a material Frame that serves as the unique reference frame for a Body.
Each Body B, regardless of whether it represents a rigid body or a flexible body, has a unique body frame for which we use the same symbol B (with meaning clear from context). The body frame is also referred to as a reference frame in the literature for flexible body mechanics modeling using the Finite Element Method. All properties of a body are defined with respect to its body frame, including its mass properties and attachment locations for joints, constraints, actuators, geometry and so on. Run time motion of the body is defined with respect to the motion of its body frame. We represent a body frame by a BodyFrame object that is created whenever a Body is constructed and is owned by the Body.
Note that the BodyFrame associated with a body does not necessarily need to be located at its center of mass nor does it need to be aligned with the body’s principal axes, although, in practice, it frequently is. For flexible bodies, BodyFrame provides a representation for the body’s reference frame. The flexible degrees of freedom associated with a flexible body describe the body’s deformation in this frame. Therefore, the motion of a flexible body is defined by the motion of its BodyFrame, or reference frame, plus the motion of the material points on the body with respect to its BodyFrame.
A BodyFrame and Body are tightly coupled concepts; neither makes sense without the other. Therefore, a BodyFrame instance is constructed in conjunction with its Body and cannot be constructed anywhere else. However, you can still access the frame associated with a body, see Body::body_frame(). This access is more than a convenience; you can use the BodyFrame to define other frames on the body and to attach other multibody elements to it.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
-
class
pydrake.multibody.tree.
BodyFrame_[AutoDiffXd]
¶ Bases:
pydrake.multibody.tree.Frame_[AutoDiffXd]
A BodyFrame is a material Frame that serves as the unique reference frame for a Body.
Each Body B, regardless of whether it represents a rigid body or a flexible body, has a unique body frame for which we use the same symbol B (with meaning clear from context). The body frame is also referred to as a reference frame in the literature for flexible body mechanics modeling using the Finite Element Method. All properties of a body are defined with respect to its body frame, including its mass properties and attachment locations for joints, constraints, actuators, geometry and so on. Run time motion of the body is defined with respect to the motion of its body frame. We represent a body frame by a BodyFrame object that is created whenever a Body is constructed and is owned by the Body.
Note that the BodyFrame associated with a body does not necessarily need to be located at its center of mass nor does it need to be aligned with the body’s principal axes, although, in practice, it frequently is. For flexible bodies, BodyFrame provides a representation for the body’s reference frame. The flexible degrees of freedom associated with a flexible body describe the body’s deformation in this frame. Therefore, the motion of a flexible body is defined by the motion of its BodyFrame, or reference frame, plus the motion of the material points on the body with respect to its BodyFrame.
A BodyFrame and Body are tightly coupled concepts; neither makes sense without the other. Therefore, a BodyFrame instance is constructed in conjunction with its Body and cannot be constructed anywhere else. However, you can still access the frame associated with a body, see Body::body_frame(). This access is more than a convenience; you can use the BodyFrame to define other frames on the body and to attach other multibody elements to it.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
pydrake.multibody.tree.
BodyFrame_[Expression]
¶ Bases:
pydrake.multibody.tree.Frame_[Expression]
A BodyFrame is a material Frame that serves as the unique reference frame for a Body.
Each Body B, regardless of whether it represents a rigid body or a flexible body, has a unique body frame for which we use the same symbol B (with meaning clear from context). The body frame is also referred to as a reference frame in the literature for flexible body mechanics modeling using the Finite Element Method. All properties of a body are defined with respect to its body frame, including its mass properties and attachment locations for joints, constraints, actuators, geometry and so on. Run time motion of the body is defined with respect to the motion of its body frame. We represent a body frame by a BodyFrame object that is created whenever a Body is constructed and is owned by the Body.
Note that the BodyFrame associated with a body does not necessarily need to be located at its center of mass nor does it need to be aligned with the body’s principal axes, although, in practice, it frequently is. For flexible bodies, BodyFrame provides a representation for the body’s reference frame. The flexible degrees of freedom associated with a flexible body describe the body’s deformation in this frame. Therefore, the motion of a flexible body is defined by the motion of its BodyFrame, or reference frame, plus the motion of the material points on the body with respect to its BodyFrame.
A BodyFrame and Body are tightly coupled concepts; neither makes sense without the other. Therefore, a BodyFrame instance is constructed in conjunction with its Body and cannot be constructed anywhere else. However, you can still access the frame associated with a body, see Body::body_frame(). This access is more than a convenience; you can use the BodyFrame to define other frames on the body and to attach other multibody elements to it.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
pydrake.multibody.tree.
BodyFrame_[float]
¶ Bases:
pydrake.multibody.tree.Frame_[float]
A BodyFrame is a material Frame that serves as the unique reference frame for a Body.
Each Body B, regardless of whether it represents a rigid body or a flexible body, has a unique body frame for which we use the same symbol B (with meaning clear from context). The body frame is also referred to as a reference frame in the literature for flexible body mechanics modeling using the Finite Element Method. All properties of a body are defined with respect to its body frame, including its mass properties and attachment locations for joints, constraints, actuators, geometry and so on. Run time motion of the body is defined with respect to the motion of its body frame. We represent a body frame by a BodyFrame object that is created whenever a Body is constructed and is owned by the Body.
Note that the BodyFrame associated with a body does not necessarily need to be located at its center of mass nor does it need to be aligned with the body’s principal axes, although, in practice, it frequently is. For flexible bodies, BodyFrame provides a representation for the body’s reference frame. The flexible degrees of freedom associated with a flexible body describe the body’s deformation in this frame. Therefore, the motion of a flexible body is defined by the motion of its BodyFrame, or reference frame, plus the motion of the material points on the body with respect to its BodyFrame.
A BodyFrame and Body are tightly coupled concepts; neither makes sense without the other. Therefore, a BodyFrame instance is constructed in conjunction with its Body and cannot be constructed anywhere else. However, you can still access the frame associated with a body, see Body::body_frame(). This access is more than a convenience; you can use the BodyFrame to define other frames on the body and to attach other multibody elements to it.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
pydrake.multibody.tree.
BodyIndex
¶ Type used to identify bodies by index in a multibody tree system.
-
__init__
(self: pydrake.multibody.tree.BodyIndex, arg0: int) → None¶ Default constructor; the result is an invalid index. This only exists to serve applications which require a default constructor.
-
is_valid
(self: pydrake.multibody.tree.BodyIndex) → bool¶ Reports if the index is valid–the only operation on an invalid index that doesn’t throw an exception in Debug builds.
-
-
pydrake.multibody.tree.
default_model_instance
() → pydrake.multibody.tree.ModelInstanceIndex¶ Returns the model instance which contains all tree elements with no explicit model instance specified.
-
pydrake.multibody.tree.
DoorHinge
¶
-
template
pydrake.multibody.tree.
DoorHinge_
¶ Instantiations:
DoorHinge_[float]
,DoorHinge_[AutoDiffXd]
,DoorHinge_[Expression]
-
class
DoorHinge_[float]
¶ Bases:
pydrake.multibody.tree.ForceElement_[float]
This ForceElement models a revolute DoorHinge joint that could exhibit different force/torque characteristics at different states due to the existence of different type of torques on the joint. This class implements a “christmas tree” accumulation of these different torques in an empirical and unprincipled way. Specifically, different curves are assigned to different torques to mimic their evolution based on the joint state and some prespecified parameters.
Torques considered in this implementation include: * torsional spring torque (τ_ts) – position dependent * catch torque (τ_c) – position dependent * dynamic friction torque (τ_df) – velocity dependent * static friction torque (τ_sf) – velocity dependent * viscous friction torque (τ_vf) – velocity dependent
We then implement two curves to approximate the progression of different torques. A curve
s(t, x) = tanh(x/t)
uses thetanh
function to approximate a step curve ({x<0: -1 ;x>0
: 1}) outside of-t < x < t
. The curvedoublet(t, x) = 2 * s * (1 − s²)
is the second derivative ofs
scaled by-t²
, which yields a lump at negativex
that integrates to -1 and a lump at positivex
that integrates to 1. Finally, the total external torque on the hinge joint would be:τ = τ_ts + τ_c + τ_df + τ_sf + τ_vf
.where
τ_ts = -k_ts * (q − qs₀)
, τ_c = k_c * doublet(qc₀/2, q − qc₀/2)`, τ_df = -k_df * s(k_q̇₀, q̇)`, τ_sf = -k_sf * doublet(k_q̇₀, q̇) andτ_vf = -k_vf * q̇
. The door is assumed to be closed atq=0
, opening in the positive-q direction. Note that, the sign of the torques depends on two elements: one is the sign of the torque related constants and another one is the sign of the assigned curves. For example, as defined above, the static friction torqueτ_sf
should be opposite to the direction of the velocity q̇. The catch torqueτ_c
should be negative whenq < qc₀/2
and positive otherwise. This class applies all hinge-originating forces, so it can be used instead of the SDF viscous damping. The users could change the values of these different elements to obtain different characteristics for the DoorHinge joint that the users want to model. A jupyter notebook tool is also provided to help the users visualize the curves and design parameters. Runbazel run //bindings/pydrake/multibody:examples/door_hinge_inspector
to bring up the notebook.To give an example, a common dishwasher door has a frictional torque sufficient for it to rest motionless at any angle, a catch at the top to hold it in place, a dashpot (viscous friction source) to prevent it from swinging too fast, and a spring to counteract some of its mass. Two figures are provided to illustrate the dishwasher DoorHinge torque with the given default parameters. Figure 1 shows the static characteristic of the dishwasher door. At q = 0, there exists a negative catch torque to prevent the door from moving. After that, the torsional spring torque will dominate to compensate part of the door gravity. Figure 2 shows the dynamic feature of the dishwasher door at q = 30 deg. It shows the door can be closed easily since the torque is small when the velocity is negative. However, whenever the door intends to open further, there will be a counter torque to prevent that movement, which therefore keeps the door at rest. Note that, due to the gravity, the dishwasher door will be fully open eventually. This process can be really slow because of the default
motion_threshold
is set to be very small. You can change themotion_threshold
parameter to adjust the time. @image html multibody/tree/images/torque_vs_angle.svg “Figure 1” @image html multibody/tree/images/torque_vs_velocity.svg “Figure 2”-
__init__
(self: pydrake.multibody.tree.DoorHinge_[float], joint: pydrake.multibody.tree.RevoluteJoint_[float], config: pydrake.multibody.tree.DoorHingeConfig) → None¶ Constructs a hinge force element with parameters
config
applied to the specifiedjoint
. It will throw an exception if the DoorHingeConfig is invalid.
-
CalcHingeFrictionalTorque
(self: pydrake.multibody.tree.DoorHinge_[float], angular_rate: float) → float¶ Calculates the total frictional torque with the given
angular_rate
and the internal DoorHingeConfig.
-
CalcHingeSpringTorque
(self: pydrake.multibody.tree.DoorHinge_[float], angle: float) → float¶ Calculate the total spring related torque with the given
angle
and the internal DoorHingeConfig.
-
CalcHingeTorque
(self: pydrake.multibody.tree.DoorHinge_[float], angle: float, angular_rate: float) → float¶ Calculate the total torque with the given
angle
andangular_rate
and the internal DoorHingeConfig.
-
config
(self: pydrake.multibody.tree.DoorHinge_[float]) → pydrake.multibody.tree.DoorHingeConfig¶
-
joint
(self: pydrake.multibody.tree.DoorHinge_[float]) → pydrake.multibody.tree.RevoluteJoint_[float]¶
-
-
class
-
class
pydrake.multibody.tree.
DoorHinge_[AutoDiffXd]
¶ Bases:
pydrake.multibody.tree.ForceElement_[AutoDiffXd]
This ForceElement models a revolute DoorHinge joint that could exhibit different force/torque characteristics at different states due to the existence of different type of torques on the joint. This class implements a “christmas tree” accumulation of these different torques in an empirical and unprincipled way. Specifically, different curves are assigned to different torques to mimic their evolution based on the joint state and some prespecified parameters.
Torques considered in this implementation include: * torsional spring torque (τ_ts) – position dependent * catch torque (τ_c) – position dependent * dynamic friction torque (τ_df) – velocity dependent * static friction torque (τ_sf) – velocity dependent * viscous friction torque (τ_vf) – velocity dependent
We then implement two curves to approximate the progression of different torques. A curve
s(t, x) = tanh(x/t)
uses thetanh
function to approximate a step curve ({x<0: -1 ;x>0
: 1}) outside of-t < x < t
. The curvedoublet(t, x) = 2 * s * (1 − s²)
is the second derivative ofs
scaled by-t²
, which yields a lump at negativex
that integrates to -1 and a lump at positivex
that integrates to 1. Finally, the total external torque on the hinge joint would be:τ = τ_ts + τ_c + τ_df + τ_sf + τ_vf
.where
τ_ts = -k_ts * (q − qs₀)
, τ_c = k_c * doublet(qc₀/2, q − qc₀/2)`, τ_df = -k_df * s(k_q̇₀, q̇)`, τ_sf = -k_sf * doublet(k_q̇₀, q̇) andτ_vf = -k_vf * q̇
. The door is assumed to be closed atq=0
, opening in the positive-q direction. Note that, the sign of the torques depends on two elements: one is the sign of the torque related constants and another one is the sign of the assigned curves. For example, as defined above, the static friction torqueτ_sf
should be opposite to the direction of the velocity q̇. The catch torqueτ_c
should be negative whenq < qc₀/2
and positive otherwise. This class applies all hinge-originating forces, so it can be used instead of the SDF viscous damping. The users could change the values of these different elements to obtain different characteristics for the DoorHinge joint that the users want to model. A jupyter notebook tool is also provided to help the users visualize the curves and design parameters. Runbazel run //bindings/pydrake/multibody:examples/door_hinge_inspector
to bring up the notebook.To give an example, a common dishwasher door has a frictional torque sufficient for it to rest motionless at any angle, a catch at the top to hold it in place, a dashpot (viscous friction source) to prevent it from swinging too fast, and a spring to counteract some of its mass. Two figures are provided to illustrate the dishwasher DoorHinge torque with the given default parameters. Figure 1 shows the static characteristic of the dishwasher door. At q = 0, there exists a negative catch torque to prevent the door from moving. After that, the torsional spring torque will dominate to compensate part of the door gravity. Figure 2 shows the dynamic feature of the dishwasher door at q = 30 deg. It shows the door can be closed easily since the torque is small when the velocity is negative. However, whenever the door intends to open further, there will be a counter torque to prevent that movement, which therefore keeps the door at rest. Note that, due to the gravity, the dishwasher door will be fully open eventually. This process can be really slow because of the default
motion_threshold
is set to be very small. You can change themotion_threshold
parameter to adjust the time. @image html multibody/tree/images/torque_vs_angle.svg “Figure 1” @image html multibody/tree/images/torque_vs_velocity.svg “Figure 2”-
__init__
(self: pydrake.multibody.tree.DoorHinge_[AutoDiffXd], joint: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd], config: pydrake.multibody.tree.DoorHingeConfig) → None¶ Constructs a hinge force element with parameters
config
applied to the specifiedjoint
. It will throw an exception if the DoorHingeConfig is invalid.
-
CalcHingeFrictionalTorque
(self: pydrake.multibody.tree.DoorHinge_[AutoDiffXd], angular_rate: pydrake.autodiffutils.AutoDiffXd) → pydrake.autodiffutils.AutoDiffXd¶ Calculates the total frictional torque with the given
angular_rate
and the internal DoorHingeConfig.
-
CalcHingeSpringTorque
(self: pydrake.multibody.tree.DoorHinge_[AutoDiffXd], angle: pydrake.autodiffutils.AutoDiffXd) → pydrake.autodiffutils.AutoDiffXd¶ Calculate the total spring related torque with the given
angle
and the internal DoorHingeConfig.
-
CalcHingeTorque
(self: pydrake.multibody.tree.DoorHinge_[AutoDiffXd], angle: pydrake.autodiffutils.AutoDiffXd, angular_rate: pydrake.autodiffutils.AutoDiffXd) → pydrake.autodiffutils.AutoDiffXd¶ Calculate the total torque with the given
angle
andangular_rate
and the internal DoorHingeConfig.
-
config
(self: pydrake.multibody.tree.DoorHinge_[AutoDiffXd]) → pydrake.multibody.tree.DoorHingeConfig¶
-
joint
(self: pydrake.multibody.tree.DoorHinge_[AutoDiffXd]) → pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd]¶
-
-
class
pydrake.multibody.tree.
DoorHinge_[Expression]
¶ Bases:
pydrake.multibody.tree.ForceElement_[Expression]
This ForceElement models a revolute DoorHinge joint that could exhibit different force/torque characteristics at different states due to the existence of different type of torques on the joint. This class implements a “christmas tree” accumulation of these different torques in an empirical and unprincipled way. Specifically, different curves are assigned to different torques to mimic their evolution based on the joint state and some prespecified parameters.
Torques considered in this implementation include: * torsional spring torque (τ_ts) – position dependent * catch torque (τ_c) – position dependent * dynamic friction torque (τ_df) – velocity dependent * static friction torque (τ_sf) – velocity dependent * viscous friction torque (τ_vf) – velocity dependent
We then implement two curves to approximate the progression of different torques. A curve
s(t, x) = tanh(x/t)
uses thetanh
function to approximate a step curve ({x<0: -1 ;x>0
: 1}) outside of-t < x < t
. The curvedoublet(t, x) = 2 * s * (1 − s²)
is the second derivative ofs
scaled by-t²
, which yields a lump at negativex
that integrates to -1 and a lump at positivex
that integrates to 1. Finally, the total external torque on the hinge joint would be:τ = τ_ts + τ_c + τ_df + τ_sf + τ_vf
.where
τ_ts = -k_ts * (q − qs₀)
, τ_c = k_c * doublet(qc₀/2, q − qc₀/2)`, τ_df = -k_df * s(k_q̇₀, q̇)`, τ_sf = -k_sf * doublet(k_q̇₀, q̇) andτ_vf = -k_vf * q̇
. The door is assumed to be closed atq=0
, opening in the positive-q direction. Note that, the sign of the torques depends on two elements: one is the sign of the torque related constants and another one is the sign of the assigned curves. For example, as defined above, the static friction torqueτ_sf
should be opposite to the direction of the velocity q̇. The catch torqueτ_c
should be negative whenq < qc₀/2
and positive otherwise. This class applies all hinge-originating forces, so it can be used instead of the SDF viscous damping. The users could change the values of these different elements to obtain different characteristics for the DoorHinge joint that the users want to model. A jupyter notebook tool is also provided to help the users visualize the curves and design parameters. Runbazel run //bindings/pydrake/multibody:examples/door_hinge_inspector
to bring up the notebook.To give an example, a common dishwasher door has a frictional torque sufficient for it to rest motionless at any angle, a catch at the top to hold it in place, a dashpot (viscous friction source) to prevent it from swinging too fast, and a spring to counteract some of its mass. Two figures are provided to illustrate the dishwasher DoorHinge torque with the given default parameters. Figure 1 shows the static characteristic of the dishwasher door. At q = 0, there exists a negative catch torque to prevent the door from moving. After that, the torsional spring torque will dominate to compensate part of the door gravity. Figure 2 shows the dynamic feature of the dishwasher door at q = 30 deg. It shows the door can be closed easily since the torque is small when the velocity is negative. However, whenever the door intends to open further, there will be a counter torque to prevent that movement, which therefore keeps the door at rest. Note that, due to the gravity, the dishwasher door will be fully open eventually. This process can be really slow because of the default
motion_threshold
is set to be very small. You can change themotion_threshold
parameter to adjust the time. @image html multibody/tree/images/torque_vs_angle.svg “Figure 1” @image html multibody/tree/images/torque_vs_velocity.svg “Figure 2”-
__init__
(self: pydrake.multibody.tree.DoorHinge_[Expression], joint: pydrake.multibody.tree.RevoluteJoint_[Expression], config: pydrake.multibody.tree.DoorHingeConfig) → None¶ Constructs a hinge force element with parameters
config
applied to the specifiedjoint
. It will throw an exception if the DoorHingeConfig is invalid.
-
CalcHingeFrictionalTorque
(self: pydrake.multibody.tree.DoorHinge_[Expression], angular_rate: pydrake.symbolic.Expression) → pydrake.symbolic.Expression¶ Calculates the total frictional torque with the given
angular_rate
and the internal DoorHingeConfig.
-
CalcHingeSpringTorque
(self: pydrake.multibody.tree.DoorHinge_[Expression], angle: pydrake.symbolic.Expression) → pydrake.symbolic.Expression¶ Calculate the total spring related torque with the given
angle
and the internal DoorHingeConfig.
-
CalcHingeTorque
(self: pydrake.multibody.tree.DoorHinge_[Expression], angle: pydrake.symbolic.Expression, angular_rate: pydrake.symbolic.Expression) → pydrake.symbolic.Expression¶ Calculate the total torque with the given
angle
andangular_rate
and the internal DoorHingeConfig.
-
config
(self: pydrake.multibody.tree.DoorHinge_[Expression]) → pydrake.multibody.tree.DoorHingeConfig¶
-
joint
(self: pydrake.multibody.tree.DoorHinge_[Expression]) → pydrake.multibody.tree.RevoluteJoint_[Expression]¶
-
-
class
pydrake.multibody.tree.
DoorHinge_[float]
¶ Bases:
pydrake.multibody.tree.ForceElement_[float]
This ForceElement models a revolute DoorHinge joint that could exhibit different force/torque characteristics at different states due to the existence of different type of torques on the joint. This class implements a “christmas tree” accumulation of these different torques in an empirical and unprincipled way. Specifically, different curves are assigned to different torques to mimic their evolution based on the joint state and some prespecified parameters.
Torques considered in this implementation include: * torsional spring torque (τ_ts) – position dependent * catch torque (τ_c) – position dependent * dynamic friction torque (τ_df) – velocity dependent * static friction torque (τ_sf) – velocity dependent * viscous friction torque (τ_vf) – velocity dependent
We then implement two curves to approximate the progression of different torques. A curve
s(t, x) = tanh(x/t)
uses thetanh
function to approximate a step curve ({x<0: -1 ;x>0
: 1}) outside of-t < x < t
. The curvedoublet(t, x) = 2 * s * (1 − s²)
is the second derivative ofs
scaled by-t²
, which yields a lump at negativex
that integrates to -1 and a lump at positivex
that integrates to 1. Finally, the total external torque on the hinge joint would be:τ = τ_ts + τ_c + τ_df + τ_sf + τ_vf
.where
τ_ts = -k_ts * (q − qs₀)
, τ_c = k_c * doublet(qc₀/2, q − qc₀/2)`, τ_df = -k_df * s(k_q̇₀, q̇)`, τ_sf = -k_sf * doublet(k_q̇₀, q̇) andτ_vf = -k_vf * q̇
. The door is assumed to be closed atq=0
, opening in the positive-q direction. Note that, the sign of the torques depends on two elements: one is the sign of the torque related constants and another one is the sign of the assigned curves. For example, as defined above, the static friction torqueτ_sf
should be opposite to the direction of the velocity q̇. The catch torqueτ_c
should be negative whenq < qc₀/2
and positive otherwise. This class applies all hinge-originating forces, so it can be used instead of the SDF viscous damping. The users could change the values of these different elements to obtain different characteristics for the DoorHinge joint that the users want to model. A jupyter notebook tool is also provided to help the users visualize the curves and design parameters. Runbazel run //bindings/pydrake/multibody:examples/door_hinge_inspector
to bring up the notebook.To give an example, a common dishwasher door has a frictional torque sufficient for it to rest motionless at any angle, a catch at the top to hold it in place, a dashpot (viscous friction source) to prevent it from swinging too fast, and a spring to counteract some of its mass. Two figures are provided to illustrate the dishwasher DoorHinge torque with the given default parameters. Figure 1 shows the static characteristic of the dishwasher door. At q = 0, there exists a negative catch torque to prevent the door from moving. After that, the torsional spring torque will dominate to compensate part of the door gravity. Figure 2 shows the dynamic feature of the dishwasher door at q = 30 deg. It shows the door can be closed easily since the torque is small when the velocity is negative. However, whenever the door intends to open further, there will be a counter torque to prevent that movement, which therefore keeps the door at rest. Note that, due to the gravity, the dishwasher door will be fully open eventually. This process can be really slow because of the default
motion_threshold
is set to be very small. You can change themotion_threshold
parameter to adjust the time. @image html multibody/tree/images/torque_vs_angle.svg “Figure 1” @image html multibody/tree/images/torque_vs_velocity.svg “Figure 2”-
__init__
(self: pydrake.multibody.tree.DoorHinge_[float], joint: pydrake.multibody.tree.RevoluteJoint_[float], config: pydrake.multibody.tree.DoorHingeConfig) → None¶ Constructs a hinge force element with parameters
config
applied to the specifiedjoint
. It will throw an exception if the DoorHingeConfig is invalid.
-
CalcHingeFrictionalTorque
(self: pydrake.multibody.tree.DoorHinge_[float], angular_rate: float) → float¶ Calculates the total frictional torque with the given
angular_rate
and the internal DoorHingeConfig.
-
CalcHingeSpringTorque
(self: pydrake.multibody.tree.DoorHinge_[float], angle: float) → float¶ Calculate the total spring related torque with the given
angle
and the internal DoorHingeConfig.
-
CalcHingeTorque
(self: pydrake.multibody.tree.DoorHinge_[float], angle: float, angular_rate: float) → float¶ Calculate the total torque with the given
angle
andangular_rate
and the internal DoorHingeConfig.
-
config
(self: pydrake.multibody.tree.DoorHinge_[float]) → pydrake.multibody.tree.DoorHingeConfig¶
-
joint
(self: pydrake.multibody.tree.DoorHinge_[float]) → pydrake.multibody.tree.RevoluteJoint_[float]¶
-
-
class
pydrake.multibody.tree.
DoorHingeConfig
¶ Configuration structure for the DoorHinge.
-
__init__
(self: pydrake.multibody.tree.DoorHingeConfig, **kwargs) → None¶ Initialize to empirically reasonable values measured approximately by banging on the door of a dishwasher with a force gauge.
-
catch_torque
¶ k_c maximum catch torque applied over
catch_width
[Nm]. It should be non-negative.
-
catch_width
¶ qc₀ measured from closed (q=0) position [radian]. It should be non-negative.
-
dynamic_friction_torque
¶ k_df maximum dynamic friction torque measured opposite direction of motion [Nm]. It should be non-negative.
-
motion_threshold
¶ k_q̇₀ motion threshold to start to apply friction torques [rad/s]. It should be non-negative. Realistic frictional force is very stiff, reversing entirely over zero change in position or velocity, which kills integrators. We approximate it with a continuous function. This constant [rad/s] is the scaling factor on that function – very approximately the rad/s at which half of the full frictional force is applied. This number is nonphysical; make it small but not so small that the simulation vibrates or explodes.
-
spring_constant
¶ k_ts torsional spring constant measured toward the spring zero angle [Nm/rad]. It should be non-negative.
-
spring_zero_angle_rad
¶ qs₀ measured outward from the closed position [radian].
-
static_friction_torque
¶ k_sf maximum static friction measured opposite direction of motion [Nm]. It should be non-negative.
-
viscous_friction
¶ k_vf viscous friction measured opposite direction of motion [Nm]. It should be non-negative.
-
-
pydrake.multibody.tree.
FixedOffsetFrame
¶
-
template
pydrake.multibody.tree.
FixedOffsetFrame_
¶ Instantiations:
FixedOffsetFrame_[float]
,FixedOffsetFrame_[AutoDiffXd]
,FixedOffsetFrame_[Expression]
-
class
FixedOffsetFrame_[float]
¶ Bases:
pydrake.multibody.tree.Frame_[float]
%FixedOffsetFrame represents a material frame F whose pose is fixed with respect to a parent material frame P. The pose offset is given by a spatial transform
X_PF
, which is constant after construction. For instance, we could rigidly attach a frame F to move with a rigid body B at a fixed poseX_BF
, where B is the BodyFrame associated with body B. Thus, the World frame poseX_WF
of a FixedOffsetFrame F depends only on the World frame poseX_WP
of its parent P, and the constant poseX_PF
, withX_WF=X_WP*X_PF
.For more information about spatial transforms, see multibody_spatial_pose.
-
__init__
(*args, **kwargs)¶ Overloaded function.
- __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[float], name: str, P: pydrake.multibody.tree.Frame_[float], X_PF: pydrake.math.RigidTransform_[float], model_instance: Optional[pydrake.multibody.tree.ModelInstanceIndex] = None) -> None
Creates a material Frame F whose pose is fixed with respect to its parent material Frame P. The pose is given by a spatial transform
X_PF
; see class documentation for more information.- Parameter
name
: - The name of this frame.
- Parameter
P
: - The frame to which this frame is attached with a fixed pose.
- Parameter
X_PF
: - The default transform giving the pose of F in P, therefore only the value (as a RigidTransform<double>) is provided.
- Parameter
model_instance
: - The model instance to which this frame belongs to. If unspecified, will use P.body().model_instance().
- __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[float], name: str, P: pydrake.multibody.tree.Frame_[float], X_PF: pydrake.common.eigen_geometry.Isometry3_[float], model_instance: Optional[pydrake.multibody.tree.ModelInstanceIndex] = None) -> None
This API using Isometry3 is / will be deprecated soon with the resolution of #9865. We only offer it for backwards compatibility. DO NOT USE!.
-
-
class
-
class
pydrake.multibody.tree.
FixedOffsetFrame_[AutoDiffXd]
¶ Bases:
pydrake.multibody.tree.Frame_[AutoDiffXd]
%FixedOffsetFrame represents a material frame F whose pose is fixed with respect to a parent material frame P. The pose offset is given by a spatial transform
X_PF
, which is constant after construction. For instance, we could rigidly attach a frame F to move with a rigid body B at a fixed poseX_BF
, where B is the BodyFrame associated with body B. Thus, the World frame poseX_WF
of a FixedOffsetFrame F depends only on the World frame poseX_WP
of its parent P, and the constant poseX_PF
, withX_WF=X_WP*X_PF
.For more information about spatial transforms, see multibody_spatial_pose.
-
__init__
(*args, **kwargs)¶ Overloaded function.
- __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[AutoDiffXd], name: str, P: pydrake.multibody.tree.Frame_[AutoDiffXd], X_PF: pydrake.math.RigidTransform_[float], model_instance: Optional[pydrake.multibody.tree.ModelInstanceIndex] = None) -> None
Creates a material Frame F whose pose is fixed with respect to its parent material Frame P. The pose is given by a spatial transform
X_PF
; see class documentation for more information.- Parameter
name
: - The name of this frame.
- Parameter
P
: - The frame to which this frame is attached with a fixed pose.
- Parameter
X_PF
: - The default transform giving the pose of F in P, therefore only the value (as a RigidTransform<double>) is provided.
- Parameter
model_instance
: - The model instance to which this frame belongs to. If unspecified, will use P.body().model_instance().
- __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[AutoDiffXd], name: str, P: pydrake.multibody.tree.Frame_[AutoDiffXd], X_PF: pydrake.common.eigen_geometry.Isometry3_[float], model_instance: Optional[pydrake.multibody.tree.ModelInstanceIndex] = None) -> None
This API using Isometry3 is / will be deprecated soon with the resolution of #9865. We only offer it for backwards compatibility. DO NOT USE!.
-
-
class
pydrake.multibody.tree.
FixedOffsetFrame_[Expression]
¶ Bases:
pydrake.multibody.tree.Frame_[Expression]
%FixedOffsetFrame represents a material frame F whose pose is fixed with respect to a parent material frame P. The pose offset is given by a spatial transform
X_PF
, which is constant after construction. For instance, we could rigidly attach a frame F to move with a rigid body B at a fixed poseX_BF
, where B is the BodyFrame associated with body B. Thus, the World frame poseX_WF
of a FixedOffsetFrame F depends only on the World frame poseX_WP
of its parent P, and the constant poseX_PF
, withX_WF=X_WP*X_PF
.For more information about spatial transforms, see multibody_spatial_pose.
-
__init__
(*args, **kwargs)¶ Overloaded function.
- __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[Expression], name: str, P: pydrake.multibody.tree.Frame_[Expression], X_PF: pydrake.math.RigidTransform_[float], model_instance: Optional[pydrake.multibody.tree.ModelInstanceIndex] = None) -> None
Creates a material Frame F whose pose is fixed with respect to its parent material Frame P. The pose is given by a spatial transform
X_PF
; see class documentation for more information.- Parameter
name
: - The name of this frame.
- Parameter
P
: - The frame to which this frame is attached with a fixed pose.
- Parameter
X_PF
: - The default transform giving the pose of F in P, therefore only the value (as a RigidTransform<double>) is provided.
- Parameter
model_instance
: - The model instance to which this frame belongs to. If unspecified, will use P.body().model_instance().
- __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[Expression], name: str, P: pydrake.multibody.tree.Frame_[Expression], X_PF: pydrake.common.eigen_geometry.Isometry3_[float], model_instance: Optional[pydrake.multibody.tree.ModelInstanceIndex] = None) -> None
This API using Isometry3 is / will be deprecated soon with the resolution of #9865. We only offer it for backwards compatibility. DO NOT USE!.
-
-
class
pydrake.multibody.tree.
FixedOffsetFrame_[float]
¶ Bases:
pydrake.multibody.tree.Frame_[float]
%FixedOffsetFrame represents a material frame F whose pose is fixed with respect to a parent material frame P. The pose offset is given by a spatial transform
X_PF
, which is constant after construction. For instance, we could rigidly attach a frame F to move with a rigid body B at a fixed poseX_BF
, where B is the BodyFrame associated with body B. Thus, the World frame poseX_WF
of a FixedOffsetFrame F depends only on the World frame poseX_WP
of its parent P, and the constant poseX_PF
, withX_WF=X_WP*X_PF
.For more information about spatial transforms, see multibody_spatial_pose.
-
__init__
(*args, **kwargs)¶ Overloaded function.
- __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[float], name: str, P: pydrake.multibody.tree.Frame_[float], X_PF: pydrake.math.RigidTransform_[float], model_instance: Optional[pydrake.multibody.tree.ModelInstanceIndex] = None) -> None
Creates a material Frame F whose pose is fixed with respect to its parent material Frame P. The pose is given by a spatial transform
X_PF
; see class documentation for more information.- Parameter
name
: - The name of this frame.
- Parameter
P
: - The frame to which this frame is attached with a fixed pose.
- Parameter
X_PF
: - The default transform giving the pose of F in P, therefore only the value (as a RigidTransform<double>) is provided.
- Parameter
model_instance
: - The model instance to which this frame belongs to. If unspecified, will use P.body().model_instance().
- __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[float], name: str, P: pydrake.multibody.tree.Frame_[float], X_PF: pydrake.common.eigen_geometry.Isometry3_[float], model_instance: Optional[pydrake.multibody.tree.ModelInstanceIndex] = None) -> None
This API using Isometry3 is / will be deprecated soon with the resolution of #9865. We only offer it for backwards compatibility. DO NOT USE!.
-
-
pydrake.multibody.tree.
ForceElement
¶
-
template
pydrake.multibody.tree.
ForceElement_
¶ Instantiations:
ForceElement_[float]
,ForceElement_[AutoDiffXd]
,ForceElement_[Expression]
-
class
ForceElement_[float]
¶ A ForceElement allows modeling state and time dependent forces in a MultibodyTree model. Examples of such forces are springs, dampers, drag and gravity. Forces that depend on accelerations such as virtual mass cannot be modeled with a ForceElement. This abstract class provides an API that all force elements subclasses must implement in order to be fully defined. These are:
- CalcAndAddForceContribution(): computes the force contribution of a force element in a MultibodyTree model.
- CalcPotentialEnergy(): computes a force element potential energy contribution.
- CalcConservativePower(): computes the power generated by conservative forces.
- CalcNonConservativePower(): computes the power dissipated by non-conservative forces.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
index
(self: pydrake.multibody.tree.ForceElement_[float]) → pydrake.multibody.tree.ForceElementIndex¶
-
model_instance
(self: pydrake.multibody.tree.ForceElement_[float]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
class
-
class
pydrake.multibody.tree.
ForceElement_[AutoDiffXd]
¶ A ForceElement allows modeling state and time dependent forces in a MultibodyTree model. Examples of such forces are springs, dampers, drag and gravity. Forces that depend on accelerations such as virtual mass cannot be modeled with a ForceElement. This abstract class provides an API that all force elements subclasses must implement in order to be fully defined. These are:
- CalcAndAddForceContribution(): computes the force contribution of a force element in a MultibodyTree model.
- CalcPotentialEnergy(): computes a force element potential energy contribution.
- CalcConservativePower(): computes the power generated by conservative forces.
- CalcNonConservativePower(): computes the power dissipated by non-conservative forces.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
index
(self: pydrake.multibody.tree.ForceElement_[AutoDiffXd]) → pydrake.multibody.tree.ForceElementIndex¶
-
model_instance
(self: pydrake.multibody.tree.ForceElement_[AutoDiffXd]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
class
pydrake.multibody.tree.
ForceElement_[Expression]
¶ A ForceElement allows modeling state and time dependent forces in a MultibodyTree model. Examples of such forces are springs, dampers, drag and gravity. Forces that depend on accelerations such as virtual mass cannot be modeled with a ForceElement. This abstract class provides an API that all force elements subclasses must implement in order to be fully defined. These are:
- CalcAndAddForceContribution(): computes the force contribution of a force element in a MultibodyTree model.
- CalcPotentialEnergy(): computes a force element potential energy contribution.
- CalcConservativePower(): computes the power generated by conservative forces.
- CalcNonConservativePower(): computes the power dissipated by non-conservative forces.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
index
(self: pydrake.multibody.tree.ForceElement_[Expression]) → pydrake.multibody.tree.ForceElementIndex¶
-
model_instance
(self: pydrake.multibody.tree.ForceElement_[Expression]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
class
pydrake.multibody.tree.
ForceElement_[float]
¶ A ForceElement allows modeling state and time dependent forces in a MultibodyTree model. Examples of such forces are springs, dampers, drag and gravity. Forces that depend on accelerations such as virtual mass cannot be modeled with a ForceElement. This abstract class provides an API that all force elements subclasses must implement in order to be fully defined. These are:
- CalcAndAddForceContribution(): computes the force contribution of a force element in a MultibodyTree model.
- CalcPotentialEnergy(): computes a force element potential energy contribution.
- CalcConservativePower(): computes the power generated by conservative forces.
- CalcNonConservativePower(): computes the power dissipated by non-conservative forces.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
index
(self: pydrake.multibody.tree.ForceElement_[float]) → pydrake.multibody.tree.ForceElementIndex¶
-
model_instance
(self: pydrake.multibody.tree.ForceElement_[float]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
class
pydrake.multibody.tree.
ForceElementIndex
¶ Type used to identify force elements by index within a multibody tree system.
-
__init__
(self: pydrake.multibody.tree.ForceElementIndex, arg0: int) → None¶ Default constructor; the result is an invalid index. This only exists to serve applications which require a default constructor.
-
is_valid
(self: pydrake.multibody.tree.ForceElementIndex) → bool¶ Reports if the index is valid–the only operation on an invalid index that doesn’t throw an exception in Debug builds.
-
-
pydrake.multibody.tree.
Frame
¶ alias of
pydrake.multibody.tree.Frame_[float]
-
template
pydrake.multibody.tree.
Frame_
¶ Instantiations:
Frame_[float]
,Frame_[AutoDiffXd]
,Frame_[Expression]
-
class
Frame_[float]
¶ %Frame is an abstract class representing a material frame (also called a physical frame), meaning that it is associated with a material point of a Body. A material frame can be used to apply forces and torques to a multibody system, and can be used as an attachment point for force-producing elements like joints, actuators, and constraints. Despite its name, Frame is not the most general frame representation in Drake; see FrameBase for a more-general discussion.
The pose and motion of a Frame object is always calculated relative to the BodyFrame of the body with which it is associated, and every Frame object can report which Body object that is. Concrete classes derived from Frame differ only in how those kinematic properties are calculated. For soft bodies that calculation may depend on the body’s deformation state variables. A Frame on a rigid body will usually have a fixed offset from its BodyFrame, but that is not required – a frame that moves with respect to its BodyFrame can still be a material frame on that rigid body.
As always in Drake, runtime numerical quantities are stored in a Context. A Frame object does not store runtime values, but provides methods for extracting frame-associated values (such as the Frame object’s kinematics) from a given Context.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
body
(self: pydrake.multibody.tree.Frame_[float]) → drake::multibody::Body<double>¶ Returns a const reference to the body associated to this Frame.
-
GetFixedPoseInBodyFrame
(self: pydrake.multibody.tree.Frame_[float]) → pydrake.math.RigidTransform_[float]¶ Variant of CalcPoseInBodyFrame() that returns the fixed pose
X_BF
ofthis
frame F in the body frame B associated with this frame.Raises: - RuntimeError if called on a Frame that does not have a fixed
- offset in the body frame.
-
index
(self: pydrake.multibody.tree.Frame_[float]) → pydrake.multibody.tree.FrameIndex¶
-
model_instance
(self: pydrake.multibody.tree.Frame_[float]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.Frame_[float]) → str¶ Returns the name of this frame. It may be empty if unnamed.
-
-
class
-
class
pydrake.multibody.tree.
Frame_[AutoDiffXd]
¶ %Frame is an abstract class representing a material frame (also called a physical frame), meaning that it is associated with a material point of a Body. A material frame can be used to apply forces and torques to a multibody system, and can be used as an attachment point for force-producing elements like joints, actuators, and constraints. Despite its name, Frame is not the most general frame representation in Drake; see FrameBase for a more-general discussion.
The pose and motion of a Frame object is always calculated relative to the BodyFrame of the body with which it is associated, and every Frame object can report which Body object that is. Concrete classes derived from Frame differ only in how those kinematic properties are calculated. For soft bodies that calculation may depend on the body’s deformation state variables. A Frame on a rigid body will usually have a fixed offset from its BodyFrame, but that is not required – a frame that moves with respect to its BodyFrame can still be a material frame on that rigid body.
As always in Drake, runtime numerical quantities are stored in a Context. A Frame object does not store runtime values, but provides methods for extracting frame-associated values (such as the Frame object’s kinematics) from a given Context.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
body
(self: pydrake.multibody.tree.Frame_[AutoDiffXd]) → drake::multibody::Body<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >¶ Returns a const reference to the body associated to this Frame.
-
GetFixedPoseInBodyFrame
(self: pydrake.multibody.tree.Frame_[AutoDiffXd]) → pydrake.math.RigidTransform_[AutoDiffXd]¶ Variant of CalcPoseInBodyFrame() that returns the fixed pose
X_BF
ofthis
frame F in the body frame B associated with this frame.Raises: - RuntimeError if called on a Frame that does not have a fixed
- offset in the body frame.
-
index
(self: pydrake.multibody.tree.Frame_[AutoDiffXd]) → pydrake.multibody.tree.FrameIndex¶
-
model_instance
(self: pydrake.multibody.tree.Frame_[AutoDiffXd]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.Frame_[AutoDiffXd]) → str¶ Returns the name of this frame. It may be empty if unnamed.
-
-
class
pydrake.multibody.tree.
Frame_[Expression]
¶ %Frame is an abstract class representing a material frame (also called a physical frame), meaning that it is associated with a material point of a Body. A material frame can be used to apply forces and torques to a multibody system, and can be used as an attachment point for force-producing elements like joints, actuators, and constraints. Despite its name, Frame is not the most general frame representation in Drake; see FrameBase for a more-general discussion.
The pose and motion of a Frame object is always calculated relative to the BodyFrame of the body with which it is associated, and every Frame object can report which Body object that is. Concrete classes derived from Frame differ only in how those kinematic properties are calculated. For soft bodies that calculation may depend on the body’s deformation state variables. A Frame on a rigid body will usually have a fixed offset from its BodyFrame, but that is not required – a frame that moves with respect to its BodyFrame can still be a material frame on that rigid body.
As always in Drake, runtime numerical quantities are stored in a Context. A Frame object does not store runtime values, but provides methods for extracting frame-associated values (such as the Frame object’s kinematics) from a given Context.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
body
(self: pydrake.multibody.tree.Frame_[Expression]) → drake::multibody::Body<drake::symbolic::Expression>¶ Returns a const reference to the body associated to this Frame.
-
GetFixedPoseInBodyFrame
(self: pydrake.multibody.tree.Frame_[Expression]) → pydrake.math.RigidTransform_[Expression]¶ Variant of CalcPoseInBodyFrame() that returns the fixed pose
X_BF
ofthis
frame F in the body frame B associated with this frame.Raises: - RuntimeError if called on a Frame that does not have a fixed
- offset in the body frame.
-
index
(self: pydrake.multibody.tree.Frame_[Expression]) → pydrake.multibody.tree.FrameIndex¶
-
model_instance
(self: pydrake.multibody.tree.Frame_[Expression]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.Frame_[Expression]) → str¶ Returns the name of this frame. It may be empty if unnamed.
-
-
class
pydrake.multibody.tree.
Frame_[float]
¶ %Frame is an abstract class representing a material frame (also called a physical frame), meaning that it is associated with a material point of a Body. A material frame can be used to apply forces and torques to a multibody system, and can be used as an attachment point for force-producing elements like joints, actuators, and constraints. Despite its name, Frame is not the most general frame representation in Drake; see FrameBase for a more-general discussion.
The pose and motion of a Frame object is always calculated relative to the BodyFrame of the body with which it is associated, and every Frame object can report which Body object that is. Concrete classes derived from Frame differ only in how those kinematic properties are calculated. For soft bodies that calculation may depend on the body’s deformation state variables. A Frame on a rigid body will usually have a fixed offset from its BodyFrame, but that is not required – a frame that moves with respect to its BodyFrame can still be a material frame on that rigid body.
As always in Drake, runtime numerical quantities are stored in a Context. A Frame object does not store runtime values, but provides methods for extracting frame-associated values (such as the Frame object’s kinematics) from a given Context.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
body
(self: pydrake.multibody.tree.Frame_[float]) → drake::multibody::Body<double>¶ Returns a const reference to the body associated to this Frame.
-
GetFixedPoseInBodyFrame
(self: pydrake.multibody.tree.Frame_[float]) → pydrake.math.RigidTransform_[float]¶ Variant of CalcPoseInBodyFrame() that returns the fixed pose
X_BF
ofthis
frame F in the body frame B associated with this frame.Raises: - RuntimeError if called on a Frame that does not have a fixed
- offset in the body frame.
-
index
(self: pydrake.multibody.tree.Frame_[float]) → pydrake.multibody.tree.FrameIndex¶
-
model_instance
(self: pydrake.multibody.tree.Frame_[float]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.Frame_[float]) → str¶ Returns the name of this frame. It may be empty if unnamed.
-
-
class
pydrake.multibody.tree.
FrameIndex
¶ Type used to identify frames by index in a multibody tree system.
-
__init__
(self: pydrake.multibody.tree.FrameIndex, arg0: int) → None¶ Default constructor; the result is an invalid index. This only exists to serve applications which require a default constructor.
-
is_valid
(self: pydrake.multibody.tree.FrameIndex) → bool¶ Reports if the index is valid–the only operation on an invalid index that doesn’t throw an exception in Debug builds.
-
-
class
pydrake.multibody.tree.
JacobianWrtVariable
¶ Enumeration that indicates whether the Jacobian is partial differentiation with respect to q̇ (time-derivatives of generalized positions) or with respect to v (generalized velocities).
Members:
kQDot : J = ∂V/∂q̇
kV : J = ∂V/∂v
-
__init__
(self: pydrake.multibody.tree.JacobianWrtVariable, arg0: int) → None¶
-
kQDot
= JacobianWrtVariable.kQDot¶
-
kV
= JacobianWrtVariable.kV¶
-
name
¶
-
-
pydrake.multibody.tree.
Joint
¶ alias of
pydrake.multibody.tree.Joint_[float]
-
template
pydrake.multibody.tree.
Joint_
¶ Instantiations:
Joint_[float]
,Joint_[AutoDiffXd]
,Joint_[Expression]
-
class
Joint_[float]
¶ A Joint models the kinematical relationship which characterizes the possible relative motion between two bodies. The two bodies connected by a Joint object are referred to as the parent and child bodies. Although the terms parent and child are sometimes used synonymously to describe the relationship between inboard and outboard bodies in multibody trees, the parent/child relationship is more general and remains meaningful for multibody systems with loops, such as a four-bar linkage. However, whenever possible the parent body will be made to be inboard and the child outboard in the tree. A Joint is a model of a physical kinematic constraint between two bodies, a constraint that in the real physical system does not specify a tree ordering.
In Drake we define a frame F rigidly attached to the parent body P with pose
X_PF
and a frame M rigidly attached to the child body B with poseX_BM
. A Joint object specifies a kinematic relation between frames F and M, which in turn imposes a kinematic relation between bodies P and B.Typical joints include the ball joint, to allow unrestricted rotations about a given point, the revolute joint, that constraints two bodies to rotate about a given common axis, etc.
Consider the following example to build a simple pendulum system:
MultibodyPlant<double> plant(0.0); // ... Code here to setup quantities below as mass, com, etc. ... const Body<double>& pendulum = plant.AddBody<RigidBody>(SpatialInertia<double>(mass, com, unit_inertia)); // We will connect the pendulum body to the world using a RevoluteJoint. // In this simple case the parent body P is the model's world body and frame // F IS the world frame. // Additionally, we need to specify the pose of frame M on the pendulum's // body frame B. // Say we declared and initialized X_BM... const RevoluteJoint<double>& elbow = plant.AddJoint<RevoluteJoint>( "Elbow", /* joint name plant.world_body(), /* parent body {}, /* frame F IS the world frame W pendulum, /* child body, the pendulum X_BM, /* pose of frame M in the body frame B Vector3d::UnitZ()); /* revolute axis in this case
Warning
Do not ever attempt to instantiate and manipulate Joint objects on the stack; it will fail. Add joints to your plant using the provided API MultibodyPlant::AddJoint() as in the example above.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
acceleration_lower_limits
(self: pydrake.multibody.tree.Joint_[float]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the acceleration lower limits.
-
acceleration_upper_limits
(self: pydrake.multibody.tree.Joint_[float]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the acceleration upper limits.
-
child_body
(self: pydrake.multibody.tree.Joint_[float]) → pydrake.multibody.tree.Body_[float]¶ Returns a const reference to the child body B.
-
default_positions
(self: pydrake.multibody.tree.Joint_[float]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the default positions.
-
frame_on_child
(self: pydrake.multibody.tree.Joint_[float]) → pydrake.multibody.tree.Frame_[float]¶ Returns a const reference to the frame M attached on the child body B.
-
frame_on_parent
(self: pydrake.multibody.tree.Joint_[float]) → pydrake.multibody.tree.Frame_[float]¶ Returns a const reference to the frame F attached on the parent body P.
-
index
(self: pydrake.multibody.tree.Joint_[float]) → pydrake.multibody.tree.JointIndex¶
-
model_instance
(self: pydrake.multibody.tree.Joint_[float]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.Joint_[float]) → str¶ Returns the name of this joint.
-
num_positions
(self: pydrake.multibody.tree.Joint_[float]) → int¶ Returns the number of generalized positions describing this joint.
-
num_velocities
(self: pydrake.multibody.tree.Joint_[float]) → int¶ Returns the number of generalized velocities describing this joint.
-
parent_body
(self: pydrake.multibody.tree.Joint_[float]) → pydrake.multibody.tree.Body_[float]¶ Returns a const reference to the parent body P.
-
position_lower_limits
(self: pydrake.multibody.tree.Joint_[float]) → numpy.ndarray[numpy.float64[m, 1]]¶ @name Methods to get and set the limits of
this
joint. For position limits, the layout is the same as the generalized position’s. For velocity and acceleration limits, the layout is the same as the generalized velocity’s. A limit with value +/- ∞ implies no upper or lower limit. Returns the position lower limits.
-
position_start
(self: pydrake.multibody.tree.Joint_[float]) → int¶ Returns the index to the first generalized position for this joint within the vector q of generalized positions for the full multibody system.
-
position_upper_limits
(self: pydrake.multibody.tree.Joint_[float]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the position upper limits.
-
set_acceleration_limits
(self: pydrake.multibody.tree.Joint_[float], lower_limits: numpy.ndarray[numpy.float64[m, 1]], upper_limits: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the acceleration limits to
lower_limits
andupper_limits
.Raises: - RuntimeError if the dimension of
lower_limits
or upper_limits
does not match num_velocities().
Raises: - RuntimeError if any of
lower_limits
is larger than the - corresponding term in
upper_limits
.
- RuntimeError if the dimension of
-
set_default_positions
(self: pydrake.multibody.tree.Joint_[float], default_positions: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the default positions to
default_positions
. Joint subclasses are expected to implement the do_set_default_positions().Raises: - RuntimeError if the dimension of
default_positions
does not - match num_positions().
Note
The values in
default_positions
are NOT constrained to be withinposition_lower_limits()
andposition_upper_limits()
.- RuntimeError if the dimension of
-
set_position_limits
(self: pydrake.multibody.tree.Joint_[float], lower_limits: numpy.ndarray[numpy.float64[m, 1]], upper_limits: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the position limits to
lower_limits
andupper_limits
.Raises: - RuntimeError if the dimension of
lower_limits
or upper_limits
does not match num_positions().
Raises: - RuntimeError if any of
lower_limits
is larger than the - corresponding term in
upper_limits
.
Note
Setting the position limits does not affect the
default_positions()
, regardless of whether the currentdefault_positions()
satisfy the new position limits.- RuntimeError if the dimension of
-
set_velocity_limits
(self: pydrake.multibody.tree.Joint_[float], lower_limits: numpy.ndarray[numpy.float64[m, 1]], upper_limits: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the velocity limits to
lower_limits
andupper_limits
.Raises: - RuntimeError if the dimension of
lower_limits
or upper_limits
does not match num_velocities().
Raises: - RuntimeError if any of
lower_limits
is larger than the - corresponding term in
upper_limits
.
- RuntimeError if the dimension of
-
velocity_lower_limits
(self: pydrake.multibody.tree.Joint_[float]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the velocity lower limits.
-
velocity_start
(self: pydrake.multibody.tree.Joint_[float]) → int¶ Returns the index to the first generalized velocity for this joint within the vector v of generalized velocities for the full multibody system.
-
velocity_upper_limits
(self: pydrake.multibody.tree.Joint_[float]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the velocity upper limits.
-
-
class
-
class
pydrake.multibody.tree.
Joint_[AutoDiffXd]
¶ A Joint models the kinematical relationship which characterizes the possible relative motion between two bodies. The two bodies connected by a Joint object are referred to as the parent and child bodies. Although the terms parent and child are sometimes used synonymously to describe the relationship between inboard and outboard bodies in multibody trees, the parent/child relationship is more general and remains meaningful for multibody systems with loops, such as a four-bar linkage. However, whenever possible the parent body will be made to be inboard and the child outboard in the tree. A Joint is a model of a physical kinematic constraint between two bodies, a constraint that in the real physical system does not specify a tree ordering.
In Drake we define a frame F rigidly attached to the parent body P with pose
X_PF
and a frame M rigidly attached to the child body B with poseX_BM
. A Joint object specifies a kinematic relation between frames F and M, which in turn imposes a kinematic relation between bodies P and B.Typical joints include the ball joint, to allow unrestricted rotations about a given point, the revolute joint, that constraints two bodies to rotate about a given common axis, etc.
Consider the following example to build a simple pendulum system:
MultibodyPlant<double> plant(0.0); // ... Code here to setup quantities below as mass, com, etc. ... const Body<double>& pendulum = plant.AddBody<RigidBody>(SpatialInertia<double>(mass, com, unit_inertia)); // We will connect the pendulum body to the world using a RevoluteJoint. // In this simple case the parent body P is the model's world body and frame // F IS the world frame. // Additionally, we need to specify the pose of frame M on the pendulum's // body frame B. // Say we declared and initialized X_BM... const RevoluteJoint<double>& elbow = plant.AddJoint<RevoluteJoint>( "Elbow", /* joint name plant.world_body(), /* parent body {}, /* frame F IS the world frame W pendulum, /* child body, the pendulum X_BM, /* pose of frame M in the body frame B Vector3d::UnitZ()); /* revolute axis in this case
Warning
Do not ever attempt to instantiate and manipulate Joint objects on the stack; it will fail. Add joints to your plant using the provided API MultibodyPlant::AddJoint() as in the example above.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
acceleration_lower_limits
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the acceleration lower limits.
-
acceleration_upper_limits
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the acceleration upper limits.
-
child_body
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → pydrake.multibody.tree.Body_[AutoDiffXd]¶ Returns a const reference to the child body B.
-
default_positions
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the default positions.
-
frame_on_child
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → pydrake.multibody.tree.Frame_[AutoDiffXd]¶ Returns a const reference to the frame M attached on the child body B.
-
frame_on_parent
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → pydrake.multibody.tree.Frame_[AutoDiffXd]¶ Returns a const reference to the frame F attached on the parent body P.
-
index
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → pydrake.multibody.tree.JointIndex¶
-
model_instance
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → str¶ Returns the name of this joint.
-
num_positions
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → int¶ Returns the number of generalized positions describing this joint.
-
num_velocities
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → int¶ Returns the number of generalized velocities describing this joint.
-
parent_body
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → pydrake.multibody.tree.Body_[AutoDiffXd]¶ Returns a const reference to the parent body P.
-
position_lower_limits
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → numpy.ndarray[numpy.float64[m, 1]]¶ @name Methods to get and set the limits of
this
joint. For position limits, the layout is the same as the generalized position’s. For velocity and acceleration limits, the layout is the same as the generalized velocity’s. A limit with value +/- ∞ implies no upper or lower limit. Returns the position lower limits.
-
position_start
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → int¶ Returns the index to the first generalized position for this joint within the vector q of generalized positions for the full multibody system.
-
position_upper_limits
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the position upper limits.
-
set_acceleration_limits
(self: pydrake.multibody.tree.Joint_[AutoDiffXd], lower_limits: numpy.ndarray[numpy.float64[m, 1]], upper_limits: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the acceleration limits to
lower_limits
andupper_limits
.Raises: - RuntimeError if the dimension of
lower_limits
or upper_limits
does not match num_velocities().
Raises: - RuntimeError if any of
lower_limits
is larger than the - corresponding term in
upper_limits
.
- RuntimeError if the dimension of
-
set_default_positions
(self: pydrake.multibody.tree.Joint_[AutoDiffXd], default_positions: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the default positions to
default_positions
. Joint subclasses are expected to implement the do_set_default_positions().Raises: - RuntimeError if the dimension of
default_positions
does not - match num_positions().
Note
The values in
default_positions
are NOT constrained to be withinposition_lower_limits()
andposition_upper_limits()
.- RuntimeError if the dimension of
-
set_position_limits
(self: pydrake.multibody.tree.Joint_[AutoDiffXd], lower_limits: numpy.ndarray[numpy.float64[m, 1]], upper_limits: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the position limits to
lower_limits
andupper_limits
.Raises: - RuntimeError if the dimension of
lower_limits
or upper_limits
does not match num_positions().
Raises: - RuntimeError if any of
lower_limits
is larger than the - corresponding term in
upper_limits
.
Note
Setting the position limits does not affect the
default_positions()
, regardless of whether the currentdefault_positions()
satisfy the new position limits.- RuntimeError if the dimension of
-
set_velocity_limits
(self: pydrake.multibody.tree.Joint_[AutoDiffXd], lower_limits: numpy.ndarray[numpy.float64[m, 1]], upper_limits: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the velocity limits to
lower_limits
andupper_limits
.Raises: - RuntimeError if the dimension of
lower_limits
or upper_limits
does not match num_velocities().
Raises: - RuntimeError if any of
lower_limits
is larger than the - corresponding term in
upper_limits
.
- RuntimeError if the dimension of
-
velocity_lower_limits
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the velocity lower limits.
-
velocity_start
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → int¶ Returns the index to the first generalized velocity for this joint within the vector v of generalized velocities for the full multibody system.
-
velocity_upper_limits
(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the velocity upper limits.
-
-
class
pydrake.multibody.tree.
Joint_[Expression]
¶ A Joint models the kinematical relationship which characterizes the possible relative motion between two bodies. The two bodies connected by a Joint object are referred to as the parent and child bodies. Although the terms parent and child are sometimes used synonymously to describe the relationship between inboard and outboard bodies in multibody trees, the parent/child relationship is more general and remains meaningful for multibody systems with loops, such as a four-bar linkage. However, whenever possible the parent body will be made to be inboard and the child outboard in the tree. A Joint is a model of a physical kinematic constraint between two bodies, a constraint that in the real physical system does not specify a tree ordering.
In Drake we define a frame F rigidly attached to the parent body P with pose
X_PF
and a frame M rigidly attached to the child body B with poseX_BM
. A Joint object specifies a kinematic relation between frames F and M, which in turn imposes a kinematic relation between bodies P and B.Typical joints include the ball joint, to allow unrestricted rotations about a given point, the revolute joint, that constraints two bodies to rotate about a given common axis, etc.
Consider the following example to build a simple pendulum system:
MultibodyPlant<double> plant(0.0); // ... Code here to setup quantities below as mass, com, etc. ... const Body<double>& pendulum = plant.AddBody<RigidBody>(SpatialInertia<double>(mass, com, unit_inertia)); // We will connect the pendulum body to the world using a RevoluteJoint. // In this simple case the parent body P is the model's world body and frame // F IS the world frame. // Additionally, we need to specify the pose of frame M on the pendulum's // body frame B. // Say we declared and initialized X_BM... const RevoluteJoint<double>& elbow = plant.AddJoint<RevoluteJoint>( "Elbow", /* joint name plant.world_body(), /* parent body {}, /* frame F IS the world frame W pendulum, /* child body, the pendulum X_BM, /* pose of frame M in the body frame B Vector3d::UnitZ()); /* revolute axis in this case
Warning
Do not ever attempt to instantiate and manipulate Joint objects on the stack; it will fail. Add joints to your plant using the provided API MultibodyPlant::AddJoint() as in the example above.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
acceleration_lower_limits
(self: pydrake.multibody.tree.Joint_[Expression]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the acceleration lower limits.
-
acceleration_upper_limits
(self: pydrake.multibody.tree.Joint_[Expression]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the acceleration upper limits.
-
child_body
(self: pydrake.multibody.tree.Joint_[Expression]) → pydrake.multibody.tree.Body_[Expression]¶ Returns a const reference to the child body B.
-
default_positions
(self: pydrake.multibody.tree.Joint_[Expression]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the default positions.
-
frame_on_child
(self: pydrake.multibody.tree.Joint_[Expression]) → pydrake.multibody.tree.Frame_[Expression]¶ Returns a const reference to the frame M attached on the child body B.
-
frame_on_parent
(self: pydrake.multibody.tree.Joint_[Expression]) → pydrake.multibody.tree.Frame_[Expression]¶ Returns a const reference to the frame F attached on the parent body P.
-
index
(self: pydrake.multibody.tree.Joint_[Expression]) → pydrake.multibody.tree.JointIndex¶
-
model_instance
(self: pydrake.multibody.tree.Joint_[Expression]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.Joint_[Expression]) → str¶ Returns the name of this joint.
-
num_positions
(self: pydrake.multibody.tree.Joint_[Expression]) → int¶ Returns the number of generalized positions describing this joint.
-
num_velocities
(self: pydrake.multibody.tree.Joint_[Expression]) → int¶ Returns the number of generalized velocities describing this joint.
-
parent_body
(self: pydrake.multibody.tree.Joint_[Expression]) → pydrake.multibody.tree.Body_[Expression]¶ Returns a const reference to the parent body P.
-
position_lower_limits
(self: pydrake.multibody.tree.Joint_[Expression]) → numpy.ndarray[numpy.float64[m, 1]]¶ @name Methods to get and set the limits of
this
joint. For position limits, the layout is the same as the generalized position’s. For velocity and acceleration limits, the layout is the same as the generalized velocity’s. A limit with value +/- ∞ implies no upper or lower limit. Returns the position lower limits.
-
position_start
(self: pydrake.multibody.tree.Joint_[Expression]) → int¶ Returns the index to the first generalized position for this joint within the vector q of generalized positions for the full multibody system.
-
position_upper_limits
(self: pydrake.multibody.tree.Joint_[Expression]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the position upper limits.
-
set_acceleration_limits
(self: pydrake.multibody.tree.Joint_[Expression], lower_limits: numpy.ndarray[numpy.float64[m, 1]], upper_limits: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the acceleration limits to
lower_limits
andupper_limits
.Raises: - RuntimeError if the dimension of
lower_limits
or upper_limits
does not match num_velocities().
Raises: - RuntimeError if any of
lower_limits
is larger than the - corresponding term in
upper_limits
.
- RuntimeError if the dimension of
-
set_default_positions
(self: pydrake.multibody.tree.Joint_[Expression], default_positions: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the default positions to
default_positions
. Joint subclasses are expected to implement the do_set_default_positions().Raises: - RuntimeError if the dimension of
default_positions
does not - match num_positions().
Note
The values in
default_positions
are NOT constrained to be withinposition_lower_limits()
andposition_upper_limits()
.- RuntimeError if the dimension of
-
set_position_limits
(self: pydrake.multibody.tree.Joint_[Expression], lower_limits: numpy.ndarray[numpy.float64[m, 1]], upper_limits: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the position limits to
lower_limits
andupper_limits
.Raises: - RuntimeError if the dimension of
lower_limits
or upper_limits
does not match num_positions().
Raises: - RuntimeError if any of
lower_limits
is larger than the - corresponding term in
upper_limits
.
Note
Setting the position limits does not affect the
default_positions()
, regardless of whether the currentdefault_positions()
satisfy the new position limits.- RuntimeError if the dimension of
-
set_velocity_limits
(self: pydrake.multibody.tree.Joint_[Expression], lower_limits: numpy.ndarray[numpy.float64[m, 1]], upper_limits: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the velocity limits to
lower_limits
andupper_limits
.Raises: - RuntimeError if the dimension of
lower_limits
or upper_limits
does not match num_velocities().
Raises: - RuntimeError if any of
lower_limits
is larger than the - corresponding term in
upper_limits
.
- RuntimeError if the dimension of
-
velocity_lower_limits
(self: pydrake.multibody.tree.Joint_[Expression]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the velocity lower limits.
-
velocity_start
(self: pydrake.multibody.tree.Joint_[Expression]) → int¶ Returns the index to the first generalized velocity for this joint within the vector v of generalized velocities for the full multibody system.
-
velocity_upper_limits
(self: pydrake.multibody.tree.Joint_[Expression]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the velocity upper limits.
-
-
class
pydrake.multibody.tree.
Joint_[float]
¶ A Joint models the kinematical relationship which characterizes the possible relative motion between two bodies. The two bodies connected by a Joint object are referred to as the parent and child bodies. Although the terms parent and child are sometimes used synonymously to describe the relationship between inboard and outboard bodies in multibody trees, the parent/child relationship is more general and remains meaningful for multibody systems with loops, such as a four-bar linkage. However, whenever possible the parent body will be made to be inboard and the child outboard in the tree. A Joint is a model of a physical kinematic constraint between two bodies, a constraint that in the real physical system does not specify a tree ordering.
In Drake we define a frame F rigidly attached to the parent body P with pose
X_PF
and a frame M rigidly attached to the child body B with poseX_BM
. A Joint object specifies a kinematic relation between frames F and M, which in turn imposes a kinematic relation between bodies P and B.Typical joints include the ball joint, to allow unrestricted rotations about a given point, the revolute joint, that constraints two bodies to rotate about a given common axis, etc.
Consider the following example to build a simple pendulum system:
MultibodyPlant<double> plant(0.0); // ... Code here to setup quantities below as mass, com, etc. ... const Body<double>& pendulum = plant.AddBody<RigidBody>(SpatialInertia<double>(mass, com, unit_inertia)); // We will connect the pendulum body to the world using a RevoluteJoint. // In this simple case the parent body P is the model's world body and frame // F IS the world frame. // Additionally, we need to specify the pose of frame M on the pendulum's // body frame B. // Say we declared and initialized X_BM... const RevoluteJoint<double>& elbow = plant.AddJoint<RevoluteJoint>( "Elbow", /* joint name plant.world_body(), /* parent body {}, /* frame F IS the world frame W pendulum, /* child body, the pendulum X_BM, /* pose of frame M in the body frame B Vector3d::UnitZ()); /* revolute axis in this case
Warning
Do not ever attempt to instantiate and manipulate Joint objects on the stack; it will fail. Add joints to your plant using the provided API MultibodyPlant::AddJoint() as in the example above.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
acceleration_lower_limits
(self: pydrake.multibody.tree.Joint_[float]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the acceleration lower limits.
-
acceleration_upper_limits
(self: pydrake.multibody.tree.Joint_[float]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the acceleration upper limits.
-
child_body
(self: pydrake.multibody.tree.Joint_[float]) → pydrake.multibody.tree.Body_[float]¶ Returns a const reference to the child body B.
-
default_positions
(self: pydrake.multibody.tree.Joint_[float]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the default positions.
-
frame_on_child
(self: pydrake.multibody.tree.Joint_[float]) → pydrake.multibody.tree.Frame_[float]¶ Returns a const reference to the frame M attached on the child body B.
-
frame_on_parent
(self: pydrake.multibody.tree.Joint_[float]) → pydrake.multibody.tree.Frame_[float]¶ Returns a const reference to the frame F attached on the parent body P.
-
index
(self: pydrake.multibody.tree.Joint_[float]) → pydrake.multibody.tree.JointIndex¶
-
model_instance
(self: pydrake.multibody.tree.Joint_[float]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.Joint_[float]) → str¶ Returns the name of this joint.
-
num_positions
(self: pydrake.multibody.tree.Joint_[float]) → int¶ Returns the number of generalized positions describing this joint.
-
num_velocities
(self: pydrake.multibody.tree.Joint_[float]) → int¶ Returns the number of generalized velocities describing this joint.
-
parent_body
(self: pydrake.multibody.tree.Joint_[float]) → pydrake.multibody.tree.Body_[float]¶ Returns a const reference to the parent body P.
-
position_lower_limits
(self: pydrake.multibody.tree.Joint_[float]) → numpy.ndarray[numpy.float64[m, 1]]¶ @name Methods to get and set the limits of
this
joint. For position limits, the layout is the same as the generalized position’s. For velocity and acceleration limits, the layout is the same as the generalized velocity’s. A limit with value +/- ∞ implies no upper or lower limit. Returns the position lower limits.
-
position_start
(self: pydrake.multibody.tree.Joint_[float]) → int¶ Returns the index to the first generalized position for this joint within the vector q of generalized positions for the full multibody system.
-
position_upper_limits
(self: pydrake.multibody.tree.Joint_[float]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the position upper limits.
-
set_acceleration_limits
(self: pydrake.multibody.tree.Joint_[float], lower_limits: numpy.ndarray[numpy.float64[m, 1]], upper_limits: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the acceleration limits to
lower_limits
andupper_limits
.Raises: - RuntimeError if the dimension of
lower_limits
or upper_limits
does not match num_velocities().
Raises: - RuntimeError if any of
lower_limits
is larger than the - corresponding term in
upper_limits
.
- RuntimeError if the dimension of
-
set_default_positions
(self: pydrake.multibody.tree.Joint_[float], default_positions: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the default positions to
default_positions
. Joint subclasses are expected to implement the do_set_default_positions().Raises: - RuntimeError if the dimension of
default_positions
does not - match num_positions().
Note
The values in
default_positions
are NOT constrained to be withinposition_lower_limits()
andposition_upper_limits()
.- RuntimeError if the dimension of
-
set_position_limits
(self: pydrake.multibody.tree.Joint_[float], lower_limits: numpy.ndarray[numpy.float64[m, 1]], upper_limits: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the position limits to
lower_limits
andupper_limits
.Raises: - RuntimeError if the dimension of
lower_limits
or upper_limits
does not match num_positions().
Raises: - RuntimeError if any of
lower_limits
is larger than the - corresponding term in
upper_limits
.
Note
Setting the position limits does not affect the
default_positions()
, regardless of whether the currentdefault_positions()
satisfy the new position limits.- RuntimeError if the dimension of
-
set_velocity_limits
(self: pydrake.multibody.tree.Joint_[float], lower_limits: numpy.ndarray[numpy.float64[m, 1]], upper_limits: numpy.ndarray[numpy.float64[m, 1]]) → None¶ Sets the velocity limits to
lower_limits
andupper_limits
.Raises: - RuntimeError if the dimension of
lower_limits
or upper_limits
does not match num_velocities().
Raises: - RuntimeError if any of
lower_limits
is larger than the - corresponding term in
upper_limits
.
- RuntimeError if the dimension of
-
velocity_lower_limits
(self: pydrake.multibody.tree.Joint_[float]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the velocity lower limits.
-
velocity_start
(self: pydrake.multibody.tree.Joint_[float]) → int¶ Returns the index to the first generalized velocity for this joint within the vector v of generalized velocities for the full multibody system.
-
velocity_upper_limits
(self: pydrake.multibody.tree.Joint_[float]) → numpy.ndarray[numpy.float64[m, 1]]¶ Returns the velocity upper limits.
-
-
pydrake.multibody.tree.
JointActuator
¶
-
template
pydrake.multibody.tree.
JointActuator_
¶ Instantiations:
JointActuator_[float]
,JointActuator_[AutoDiffXd]
,JointActuator_[Expression]
-
class
JointActuator_[float]
¶ The JointActuator class is mostly a simple bookkeeping structure to represent an actuator acting on a given Joint. It helps to flag whether a given Joint is actuated or not so that MultibodyTree clients can apply forces on actuated joints through their actuators, see AddInOneForce().
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
effort_limit
(self: pydrake.multibody.tree.JointActuator_[float]) → float¶ Returns the actuator effort limit.
-
index
(self: pydrake.multibody.tree.JointActuator_[float]) → pydrake.multibody.tree.JointActuatorIndex¶
-
joint
(self: pydrake.multibody.tree.JointActuator_[float]) → pydrake.multibody.tree.Joint_[float]¶ Returns a reference to the joint actuated by this JointActuator.
-
model_instance
(self: pydrake.multibody.tree.JointActuator_[float]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.JointActuator_[float]) → str¶ Returns the name of the actuator.
-
-
class
-
class
pydrake.multibody.tree.
JointActuator_[AutoDiffXd]
¶ The JointActuator class is mostly a simple bookkeeping structure to represent an actuator acting on a given Joint. It helps to flag whether a given Joint is actuated or not so that MultibodyTree clients can apply forces on actuated joints through their actuators, see AddInOneForce().
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
effort_limit
(self: pydrake.multibody.tree.JointActuator_[AutoDiffXd]) → float¶ Returns the actuator effort limit.
-
index
(self: pydrake.multibody.tree.JointActuator_[AutoDiffXd]) → pydrake.multibody.tree.JointActuatorIndex¶
-
joint
(self: pydrake.multibody.tree.JointActuator_[AutoDiffXd]) → pydrake.multibody.tree.Joint_[AutoDiffXd]¶ Returns a reference to the joint actuated by this JointActuator.
-
model_instance
(self: pydrake.multibody.tree.JointActuator_[AutoDiffXd]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.JointActuator_[AutoDiffXd]) → str¶ Returns the name of the actuator.
-
-
class
pydrake.multibody.tree.
JointActuator_[Expression]
¶ The JointActuator class is mostly a simple bookkeeping structure to represent an actuator acting on a given Joint. It helps to flag whether a given Joint is actuated or not so that MultibodyTree clients can apply forces on actuated joints through their actuators, see AddInOneForce().
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
effort_limit
(self: pydrake.multibody.tree.JointActuator_[Expression]) → float¶ Returns the actuator effort limit.
-
index
(self: pydrake.multibody.tree.JointActuator_[Expression]) → pydrake.multibody.tree.JointActuatorIndex¶
-
joint
(self: pydrake.multibody.tree.JointActuator_[Expression]) → pydrake.multibody.tree.Joint_[Expression]¶ Returns a reference to the joint actuated by this JointActuator.
-
model_instance
(self: pydrake.multibody.tree.JointActuator_[Expression]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.JointActuator_[Expression]) → str¶ Returns the name of the actuator.
-
-
class
pydrake.multibody.tree.
JointActuator_[float]
¶ The JointActuator class is mostly a simple bookkeeping structure to represent an actuator acting on a given Joint. It helps to flag whether a given Joint is actuated or not so that MultibodyTree clients can apply forces on actuated joints through their actuators, see AddInOneForce().
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
effort_limit
(self: pydrake.multibody.tree.JointActuator_[float]) → float¶ Returns the actuator effort limit.
-
index
(self: pydrake.multibody.tree.JointActuator_[float]) → pydrake.multibody.tree.JointActuatorIndex¶
-
joint
(self: pydrake.multibody.tree.JointActuator_[float]) → pydrake.multibody.tree.Joint_[float]¶ Returns a reference to the joint actuated by this JointActuator.
-
model_instance
(self: pydrake.multibody.tree.JointActuator_[float]) → pydrake.multibody.tree.ModelInstanceIndex¶
-
name
(self: pydrake.multibody.tree.JointActuator_[float]) → str¶ Returns the name of the actuator.
-
-
class
pydrake.multibody.tree.
JointActuatorIndex
¶ Type used to identify actuators by index within a multibody tree system.
-
__init__
(self: pydrake.multibody.tree.JointActuatorIndex, arg0: int) → None¶ Default constructor; the result is an invalid index. This only exists to serve applications which require a default constructor.
-
is_valid
(self: pydrake.multibody.tree.JointActuatorIndex) → bool¶ Reports if the index is valid–the only operation on an invalid index that doesn’t throw an exception in Debug builds.
-
-
class
pydrake.multibody.tree.
JointIndex
¶ Type used to identify joints by index within a multibody tree system.
-
__init__
(self: pydrake.multibody.tree.JointIndex, arg0: int) → None¶ Default constructor; the result is an invalid index. This only exists to serve applications which require a default constructor.
-
is_valid
(self: pydrake.multibody.tree.JointIndex) → bool¶ Reports if the index is valid–the only operation on an invalid index that doesn’t throw an exception in Debug builds.
-
-
pydrake.multibody.tree.
LinearSpringDamper
¶
-
template
pydrake.multibody.tree.
LinearSpringDamper_
¶ Instantiations:
LinearSpringDamper_[float]
,LinearSpringDamper_[AutoDiffXd]
,LinearSpringDamper_[Expression]
-
class
LinearSpringDamper_[float]
¶ Bases:
pydrake.multibody.tree.ForceElement_[float]
This ForceElement models a spring-damper attached between two points on two different bodies. Given a point P on a body A and a point Q on a body B with positions p_AP and p_BQ, respectively, this spring-damper applies equal and opposite forces on bodies A and B according to:
f_AP = (k⋅(ℓ - ℓ₀) + c⋅dℓ/dt)⋅r̂ f_BQ = -f_AP
where
ℓ = ‖p_WQ - p_WP‖
is the current length of the spring, dℓ/dt its rate of change,r̂ = (p_WQ - p_WP) / ℓ
is the normalized vector from P to Q, ℓ₀ is the free length of the spring and k and c are the stiffness and damping of the spring-damper, respectively. This ForceElement is meant to model finite free length springs attached between two points. In this typical arrangement springs are usually pre-loaded, meaning they apply a non-zero spring force in the static configuration of the system. Thus, neither the free length ℓ₀ nor the current length ℓ of the spring can ever be zero. The length of the spring approaching zero would incur in a non-physical configuration and therefore this element throws a RuntimeError exception in that case. Note that:- The applied force is always along the line connecting points P and
Q. - Damping always dissipates energy. - Forces on bodies A and B are equal and opposite according to Newton’s third law.
-
__init__
(self: pydrake.multibody.tree.LinearSpringDamper_[float], bodyA: pydrake.multibody.tree.Body_[float], p_AP: numpy.ndarray[numpy.float64[3, 1]], bodyB: pydrake.multibody.tree.Body_[float], p_BQ: numpy.ndarray[numpy.float64[3, 1]], free_length: float, stiffness: float, damping: float) → None¶ Constructor for a spring-damper between a point P on
bodyA
and a point Q onbodyB
. Point P is defined by its positionp_AP
as measured and expressed in the body frame A and similarly, point Q is defined by its position p_BQ as measured and expressed in body frame B. The remaining parameters define:- Parameter
free_length
: - The free length of the spring ℓ₀, in meters, at which the spring applies no forces. Since this force element is meant to model finite length springs, ℓ₀ must be strictly positive.
- Parameter
stiffness
: - The stiffness k of the spring in N/m. It must be non-negative.
- Parameter
damping
: - The damping c of the damper in N⋅s/m. It must be non-negative. Refer to this class’s documentation for further details.
Raises: RuntimeError if free_length
is negative or zero.Raises: RuntimeError if stiffness
is negative.Raises: RuntimeError if damping
is negative.- Parameter
-
bodyA
(self: pydrake.multibody.tree.LinearSpringDamper_[float]) → pydrake.multibody.tree.Body_[float]¶
-
bodyB
(self: pydrake.multibody.tree.LinearSpringDamper_[float]) → pydrake.multibody.tree.Body_[float]¶
-
damping
(self: pydrake.multibody.tree.LinearSpringDamper_[float]) → float¶
-
free_length
(self: pydrake.multibody.tree.LinearSpringDamper_[float]) → float¶
-
p_AP
(self: pydrake.multibody.tree.LinearSpringDamper_[float]) → numpy.ndarray[numpy.float64[3, 1]]¶ The position p_AP of point P on body A as measured and expressed in body frame A.
-
p_BQ
(self: pydrake.multibody.tree.LinearSpringDamper_[float]) → numpy.ndarray[numpy.float64[3, 1]]¶ The position p_BQ of point Q on body B as measured and expressed in body frame B.
-
stiffness
(self: pydrake.multibody.tree.LinearSpringDamper_[float]) → float¶
-
class
-
class
pydrake.multibody.tree.
LinearSpringDamper_[AutoDiffXd]
¶ Bases:
pydrake.multibody.tree.ForceElement_[AutoDiffXd]
This ForceElement models a spring-damper attached between two points on two different bodies. Given a point P on a body A and a point Q on a body B with positions p_AP and p_BQ, respectively, this spring-damper applies equal and opposite forces on bodies A and B according to:
f_AP = (k⋅(ℓ - ℓ₀) + c⋅dℓ/dt)⋅r̂ f_BQ = -f_AP
where
ℓ = ‖p_WQ - p_WP‖
is the current length of the spring, dℓ/dt its rate of change,r̂ = (p_WQ - p_WP) / ℓ