pydrake.multibody.tree

Bindings for MultibodyTree and related components.

pydrake.multibody.tree.BallRpyJoint

alias of pydrake.multibody.tree.BallRpyJoint_[float]

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.
damping(self: pydrake.multibody.tree.BallRpyJoint_[float]) → float

Returns this joint’s damping constant in N⋅m⋅s. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e. opposing motion, with ω the angular velocity of frame M in F (see get_angular_velocity()) and τ the torque on child body B (to which M is rigidly attached).

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 from context.

The orientation R_FM of the child frame M in parent frame F is parameterized with space x-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, rotation R_FM is given in terms of angles θr, θp, θy by:

R_FM(q) = Rz(θy) * Ry(θp) * Rx(θr)

where Rx(θ), Ry(θ) and Rz(θ) 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 Body z-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 the context ordered as θr, θp, θy.
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 velocity w_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.
get_default_angles(self: pydrake.multibody.tree.BallRpyJoint_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Gets the default angles for this joint. Wrapper for the more general Joint::default_positions().

Returns:The default angles of this stored in default_positions_
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 of this joint equals angles.

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.
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 for this joint so that the angular velocity of the child frame M in the parent frame F is w_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.
set_default_angles(self: pydrake.multibody.tree.BallRpyJoint_[float], angles: numpy.ndarray[numpy.float64[3, 1]]) → None

Sets the default angles of this joint.

Parameter angles:
The desired default angles of the joint
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 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.
damping(self: pydrake.multibody.tree.BallRpyJoint_[AutoDiffXd]) → float

Returns this joint’s damping constant in N⋅m⋅s. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e. opposing motion, with ω the angular velocity of frame M in F (see get_angular_velocity()) and τ the torque on child body B (to which M is rigidly attached).

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 from context.

The orientation R_FM of the child frame M in parent frame F is parameterized with space x-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, rotation R_FM is given in terms of angles θr, θp, θy by:

R_FM(q) = Rz(θy) * Ry(θp) * Rx(θr)

where Rx(θ), Ry(θ) and Rz(θ) 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 Body z-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 the context ordered as θr, θp, θy.
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 velocity w_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.
get_default_angles(self: pydrake.multibody.tree.BallRpyJoint_[AutoDiffXd]) → numpy.ndarray[numpy.float64[3, 1]]

Gets the default angles for this joint. Wrapper for the more general Joint::default_positions().

Returns:The default angles of this stored in default_positions_
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 of this joint equals angles.

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.
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 for this joint so that the angular velocity of the child frame M in the parent frame F is w_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.
set_default_angles(self: pydrake.multibody.tree.BallRpyJoint_[AutoDiffXd], angles: numpy.ndarray[numpy.float64[3, 1]]) → None

Sets the default angles of this joint.

Parameter angles:
The desired default angles of the joint
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.
damping(self: pydrake.multibody.tree.BallRpyJoint_[Expression]) → float

Returns this joint’s damping constant in N⋅m⋅s. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e. opposing motion, with ω the angular velocity of frame M in F (see get_angular_velocity()) and τ the torque on child body B (to which M is rigidly attached).

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 from context.

The orientation R_FM of the child frame M in parent frame F is parameterized with space x-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, rotation R_FM is given in terms of angles θr, θp, θy by:

R_FM(q) = Rz(θy) * Ry(θp) * Rx(θr)

where Rx(θ), Ry(θ) and Rz(θ) 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 Body z-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 the context ordered as θr, θp, θy.
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 velocity w_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.
get_default_angles(self: pydrake.multibody.tree.BallRpyJoint_[Expression]) → numpy.ndarray[numpy.float64[3, 1]]

Gets the default angles for this joint. Wrapper for the more general Joint::default_positions().

Returns:The default angles of this stored in default_positions_
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 of this joint equals angles.

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.
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 for this joint so that the angular velocity of the child frame M in the parent frame F is w_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.
set_default_angles(self: pydrake.multibody.tree.BallRpyJoint_[Expression], angles: numpy.ndarray[numpy.float64[3, 1]]) → None

Sets the default angles of this joint.

Parameter angles:
The desired default angles of the joint
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.
damping(self: pydrake.multibody.tree.BallRpyJoint_[float]) → float

Returns this joint’s damping constant in N⋅m⋅s. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e. opposing motion, with ω the angular velocity of frame M in F (see get_angular_velocity()) and τ the torque on child body B (to which M is rigidly attached).

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 from context.

The orientation R_FM of the child frame M in parent frame F is parameterized with space x-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, rotation R_FM is given in terms of angles θr, θp, θy by:

R_FM(q) = Rz(θy) * Ry(θp) * Rx(θr)

where Rx(θ), Ry(θ) and Rz(θ) 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 Body z-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 the context ordered as θr, θp, θy.
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 velocity w_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.
get_default_angles(self: pydrake.multibody.tree.BallRpyJoint_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Gets the default angles for this joint. Wrapper for the more general Joint::default_positions().

Returns:The default angles of this stored in default_positions_
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 of this joint equals angles.

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.
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 for this joint so that the angular velocity of the child frame M in the parent frame F is w_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.
set_default_angles(self: pydrake.multibody.tree.BallRpyJoint_[float], angles: numpy.ndarray[numpy.float64[3, 1]]) → None

Sets the default angles of this joint.

Parameter angles:
The desired default angles of the joint
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 into forces.

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.
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 into forces.

body_frame(self: pydrake.multibody.tree.Body_[float]) → pydrake.multibody.tree.BodyFrame_[float]

Returns a const reference to the associated BodyFrame.

CalcCenterOfMassInBodyFrame(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[3, 1]]

(Advanced) Computes the center of mass p_BoBcm_B (or p_Bcm for short) of this body measured from this body’s frame origin Bo and expressed in the body frame B.

CalcSpatialInertiaInBodyFrame(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float]) → drake::multibody::SpatialInertia<double>

(Advanced) Computes the SpatialInertia I_BBo_B of this body about its frame origin Bo (not necessarily its center of mass) and expressed in its body frame B. In general, the spatial inertia of a body is a function of state. Consider for instance the case of a flexible body for which its spatial inertia in the body frame depends on the generalized coordinates describing its state of deformation. As a particular case, the spatial inertia of a RigidBody in its body frame is constant.

EvalPoseInWorld(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.math.RigidTransform_[float]

Returns the pose X_WB of this body B in the world frame W as a function of the state of the model stored in context.

EvalSpatialAccelerationInWorld(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.multibody.math.SpatialAcceleration_[float]

Evaluates A_WB, this body B’s spatial acceleration in the world frame W.

Parameter context:
Contains the state of the model.
Returns A_WB_W:
this body B’s spatial acceleration in the world frame W, expressed in W (for point Bo, the body’s origin).

Note

When cached values are out of sync with the state stored in context, this method performs an expensive forward dynamics computation, whereas once evaluated, successive calls to this method are inexpensive.

EvalSpatialVelocityInWorld(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.multibody.math.SpatialVelocity_[float]

Evaluates V_WB, this body B’s spatial velocity in the world frame W.

Parameter context:
Contains the state of the model.
Returns V_WB_W:
this body B’s spatial velocity in the world frame W, expressed in W (for point Bo, the body frame’s origin).
floating_positions_start(self: pydrake.multibody.tree.Body_[float]) → int

(Advanced) For floating bodies (see is_floating()) this method returns the index of the first generalized position in the state vector for a MultibodyPlant model. Positions for this body are then contiguous starting at this index. When a floating body is modeled with a quaternion mobilizer (see has_quaternion_dofs()), the four consecutive entries in the state starting at this index correspond to the quaternion that parametrizes this body’s orientation.

Raises:
  • RuntimeError if called pre-finalize, see
  • MultibodyPlant::Finalize().
floating_velocities_start(self: pydrake.multibody.tree.Body_[float]) → int

(Advanced) For floating bodies (see is_floating()) this method returns the index of the first generalized velocity in the state vector for a MultibodyPlant model. Velocities for this body are then contiguous starting at this index.

Raises:
  • RuntimeError if called pre-finalize, see
  • MultibodyPlant::Finalize().
get_default_mass(self: pydrake.multibody.tree.Body_[float]) → float

Returns the default mass (not Context dependent) for this body. In general, the mass for a body can be a parameter of the model that can be retrieved with the method get_mass(). When the mass of a body is a parameter, the value returned by get_default_mass() is used to initialize the mass parameter in the context.

get_mass(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float]) → float

(Advanced) Returns the mass of this body stored in context.

get_num_flexible_positions(self: pydrake.multibody.tree.Body_[float]) → int

Returns the number of generalized positions q describing flexible deformations for this body. A rigid body will therefore return zero.

get_num_flexible_velocities(self: pydrake.multibody.tree.Body_[float]) → int

Returns the number of generalized velocities v describing flexible deformations for this body. A rigid body will therefore return zero.

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 from forces as F_BBo_W: applied at body B’s origin Bo and expressed in world world frame W.

GetParentPlant(self: pydrake.multibody.tree.Body_[float]) → drake::multibody::MultibodyPlant<double>
has_quaternion_dofs(self: pydrake.multibody.tree.Body_[float]) → bool

(Advanced) If True, this body is a floating body modeled with a quaternion floating mobilizer. By implication, is_floating() is also True.

See also

floating_positions_start(), floating_velocities_start().

Raises:
  • RuntimeError if called pre-finalize, see
  • MultibodyPlant::Finalize().
index(self: pydrake.multibody.tree.Body_[float]) → pydrake.multibody.tree.BodyIndex
is_floating(self: pydrake.multibody.tree.Body_[float]) → bool

(Advanced) Returns True if this 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 with this body.

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 into forces.

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.
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 into forces.

body_frame(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → pydrake.multibody.tree.BodyFrame_[AutoDiffXd]

Returns a const reference to the associated BodyFrame.

CalcCenterOfMassInBodyFrame(self: pydrake.multibody.tree.Body_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → numpy.ndarray[object[3, 1]]

(Advanced) Computes the center of mass p_BoBcm_B (or p_Bcm for short) of this body measured from this body’s frame origin Bo and expressed in the body frame B.

CalcSpatialInertiaInBodyFrame(self: pydrake.multibody.tree.Body_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → drake::multibody::SpatialInertia<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >

(Advanced) Computes the SpatialInertia I_BBo_B of this body about its frame origin Bo (not necessarily its center of mass) and expressed in its body frame B. In general, the spatial inertia of a body is a function of state. Consider for instance the case of a flexible body for which its spatial inertia in the body frame depends on the generalized coordinates describing its state of deformation. As a particular case, the spatial inertia of a RigidBody in its body frame is constant.

EvalPoseInWorld(self: pydrake.multibody.tree.Body_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.math.RigidTransform_[AutoDiffXd]

Returns the pose X_WB of this body B in the world frame W as a function of the state of the model stored in context.

EvalSpatialAccelerationInWorld(self: pydrake.multibody.tree.Body_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.multibody.math.SpatialAcceleration_[AutoDiffXd]

Evaluates A_WB, this body B’s spatial acceleration in the world frame W.

Parameter context:
Contains the state of the model.
Returns A_WB_W:
this body B’s spatial acceleration in the world frame W, expressed in W (for point Bo, the body’s origin).

Note

When cached values are out of sync with the state stored in context, this method performs an expensive forward dynamics computation, whereas once evaluated, successive calls to this method are inexpensive.

EvalSpatialVelocityInWorld(self: pydrake.multibody.tree.Body_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.multibody.math.SpatialVelocity_[AutoDiffXd]

Evaluates V_WB, this body B’s spatial velocity in the world frame W.

Parameter context:
Contains the state of the model.
Returns V_WB_W:
this body B’s spatial velocity in the world frame W, expressed in W (for point Bo, the body frame’s origin).
floating_positions_start(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → int

(Advanced) For floating bodies (see is_floating()) this method returns the index of the first generalized position in the state vector for a MultibodyPlant model. Positions for this body are then contiguous starting at this index. When a floating body is modeled with a quaternion mobilizer (see has_quaternion_dofs()), the four consecutive entries in the state starting at this index correspond to the quaternion that parametrizes this body’s orientation.

Raises:
  • RuntimeError if called pre-finalize, see
  • MultibodyPlant::Finalize().
floating_velocities_start(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → int

(Advanced) For floating bodies (see is_floating()) this method returns the index of the first generalized velocity in the state vector for a MultibodyPlant model. Velocities for this body are then contiguous starting at this index.

Raises:
  • RuntimeError if called pre-finalize, see
  • MultibodyPlant::Finalize().
get_default_mass(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → float

Returns the default mass (not Context dependent) for this body. In general, the mass for a body can be a parameter of the model that can be retrieved with the method get_mass(). When the mass of a body is a parameter, the value returned by get_default_mass() is used to initialize the mass parameter in the context.

get_mass(self: pydrake.multibody.tree.Body_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.autodiffutils.AutoDiffXd

(Advanced) Returns the mass of this body stored in context.

get_num_flexible_positions(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → int

Returns the number of generalized positions q describing flexible deformations for this body. A rigid body will therefore return zero.

get_num_flexible_velocities(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → int

Returns the number of generalized velocities v describing flexible deformations for this body. A rigid body will therefore return zero.

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 from forces as F_BBo_W: applied at body B’s origin Bo and expressed in world world frame W.

GetParentPlant(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → drake::multibody::MultibodyPlant<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >
has_quaternion_dofs(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → bool

(Advanced) If True, this body is a floating body modeled with a quaternion floating mobilizer. By implication, is_floating() is also True.

See also

floating_positions_start(), floating_velocities_start().

Raises:
  • RuntimeError if called pre-finalize, see
  • MultibodyPlant::Finalize().
index(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → pydrake.multibody.tree.BodyIndex
is_floating(self: pydrake.multibody.tree.Body_[AutoDiffXd]) → bool

(Advanced) Returns True if this 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 with this 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 into forces.

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.
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 into forces.

body_frame(self: pydrake.multibody.tree.Body_[Expression]) → pydrake.multibody.tree.BodyFrame_[Expression]

Returns a const reference to the associated BodyFrame.

CalcCenterOfMassInBodyFrame(self: pydrake.multibody.tree.Body_[Expression], context: pydrake.systems.framework.Context_[Expression]) → numpy.ndarray[object[3, 1]]

(Advanced) Computes the center of mass p_BoBcm_B (or p_Bcm for short) of this body measured from this body’s frame origin Bo and expressed in the body frame B.

CalcSpatialInertiaInBodyFrame(self: pydrake.multibody.tree.Body_[Expression], context: pydrake.systems.framework.Context_[Expression]) → drake::multibody::SpatialInertia<drake::symbolic::Expression>

(Advanced) Computes the SpatialInertia I_BBo_B of this body about its frame origin Bo (not necessarily its center of mass) and expressed in its body frame B. In general, the spatial inertia of a body is a function of state. Consider for instance the case of a flexible body for which its spatial inertia in the body frame depends on the generalized coordinates describing its state of deformation. As a particular case, the spatial inertia of a RigidBody in its body frame is constant.

EvalPoseInWorld(self: pydrake.multibody.tree.Body_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.math.RigidTransform_[Expression]

Returns the pose X_WB of this body B in the world frame W as a function of the state of the model stored in context.

EvalSpatialAccelerationInWorld(self: pydrake.multibody.tree.Body_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.multibody.math.SpatialAcceleration_[Expression]

Evaluates A_WB, this body B’s spatial acceleration in the world frame W.

Parameter context:
Contains the state of the model.
Returns A_WB_W:
this body B’s spatial acceleration in the world frame W, expressed in W (for point Bo, the body’s origin).

Note

When cached values are out of sync with the state stored in context, this method performs an expensive forward dynamics computation, whereas once evaluated, successive calls to this method are inexpensive.

EvalSpatialVelocityInWorld(self: pydrake.multibody.tree.Body_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.multibody.math.SpatialVelocity_[Expression]

Evaluates V_WB, this body B’s spatial velocity in the world frame W.

Parameter context:
Contains the state of the model.
Returns V_WB_W:
this body B’s spatial velocity in the world frame W, expressed in W (for point Bo, the body frame’s origin).
floating_positions_start(self: pydrake.multibody.tree.Body_[Expression]) → int

(Advanced) For floating bodies (see is_floating()) this method returns the index of the first generalized position in the state vector for a MultibodyPlant model. Positions for this body are then contiguous starting at this index. When a floating body is modeled with a quaternion mobilizer (see has_quaternion_dofs()), the four consecutive entries in the state starting at this index correspond to the quaternion that parametrizes this body’s orientation.

Raises:
  • RuntimeError if called pre-finalize, see
  • MultibodyPlant::Finalize().
floating_velocities_start(self: pydrake.multibody.tree.Body_[Expression]) → int

(Advanced) For floating bodies (see is_floating()) this method returns the index of the first generalized velocity in the state vector for a MultibodyPlant model. Velocities for this body are then contiguous starting at this index.

Raises:
  • RuntimeError if called pre-finalize, see
  • MultibodyPlant::Finalize().
get_default_mass(self: pydrake.multibody.tree.Body_[Expression]) → float

Returns the default mass (not Context dependent) for this body. In general, the mass for a body can be a parameter of the model that can be retrieved with the method get_mass(). When the mass of a body is a parameter, the value returned by get_default_mass() is used to initialize the mass parameter in the context.

get_mass(self: pydrake.multibody.tree.Body_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.symbolic.Expression

(Advanced) Returns the mass of this body stored in context.

get_num_flexible_positions(self: pydrake.multibody.tree.Body_[Expression]) → int

Returns the number of generalized positions q describing flexible deformations for this body. A rigid body will therefore return zero.

get_num_flexible_velocities(self: pydrake.multibody.tree.Body_[Expression]) → int

Returns the number of generalized velocities v describing flexible deformations for this body. A rigid body will therefore return zero.

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 from forces as F_BBo_W: applied at body B’s origin Bo and expressed in world world frame W.

GetParentPlant(self: pydrake.multibody.tree.Body_[Expression]) → drake::multibody::MultibodyPlant<drake::symbolic::Expression>
has_quaternion_dofs(self: pydrake.multibody.tree.Body_[Expression]) → bool

(Advanced) If True, this body is a floating body modeled with a quaternion floating mobilizer. By implication, is_floating() is also True.

See also

floating_positions_start(), floating_velocities_start().

Raises:
  • RuntimeError if called pre-finalize, see
  • MultibodyPlant::Finalize().
index(self: pydrake.multibody.tree.Body_[Expression]) → pydrake.multibody.tree.BodyIndex
is_floating(self: pydrake.multibody.tree.Body_[Expression]) → bool

(Advanced) Returns True if this 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 with this 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 into forces.

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.
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 into forces.

body_frame(self: pydrake.multibody.tree.Body_[float]) → pydrake.multibody.tree.BodyFrame_[float]

Returns a const reference to the associated BodyFrame.

CalcCenterOfMassInBodyFrame(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[3, 1]]

(Advanced) Computes the center of mass p_BoBcm_B (or p_Bcm for short) of this body measured from this body’s frame origin Bo and expressed in the body frame B.

CalcSpatialInertiaInBodyFrame(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float]) → drake::multibody::SpatialInertia<double>

(Advanced) Computes the SpatialInertia I_BBo_B of this body about its frame origin Bo (not necessarily its center of mass) and expressed in its body frame B. In general, the spatial inertia of a body is a function of state. Consider for instance the case of a flexible body for which its spatial inertia in the body frame depends on the generalized coordinates describing its state of deformation. As a particular case, the spatial inertia of a RigidBody in its body frame is constant.

EvalPoseInWorld(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.math.RigidTransform_[float]

Returns the pose X_WB of this body B in the world frame W as a function of the state of the model stored in context.

EvalSpatialAccelerationInWorld(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.multibody.math.SpatialAcceleration_[float]

Evaluates A_WB, this body B’s spatial acceleration in the world frame W.

Parameter context:
Contains the state of the model.
Returns A_WB_W:
this body B’s spatial acceleration in the world frame W, expressed in W (for point Bo, the body’s origin).

Note

When cached values are out of sync with the state stored in context, this method performs an expensive forward dynamics computation, whereas once evaluated, successive calls to this method are inexpensive.

EvalSpatialVelocityInWorld(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.multibody.math.SpatialVelocity_[float]

Evaluates V_WB, this body B’s spatial velocity in the world frame W.

Parameter context:
Contains the state of the model.
Returns V_WB_W:
this body B’s spatial velocity in the world frame W, expressed in W (for point Bo, the body frame’s origin).
floating_positions_start(self: pydrake.multibody.tree.Body_[float]) → int

(Advanced) For floating bodies (see is_floating()) this method returns the index of the first generalized position in the state vector for a MultibodyPlant model. Positions for this body are then contiguous starting at this index. When a floating body is modeled with a quaternion mobilizer (see has_quaternion_dofs()), the four consecutive entries in the state starting at this index correspond to the quaternion that parametrizes this body’s orientation.

Raises:
  • RuntimeError if called pre-finalize, see
  • MultibodyPlant::Finalize().
floating_velocities_start(self: pydrake.multibody.tree.Body_[float]) → int

(Advanced) For floating bodies (see is_floating()) this method returns the index of the first generalized velocity in the state vector for a MultibodyPlant model. Velocities for this body are then contiguous starting at this index.

Raises:
  • RuntimeError if called pre-finalize, see
  • MultibodyPlant::Finalize().
get_default_mass(self: pydrake.multibody.tree.Body_[float]) → float

Returns the default mass (not Context dependent) for this body. In general, the mass for a body can be a parameter of the model that can be retrieved with the method get_mass(). When the mass of a body is a parameter, the value returned by get_default_mass() is used to initialize the mass parameter in the context.

get_mass(self: pydrake.multibody.tree.Body_[float], context: pydrake.systems.framework.Context_[float]) → float

(Advanced) Returns the mass of this body stored in context.

get_num_flexible_positions(self: pydrake.multibody.tree.Body_[float]) → int

Returns the number of generalized positions q describing flexible deformations for this body. A rigid body will therefore return zero.

get_num_flexible_velocities(self: pydrake.multibody.tree.Body_[float]) → int

Returns the number of generalized velocities v describing flexible deformations for this body. A rigid body will therefore return zero.

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 from forces as F_BBo_W: applied at body B’s origin Bo and expressed in world world frame W.

GetParentPlant(self: pydrake.multibody.tree.Body_[float]) → drake::multibody::MultibodyPlant<double>
has_quaternion_dofs(self: pydrake.multibody.tree.Body_[float]) → bool

(Advanced) If True, this body is a floating body modeled with a quaternion floating mobilizer. By implication, is_floating() is also True.

See also

floating_positions_start(), floating_velocities_start().

Raises:
  • RuntimeError if called pre-finalize, see
  • MultibodyPlant::Finalize().
index(self: pydrake.multibody.tree.Body_[float]) → pydrake.multibody.tree.BodyIndex
is_floating(self: pydrake.multibody.tree.Body_[float]) → bool

(Advanced) Returns True if this 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 with this body.

pydrake.multibody.tree.BodyFrame

alias of pydrake.multibody.tree.BodyFrame_[float]

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 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

alias of pydrake.multibody.tree.DoorHinge_[float]

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 the tanh function to approximate a step curve ({x<0: -1 ; x>0: 1}) outside of -t < x < t. The curve doublet(t, x) = 2 * s * (1 s²) is the second derivative of s scaled by -t², which yields a lump at negative x that integrates to -1 and a lump at positive x 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 * . The door is assumed to be closed at q=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 when q < 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. Run bazel 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 the motion_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 specified joint. 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 and angular_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.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 the tanh function to approximate a step curve ({x<0: -1 ; x>0: 1}) outside of -t < x < t. The curve doublet(t, x) = 2 * s * (1 s²) is the second derivative of s scaled by -t², which yields a lump at negative x that integrates to -1 and a lump at positive x 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 * . The door is assumed to be closed at q=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 when q < 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. Run bazel 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 the motion_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 specified joint. 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 and angular_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 the tanh function to approximate a step curve ({x<0: -1 ; x>0: 1}) outside of -t < x < t. The curve doublet(t, x) = 2 * s * (1 s²) is the second derivative of s scaled by -t², which yields a lump at negative x that integrates to -1 and a lump at positive x 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 * . The door is assumed to be closed at q=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 when q < 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. Run bazel 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 the motion_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 specified joint. 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 and angular_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 the tanh function to approximate a step curve ({x<0: -1 ; x>0: 1}) outside of -t < x < t. The curve doublet(t, x) = 2 * s * (1 s²) is the second derivative of s scaled by -t², which yields a lump at negative x that integrates to -1 and a lump at positive x 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 * . The door is assumed to be closed at q=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 when q < 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. Run bazel 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 the motion_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 specified joint. 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 and angular_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

alias of pydrake.multibody.tree.FixedOffsetFrame_[float]

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 pose X_BF, where B is the BodyFrame associated with body B. Thus, the World frame pose X_WF of a FixedOffsetFrame F depends only on the World frame pose X_WP of its parent P, and the constant pose X_PF, with X_WF=X_WP*X_PF.

For more information about spatial transforms, see multibody_spatial_pose.

__init__(*args, **kwargs)

Overloaded function.

  1. __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().
  1. __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[float], P: pydrake.multibody.tree.Frame_[float], X_PF: pydrake.math.RigidTransform_[float]) -> None

Creates an unnamed material Frame F. See overload with name for more information.

  1. __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[float], name: str, bodyB: drake::multibody::Body<double>, X_BF: pydrake.math.RigidTransform_[float]) -> None

Creates a material Frame F whose pose is fixed with respect to the BodyFrame B of the given Body, which serves as F’s parent frame. The pose is given by a spatial transform X_BF; see class documentation for more information.

Parameter name:
The name of this frame.
Parameter bodyB:
The body whose BodyFrame B is to be F’s parent frame.
Parameter X_BF:
The transform giving the pose of F in B.
  1. __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[float], bodyB: drake::multibody::Body<double>, X_BF: pydrake.math.RigidTransform_[float]) -> None

Creates an unnamed material Frame F. See overload with name for more information.

  1. __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!.

SetPoseInBodyFrame(self: pydrake.multibody.tree.FixedOffsetFrame_[float], context: pydrake.systems.framework.Context_[float], X_PF: pydrake.math.RigidTransform_[float]) → None
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 pose X_BF, where B is the BodyFrame associated with body B. Thus, the World frame pose X_WF of a FixedOffsetFrame F depends only on the World frame pose X_WP of its parent P, and the constant pose X_PF, with X_WF=X_WP*X_PF.

For more information about spatial transforms, see multibody_spatial_pose.

__init__(*args, **kwargs)

Overloaded function.

  1. __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().
  1. __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[AutoDiffXd], P: pydrake.multibody.tree.Frame_[AutoDiffXd], X_PF: pydrake.math.RigidTransform_[float]) -> None

Creates an unnamed material Frame F. See overload with name for more information.

  1. __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[AutoDiffXd], name: str, bodyB: drake::multibody::Body<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >, X_BF: pydrake.math.RigidTransform_[float]) -> None

Creates a material Frame F whose pose is fixed with respect to the BodyFrame B of the given Body, which serves as F’s parent frame. The pose is given by a spatial transform X_BF; see class documentation for more information.

Parameter name:
The name of this frame.
Parameter bodyB:
The body whose BodyFrame B is to be F’s parent frame.
Parameter X_BF:
The transform giving the pose of F in B.
  1. __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[AutoDiffXd], bodyB: drake::multibody::Body<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >, X_BF: pydrake.math.RigidTransform_[float]) -> None

Creates an unnamed material Frame F. See overload with name for more information.

  1. __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!.

SetPoseInBodyFrame(self: pydrake.multibody.tree.FixedOffsetFrame_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], X_PF: pydrake.math.RigidTransform_[AutoDiffXd]) → None
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 pose X_BF, where B is the BodyFrame associated with body B. Thus, the World frame pose X_WF of a FixedOffsetFrame F depends only on the World frame pose X_WP of its parent P, and the constant pose X_PF, with X_WF=X_WP*X_PF.

For more information about spatial transforms, see multibody_spatial_pose.

__init__(*args, **kwargs)

Overloaded function.

  1. __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().
  1. __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[Expression], P: pydrake.multibody.tree.Frame_[Expression], X_PF: pydrake.math.RigidTransform_[float]) -> None

Creates an unnamed material Frame F. See overload with name for more information.

  1. __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[Expression], name: str, bodyB: drake::multibody::Body<drake::symbolic::Expression>, X_BF: pydrake.math.RigidTransform_[float]) -> None

Creates a material Frame F whose pose is fixed with respect to the BodyFrame B of the given Body, which serves as F’s parent frame. The pose is given by a spatial transform X_BF; see class documentation for more information.

Parameter name:
The name of this frame.
Parameter bodyB:
The body whose BodyFrame B is to be F’s parent frame.
Parameter X_BF:
The transform giving the pose of F in B.
  1. __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[Expression], bodyB: drake::multibody::Body<drake::symbolic::Expression>, X_BF: pydrake.math.RigidTransform_[float]) -> None

Creates an unnamed material Frame F. See overload with name for more information.

  1. __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!.

SetPoseInBodyFrame(self: pydrake.multibody.tree.FixedOffsetFrame_[Expression], context: pydrake.systems.framework.Context_[Expression], X_PF: pydrake.math.RigidTransform_[Expression]) → None
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 pose X_BF, where B is the BodyFrame associated with body B. Thus, the World frame pose X_WF of a FixedOffsetFrame F depends only on the World frame pose X_WP of its parent P, and the constant pose X_PF, with X_WF=X_WP*X_PF.

For more information about spatial transforms, see multibody_spatial_pose.

__init__(*args, **kwargs)

Overloaded function.

  1. __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().
  1. __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[float], P: pydrake.multibody.tree.Frame_[float], X_PF: pydrake.math.RigidTransform_[float]) -> None

Creates an unnamed material Frame F. See overload with name for more information.

  1. __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[float], name: str, bodyB: drake::multibody::Body<double>, X_BF: pydrake.math.RigidTransform_[float]) -> None

Creates a material Frame F whose pose is fixed with respect to the BodyFrame B of the given Body, which serves as F’s parent frame. The pose is given by a spatial transform X_BF; see class documentation for more information.

Parameter name:
The name of this frame.
Parameter bodyB:
The body whose BodyFrame B is to be F’s parent frame.
Parameter X_BF:
The transform giving the pose of F in B.
  1. __init__(self: pydrake.multibody.tree.FixedOffsetFrame_[float], bodyB: drake::multibody::Body<double>, X_BF: pydrake.math.RigidTransform_[float]) -> None

Creates an unnamed material Frame F. See overload with name for more information.

  1. __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!.

SetPoseInBodyFrame(self: pydrake.multibody.tree.FixedOffsetFrame_[float], context: pydrake.systems.framework.Context_[float], X_PF: pydrake.math.RigidTransform_[float]) → None
pydrake.multibody.tree.ForceElement

alias of pydrake.multibody.tree.ForceElement_[float]

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.

GetParentPlant(self: pydrake.multibody.tree.ForceElement_[float]) → drake::multibody::MultibodyPlant<double>
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.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.

GetParentPlant(self: pydrake.multibody.tree.ForceElement_[AutoDiffXd]) → drake::multibody::MultibodyPlant<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >
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.

GetParentPlant(self: pydrake.multibody.tree.ForceElement_[Expression]) → drake::multibody::MultibodyPlant<drake::symbolic::Expression>
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.

GetParentPlant(self: pydrake.multibody.tree.ForceElement_[float]) → drake::multibody::MultibodyPlant<double>
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.

CalcOffsetPoseInBody(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float], X_FQ: pydrake.math.RigidTransform_[float]) → pydrake.math.RigidTransform_[float]

Given the offset pose X_FQ of a frame Q in this frame F, this method computes the pose X_BQ of frame Q in the body frame B to which this frame is attached. In other words, if the pose of this frame F in the body frame B is X_BF, this method computes the pose X_BQ of frame Q in the body frame B as X_BQ = X_BF * X_FQ. In particular, if this **is**` the body frame B, i.e. X_BF is the identity transformation, this method directly returns X_FQ. Specific frame subclasses can override this method to provide faster implementations if needed.

CalcOffsetRotationMatrixInBody(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float], R_FQ: pydrake.math.RotationMatrix_[float]) → pydrake.math.RotationMatrix_[float]

Calculates and returns the rotation matrix R_BQ that relates body frame B to frame Q via this intermediate frame F, i.e., R_BQ = R_BF * R_FQ (B is the body frame to which this frame F is attached).

Parameter R_FQ:
rotation matrix that relates frame F to frame Q.
CalcPose(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float], frame_M: pydrake.multibody.tree.Frame_[float]) → pydrake.math.RigidTransform_[float]

Computes and returns the pose X_MF of this frame F in measured in frame_M as a function of the state of the model stored in context.

See also

CalcPoseInWorld().

CalcPoseInBodyFrame(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.math.RigidTransform_[float]

Returns the pose X_BF of this frame F in the body frame B associated with this frame. In particular, if this is the body frame B, this method directly returns the identity transformation.

CalcPoseInWorld(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.math.RigidTransform_[float]

Computes and returns the pose X_WF of this frame F in the world frame W as a function of the state of the model stored in context.

Note

Body::EvalPoseInWorld() provides a more efficient way to obtain the pose for a body frame.

CalcRotationMatrix(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float], frame_M: pydrake.multibody.tree.Frame_[float]) → pydrake.math.RotationMatrix_[float]

Calculates and returns the rotation matrix R_MF that relates frame_M and this frame F as a function of the state stored in context.

CalcRotationMatrixInBodyFrame(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.math.RotationMatrix_[float]

Returns the rotation matrix R_BF that relates body frame B to this frame F (B is the body frame to which this frame F is attached).

Note

If this is B, this method returns the identity RotationMatrix.

CalcRotationMatrixInWorld(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.math.RotationMatrix_[float]

Calculates and returns the rotation matrix R_WF that relates the world frame W and this frame F as a function of the state stored in context.

CalcSpatialAccelerationInWorld(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.multibody.math.SpatialAcceleration_[float]

Computes and returns the spatial acceleration A_WF_W of this frame F in world frame W expressed in W as a function of the state stored in context.

Note

Body::EvalSpatialAccelerationInWorld() provides a more efficient way to obtain the spatial acceleration for a body frame.

Note

When cached values are out of sync with the state stored in context, this method performs an expensive forward dynamics computation, whereas once evaluated, successive calls to this method are inexpensive.

CalcSpatialVelocity(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float], frame_M: pydrake.multibody.tree.Frame_[float], frame_E: pydrake.multibody.tree.Frame_[float]) → pydrake.multibody.math.SpatialVelocity_[float]

Computes and returns the spatial velocity V_MF_E of this frame F measured in frame_M and expressed in frame_E as a function of the state of the model stored in context.

See also

CalcSpatialVelocityInWorld().

CalcSpatialVelocityInWorld(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.multibody.math.SpatialVelocity_[float]

Computes and returns the spatial velocity V_WF of this frame F in the world frame W as a function of the state of the model stored in context.

Note

Body::EvalSpatialVelocityInWorld() provides a more efficient way to obtain the spatial velocity for a body frame.

GetFixedOffsetPoseInBody(self: pydrake.multibody.tree.Frame_[float], X_FQ: pydrake.math.RigidTransform_[float]) → pydrake.math.RigidTransform_[float]

Variant of CalcOffsetPoseInBody() that given the offset pose X_FQ of a frame Q in this frame F, returns the pose X_BQ of frame Q in the body frame B to which this frame is attached.

Raises:
  • RuntimeError if called on a Frame that does not have a fixed
  • offset in the body frame.
GetFixedPoseInBodyFrame(*args, **kwargs)

Overloaded function.

  1. GetFixedPoseInBodyFrame(self: pydrake.multibody.tree.Frame_[float]) -> pydrake.math.RigidTransform_[float]

Variant of CalcPoseInBodyFrame() that returns the fixed pose X_BF of this 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.
  1. GetFixedPoseInBodyFrame(self: pydrake.multibody.tree.Frame_[float]) -> pydrake.math.RigidTransform_[float]

Variant of CalcPoseInBodyFrame() that returns the fixed pose X_BF of this 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.
GetFixedRotationMatrixInBody(self: pydrake.multibody.tree.Frame_[float], R_FQ: pydrake.math.RotationMatrix_[float]) → pydrake.math.RotationMatrix_[float]

Calculates and returns the rotation matrix R_BQ that relates body frame B to frame Q via this intermediate frame F, i.e., R_BQ = R_BF * R_FQ (B is the body frame to which this frame F is attached).

Parameter R_FQ:
rotation matrix that relates frame F to frame Q.
Raises:
  • RuntimeError if this frame F is a Frame that does not have a
  • fixed offset in the body frame B (i.e., R_BF is not constant).
GetFixedRotationMatrixInBodyFrame(self: pydrake.multibody.tree.Frame_[float]) → pydrake.math.RotationMatrix_[float]

Returns the rotation matrix R_BF that relates body frame B to this frame F (B is the body frame to which this frame F is attached).

Raises:
  • RuntimeError if this frame F is a Frame that does not have a
  • fixed offset in the body frame B (i.e., R_BF is not constant).
  • Frame sub-classes that have a constant R_BF must override this
  • method. An example of a frame sub-class not implementing this
  • method would be that of a frame on a soft body, for which its pose
  • in the body frame depends on the state of deformation of the body.
GetParentPlant(self: pydrake.multibody.tree.Frame_[float]) → drake::multibody::MultibodyPlant<double>
index(self: pydrake.multibody.tree.Frame_[float]) → pydrake.multibody.tree.FrameIndex
is_body_frame(self: pydrake.multibody.tree.Frame_[float]) → bool

Returns true if this is the body frame.

is_world_frame(self: pydrake.multibody.tree.Frame_[float]) → bool

Returns true if this is the world frame.

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.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.

CalcOffsetPoseInBody(self: pydrake.multibody.tree.Frame_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], X_FQ: pydrake.math.RigidTransform_[AutoDiffXd]) → pydrake.math.RigidTransform_[AutoDiffXd]

Given the offset pose X_FQ of a frame Q in this frame F, this method computes the pose X_BQ of frame Q in the body frame B to which this frame is attached. In other words, if the pose of this frame F in the body frame B is X_BF, this method computes the pose X_BQ of frame Q in the body frame B as X_BQ = X_BF * X_FQ. In particular, if this **is**` the body frame B, i.e. X_BF is the identity transformation, this method directly returns X_FQ. Specific frame subclasses can override this method to provide faster implementations if needed.

CalcOffsetRotationMatrixInBody(self: pydrake.multibody.tree.Frame_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], R_FQ: pydrake.math.RotationMatrix_[AutoDiffXd]) → pydrake.math.RotationMatrix_[AutoDiffXd]

Calculates and returns the rotation matrix R_BQ that relates body frame B to frame Q via this intermediate frame F, i.e., R_BQ = R_BF * R_FQ (B is the body frame to which this frame F is attached).

Parameter R_FQ:
rotation matrix that relates frame F to frame Q.
CalcPose(self: pydrake.multibody.tree.Frame_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], frame_M: pydrake.multibody.tree.Frame_[AutoDiffXd]) → pydrake.math.RigidTransform_[AutoDiffXd]

Computes and returns the pose X_MF of this frame F in measured in frame_M as a function of the state of the model stored in context.

See also

CalcPoseInWorld().

CalcPoseInBodyFrame(self: pydrake.multibody.tree.Frame_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.math.RigidTransform_[AutoDiffXd]

Returns the pose X_BF of this frame F in the body frame B associated with this frame. In particular, if this is the body frame B, this method directly returns the identity transformation.

CalcPoseInWorld(self: pydrake.multibody.tree.Frame_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.math.RigidTransform_[AutoDiffXd]

Computes and returns the pose X_WF of this frame F in the world frame W as a function of the state of the model stored in context.

Note

Body::EvalPoseInWorld() provides a more efficient way to obtain the pose for a body frame.

CalcRotationMatrix(self: pydrake.multibody.tree.Frame_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], frame_M: pydrake.multibody.tree.Frame_[AutoDiffXd]) → pydrake.math.RotationMatrix_[AutoDiffXd]

Calculates and returns the rotation matrix R_MF that relates frame_M and this frame F as a function of the state stored in context.

CalcRotationMatrixInBodyFrame(self: pydrake.multibody.tree.Frame_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.math.RotationMatrix_[AutoDiffXd]

Returns the rotation matrix R_BF that relates body frame B to this frame F (B is the body frame to which this frame F is attached).

Note

If this is B, this method returns the identity RotationMatrix.

CalcRotationMatrixInWorld(self: pydrake.multibody.tree.Frame_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.math.RotationMatrix_[AutoDiffXd]

Calculates and returns the rotation matrix R_WF that relates the world frame W and this frame F as a function of the state stored in context.

CalcSpatialAccelerationInWorld(self: pydrake.multibody.tree.Frame_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.multibody.math.SpatialAcceleration_[AutoDiffXd]

Computes and returns the spatial acceleration A_WF_W of this frame F in world frame W expressed in W as a function of the state stored in context.

Note

Body::EvalSpatialAccelerationInWorld() provides a more efficient way to obtain the spatial acceleration for a body frame.

Note

When cached values are out of sync with the state stored in context, this method performs an expensive forward dynamics computation, whereas once evaluated, successive calls to this method are inexpensive.

CalcSpatialVelocity(self: pydrake.multibody.tree.Frame_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], frame_M: pydrake.multibody.tree.Frame_[AutoDiffXd], frame_E: pydrake.multibody.tree.Frame_[AutoDiffXd]) → pydrake.multibody.math.SpatialVelocity_[AutoDiffXd]

Computes and returns the spatial velocity V_MF_E of this frame F measured in frame_M and expressed in frame_E as a function of the state of the model stored in context.

See also

CalcSpatialVelocityInWorld().

CalcSpatialVelocityInWorld(self: pydrake.multibody.tree.Frame_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.multibody.math.SpatialVelocity_[AutoDiffXd]

Computes and returns the spatial velocity V_WF of this frame F in the world frame W as a function of the state of the model stored in context.

Note

Body::EvalSpatialVelocityInWorld() provides a more efficient way to obtain the spatial velocity for a body frame.

GetFixedOffsetPoseInBody(self: pydrake.multibody.tree.Frame_[AutoDiffXd], X_FQ: pydrake.math.RigidTransform_[AutoDiffXd]) → pydrake.math.RigidTransform_[AutoDiffXd]

Variant of CalcOffsetPoseInBody() that given the offset pose X_FQ of a frame Q in this frame F, returns the pose X_BQ of frame Q in the body frame B to which this frame is attached.

Raises:
  • RuntimeError if called on a Frame that does not have a fixed
  • offset in the body frame.
GetFixedPoseInBodyFrame(*args, **kwargs)

Overloaded function.

  1. GetFixedPoseInBodyFrame(self: pydrake.multibody.tree.Frame_[AutoDiffXd]) -> pydrake.math.RigidTransform_[AutoDiffXd]

Variant of CalcPoseInBodyFrame() that returns the fixed pose X_BF of this 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.
  1. GetFixedPoseInBodyFrame(self: pydrake.multibody.tree.Frame_[AutoDiffXd]) -> pydrake.math.RigidTransform_[AutoDiffXd]

Variant of CalcPoseInBodyFrame() that returns the fixed pose X_BF of this 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.
GetFixedRotationMatrixInBody(self: pydrake.multibody.tree.Frame_[AutoDiffXd], R_FQ: pydrake.math.RotationMatrix_[AutoDiffXd]) → pydrake.math.RotationMatrix_[AutoDiffXd]

Calculates and returns the rotation matrix R_BQ that relates body frame B to frame Q via this intermediate frame F, i.e., R_BQ = R_BF * R_FQ (B is the body frame to which this frame F is attached).

Parameter R_FQ:
rotation matrix that relates frame F to frame Q.
Raises:
  • RuntimeError if this frame F is a Frame that does not have a
  • fixed offset in the body frame B (i.e., R_BF is not constant).
GetFixedRotationMatrixInBodyFrame(self: pydrake.multibody.tree.Frame_[AutoDiffXd]) → pydrake.math.RotationMatrix_[AutoDiffXd]

Returns the rotation matrix R_BF that relates body frame B to this frame F (B is the body frame to which this frame F is attached).

Raises:
  • RuntimeError if this frame F is a Frame that does not have a
  • fixed offset in the body frame B (i.e., R_BF is not constant).
  • Frame sub-classes that have a constant R_BF must override this
  • method. An example of a frame sub-class not implementing this
  • method would be that of a frame on a soft body, for which its pose
  • in the body frame depends on the state of deformation of the body.
GetParentPlant(self: pydrake.multibody.tree.Frame_[AutoDiffXd]) → drake::multibody::MultibodyPlant<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >
index(self: pydrake.multibody.tree.Frame_[AutoDiffXd]) → pydrake.multibody.tree.FrameIndex
is_body_frame(self: pydrake.multibody.tree.Frame_[AutoDiffXd]) → bool

Returns true if this is the body frame.

is_world_frame(self: pydrake.multibody.tree.Frame_[AutoDiffXd]) → bool

Returns true if this is the world frame.

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.

CalcOffsetPoseInBody(self: pydrake.multibody.tree.Frame_[Expression], context: pydrake.systems.framework.Context_[Expression], X_FQ: pydrake.math.RigidTransform_[Expression]) → pydrake.math.RigidTransform_[Expression]

Given the offset pose X_FQ of a frame Q in this frame F, this method computes the pose X_BQ of frame Q in the body frame B to which this frame is attached. In other words, if the pose of this frame F in the body frame B is X_BF, this method computes the pose X_BQ of frame Q in the body frame B as X_BQ = X_BF * X_FQ. In particular, if this **is**` the body frame B, i.e. X_BF is the identity transformation, this method directly returns X_FQ. Specific frame subclasses can override this method to provide faster implementations if needed.

CalcOffsetRotationMatrixInBody(self: pydrake.multibody.tree.Frame_[Expression], context: pydrake.systems.framework.Context_[Expression], R_FQ: pydrake.math.RotationMatrix_[Expression]) → pydrake.math.RotationMatrix_[Expression]

Calculates and returns the rotation matrix R_BQ that relates body frame B to frame Q via this intermediate frame F, i.e., R_BQ = R_BF * R_FQ (B is the body frame to which this frame F is attached).

Parameter R_FQ:
rotation matrix that relates frame F to frame Q.
CalcPose(self: pydrake.multibody.tree.Frame_[Expression], context: pydrake.systems.framework.Context_[Expression], frame_M: pydrake.multibody.tree.Frame_[Expression]) → pydrake.math.RigidTransform_[Expression]

Computes and returns the pose X_MF of this frame F in measured in frame_M as a function of the state of the model stored in context.

See also

CalcPoseInWorld().

CalcPoseInBodyFrame(self: pydrake.multibody.tree.Frame_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.math.RigidTransform_[Expression]

Returns the pose X_BF of this frame F in the body frame B associated with this frame. In particular, if this is the body frame B, this method directly returns the identity transformation.

CalcPoseInWorld(self: pydrake.multibody.tree.Frame_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.math.RigidTransform_[Expression]

Computes and returns the pose X_WF of this frame F in the world frame W as a function of the state of the model stored in context.

Note

Body::EvalPoseInWorld() provides a more efficient way to obtain the pose for a body frame.

CalcRotationMatrix(self: pydrake.multibody.tree.Frame_[Expression], context: pydrake.systems.framework.Context_[Expression], frame_M: pydrake.multibody.tree.Frame_[Expression]) → pydrake.math.RotationMatrix_[Expression]

Calculates and returns the rotation matrix R_MF that relates frame_M and this frame F as a function of the state stored in context.

CalcRotationMatrixInBodyFrame(self: pydrake.multibody.tree.Frame_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.math.RotationMatrix_[Expression]

Returns the rotation matrix R_BF that relates body frame B to this frame F (B is the body frame to which this frame F is attached).

Note

If this is B, this method returns the identity RotationMatrix.

CalcRotationMatrixInWorld(self: pydrake.multibody.tree.Frame_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.math.RotationMatrix_[Expression]

Calculates and returns the rotation matrix R_WF that relates the world frame W and this frame F as a function of the state stored in context.

CalcSpatialAccelerationInWorld(self: pydrake.multibody.tree.Frame_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.multibody.math.SpatialAcceleration_[Expression]

Computes and returns the spatial acceleration A_WF_W of this frame F in world frame W expressed in W as a function of the state stored in context.

Note

Body::EvalSpatialAccelerationInWorld() provides a more efficient way to obtain the spatial acceleration for a body frame.

Note

When cached values are out of sync with the state stored in context, this method performs an expensive forward dynamics computation, whereas once evaluated, successive calls to this method are inexpensive.

CalcSpatialVelocity(self: pydrake.multibody.tree.Frame_[Expression], context: pydrake.systems.framework.Context_[Expression], frame_M: pydrake.multibody.tree.Frame_[Expression], frame_E: pydrake.multibody.tree.Frame_[Expression]) → pydrake.multibody.math.SpatialVelocity_[Expression]

Computes and returns the spatial velocity V_MF_E of this frame F measured in frame_M and expressed in frame_E as a function of the state of the model stored in context.

See also

CalcSpatialVelocityInWorld().

CalcSpatialVelocityInWorld(self: pydrake.multibody.tree.Frame_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.multibody.math.SpatialVelocity_[Expression]

Computes and returns the spatial velocity V_WF of this frame F in the world frame W as a function of the state of the model stored in context.

Note

Body::EvalSpatialVelocityInWorld() provides a more efficient way to obtain the spatial velocity for a body frame.

GetFixedOffsetPoseInBody(self: pydrake.multibody.tree.Frame_[Expression], X_FQ: pydrake.math.RigidTransform_[Expression]) → pydrake.math.RigidTransform_[Expression]

Variant of CalcOffsetPoseInBody() that given the offset pose X_FQ of a frame Q in this frame F, returns the pose X_BQ of frame Q in the body frame B to which this frame is attached.

Raises:
  • RuntimeError if called on a Frame that does not have a fixed
  • offset in the body frame.
GetFixedPoseInBodyFrame(*args, **kwargs)

Overloaded function.

  1. GetFixedPoseInBodyFrame(self: pydrake.multibody.tree.Frame_[Expression]) -> pydrake.math.RigidTransform_[Expression]

Variant of CalcPoseInBodyFrame() that returns the fixed pose X_BF of this 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.
  1. GetFixedPoseInBodyFrame(self: pydrake.multibody.tree.Frame_[Expression]) -> pydrake.math.RigidTransform_[Expression]

Variant of CalcPoseInBodyFrame() that returns the fixed pose X_BF of this 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.
GetFixedRotationMatrixInBody(self: pydrake.multibody.tree.Frame_[Expression], R_FQ: pydrake.math.RotationMatrix_[Expression]) → pydrake.math.RotationMatrix_[Expression]

Calculates and returns the rotation matrix R_BQ that relates body frame B to frame Q via this intermediate frame F, i.e., R_BQ = R_BF * R_FQ (B is the body frame to which this frame F is attached).

Parameter R_FQ:
rotation matrix that relates frame F to frame Q.
Raises:
  • RuntimeError if this frame F is a Frame that does not have a
  • fixed offset in the body frame B (i.e., R_BF is not constant).
GetFixedRotationMatrixInBodyFrame(self: pydrake.multibody.tree.Frame_[Expression]) → pydrake.math.RotationMatrix_[Expression]

Returns the rotation matrix R_BF that relates body frame B to this frame F (B is the body frame to which this frame F is attached).

Raises:
  • RuntimeError if this frame F is a Frame that does not have a
  • fixed offset in the body frame B (i.e., R_BF is not constant).
  • Frame sub-classes that have a constant R_BF must override this
  • method. An example of a frame sub-class not implementing this
  • method would be that of a frame on a soft body, for which its pose
  • in the body frame depends on the state of deformation of the body.
GetParentPlant(self: pydrake.multibody.tree.Frame_[Expression]) → drake::multibody::MultibodyPlant<drake::symbolic::Expression>
index(self: pydrake.multibody.tree.Frame_[Expression]) → pydrake.multibody.tree.FrameIndex
is_body_frame(self: pydrake.multibody.tree.Frame_[Expression]) → bool

Returns true if this is the body frame.

is_world_frame(self: pydrake.multibody.tree.Frame_[Expression]) → bool

Returns true if this is the world frame.

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.

CalcOffsetPoseInBody(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float], X_FQ: pydrake.math.RigidTransform_[float]) → pydrake.math.RigidTransform_[float]

Given the offset pose X_FQ of a frame Q in this frame F, this method computes the pose X_BQ of frame Q in the body frame B to which this frame is attached. In other words, if the pose of this frame F in the body frame B is X_BF, this method computes the pose X_BQ of frame Q in the body frame B as X_BQ = X_BF * X_FQ. In particular, if this **is**` the body frame B, i.e. X_BF is the identity transformation, this method directly returns X_FQ. Specific frame subclasses can override this method to provide faster implementations if needed.

CalcOffsetRotationMatrixInBody(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float], R_FQ: pydrake.math.RotationMatrix_[float]) → pydrake.math.RotationMatrix_[float]

Calculates and returns the rotation matrix R_BQ that relates body frame B to frame Q via this intermediate frame F, i.e., R_BQ = R_BF * R_FQ (B is the body frame to which this frame F is attached).

Parameter R_FQ:
rotation matrix that relates frame F to frame Q.
CalcPose(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float], frame_M: pydrake.multibody.tree.Frame_[float]) → pydrake.math.RigidTransform_[float]

Computes and returns the pose X_MF of this frame F in measured in frame_M as a function of the state of the model stored in context.

See also

CalcPoseInWorld().

CalcPoseInBodyFrame(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.math.RigidTransform_[float]

Returns the pose X_BF of this frame F in the body frame B associated with this frame. In particular, if this is the body frame B, this method directly returns the identity transformation.

CalcPoseInWorld(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.math.RigidTransform_[float]

Computes and returns the pose X_WF of this frame F in the world frame W as a function of the state of the model stored in context.

Note

Body::EvalPoseInWorld() provides a more efficient way to obtain the pose for a body frame.

CalcRotationMatrix(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float], frame_M: pydrake.multibody.tree.Frame_[float]) → pydrake.math.RotationMatrix_[float]

Calculates and returns the rotation matrix R_MF that relates frame_M and this frame F as a function of the state stored in context.

CalcRotationMatrixInBodyFrame(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.math.RotationMatrix_[float]

Returns the rotation matrix R_BF that relates body frame B to this frame F (B is the body frame to which this frame F is attached).

Note

If this is B, this method returns the identity RotationMatrix.

CalcRotationMatrixInWorld(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.math.RotationMatrix_[float]

Calculates and returns the rotation matrix R_WF that relates the world frame W and this frame F as a function of the state stored in context.

CalcSpatialAccelerationInWorld(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.multibody.math.SpatialAcceleration_[float]

Computes and returns the spatial acceleration A_WF_W of this frame F in world frame W expressed in W as a function of the state stored in context.

Note

Body::EvalSpatialAccelerationInWorld() provides a more efficient way to obtain the spatial acceleration for a body frame.

Note

When cached values are out of sync with the state stored in context, this method performs an expensive forward dynamics computation, whereas once evaluated, successive calls to this method are inexpensive.

CalcSpatialVelocity(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float], frame_M: pydrake.multibody.tree.Frame_[float], frame_E: pydrake.multibody.tree.Frame_[float]) → pydrake.multibody.math.SpatialVelocity_[float]

Computes and returns the spatial velocity V_MF_E of this frame F measured in frame_M and expressed in frame_E as a function of the state of the model stored in context.

See also

CalcSpatialVelocityInWorld().

CalcSpatialVelocityInWorld(self: pydrake.multibody.tree.Frame_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.multibody.math.SpatialVelocity_[float]

Computes and returns the spatial velocity V_WF of this frame F in the world frame W as a function of the state of the model stored in context.

Note

Body::EvalSpatialVelocityInWorld() provides a more efficient way to obtain the spatial velocity for a body frame.

GetFixedOffsetPoseInBody(self: pydrake.multibody.tree.Frame_[float], X_FQ: pydrake.math.RigidTransform_[float]) → pydrake.math.RigidTransform_[float]

Variant of CalcOffsetPoseInBody() that given the offset pose X_FQ of a frame Q in this frame F, returns the pose X_BQ of frame Q in the body frame B to which this frame is attached.

Raises:
  • RuntimeError if called on a Frame that does not have a fixed
  • offset in the body frame.
GetFixedPoseInBodyFrame(*args, **kwargs)

Overloaded function.

  1. GetFixedPoseInBodyFrame(self: pydrake.multibody.tree.Frame_[float]) -> pydrake.math.RigidTransform_[float]

Variant of CalcPoseInBodyFrame() that returns the fixed pose X_BF of this 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.
  1. GetFixedPoseInBodyFrame(self: pydrake.multibody.tree.Frame_[float]) -> pydrake.math.RigidTransform_[float]

Variant of CalcPoseInBodyFrame() that returns the fixed pose X_BF of this 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.
GetFixedRotationMatrixInBody(self: pydrake.multibody.tree.Frame_[float], R_FQ: pydrake.math.RotationMatrix_[float]) → pydrake.math.RotationMatrix_[float]

Calculates and returns the rotation matrix R_BQ that relates body frame B to frame Q via this intermediate frame F, i.e., R_BQ = R_BF * R_FQ (B is the body frame to which this frame F is attached).

Parameter R_FQ:
rotation matrix that relates frame F to frame Q.
Raises:
  • RuntimeError if this frame F is a Frame that does not have a
  • fixed offset in the body frame B (i.e., R_BF is not constant).
GetFixedRotationMatrixInBodyFrame(self: pydrake.multibody.tree.Frame_[float]) → pydrake.math.RotationMatrix_[float]

Returns the rotation matrix R_BF that relates body frame B to this frame F (B is the body frame to which this frame F is attached).

Raises:
  • RuntimeError if this frame F is a Frame that does not have a
  • fixed offset in the body frame B (i.e., R_BF is not constant).
  • Frame sub-classes that have a constant R_BF must override this
  • method. An example of a frame sub-class not implementing this
  • method would be that of a frame on a soft body, for which its pose
  • in the body frame depends on the state of deformation of the body.
GetParentPlant(self: pydrake.multibody.tree.Frame_[float]) → drake::multibody::MultibodyPlant<double>
index(self: pydrake.multibody.tree.Frame_[float]) → pydrake.multibody.tree.FrameIndex
is_body_frame(self: pydrake.multibody.tree.Frame_[float]) → bool

Returns true if this is the body frame.

is_world_frame(self: pydrake.multibody.tree.Frame_[float]) → bool

Returns true if this is the world frame.

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, value: int) → None
kQDot = <JacobianWrtVariable.kQDot: 0>
kV = <JacobianWrtVariable.kV: 1>
name
value
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 this Joint object are referred to as parent and child bodies. The parent/child ordering defines the sign conventions for the generalized coordinates and the coordinate ordering for multi-DOF joints. 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. @image html multibody/plant/images/BodyParentChildJoint.png width=50%

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 pose X_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.

AddInDamping(self: pydrake.multibody.tree.Joint_[float], context: pydrake.systems.framework.Context_[float], forces: drake::multibody::MultibodyForces<double>) → None

Adds into forces the force due to damping within this joint.

Parameter context:
The context storing the state and parameters for the model to which this joint belongs.
Parameter forces:
On return, this method will add the force due to damping within this joint. This method aborts if forces is nullptr or if forces does not have the right sizes to accommodate a set of forces for the model to which this joint belongs.
AddInOneForce(self: pydrake.multibody.tree.Joint_[float], context: pydrake.systems.framework.Context_[float], joint_dof: int, joint_tau: float, forces: drake::multibody::MultibodyForces<double>) → None

Adds into forces a force along the one of the joint’s degrees of freedom indicated by index joint_dof. The meaning for this degree of freedom and even its dimensional units depend on the specific joint sub-class. For a RevoluteJoint for instance, joint_dof can only be 0 since revolute joints’s motion subspace only has one degree of freedom, while the units of joint_tau are those of torque (N⋅m in the MKS system of units). For multi-dof joints please refer to the documentation provided by specific joint sub-classes regarding the meaning of joint_dof.

Parameter context:
The context storing the state and parameters for the model to which this joint belongs.
Parameter joint_dof:
Index specifying one of the degrees of freedom for this joint. The index must be in the range 0 <= joint_dof < num_velocities() or otherwise this method will abort.
Parameter joint_tau:
Generalized force corresponding to the degree of freedom indicated by joint_dof to be added into forces.
Parameter forces:
On return, this method will add force joint_tau for the degree of freedom joint_dof into the output forces. This method aborts if forces is nullptr or if forces doest not have the right sizes to accommodate a set of forces for the model to which this joint belongs.
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.

GetOnePosition(self: pydrake.multibody.tree.Joint_[float], context: pydrake.systems.framework.Context_[float]) → float

Returns the position coordinate for joints with a single degree of freedom.

Raises:
  • RuntimeError if the joint does not have a single degree of
  • freedom.
GetOneVelocity(self: pydrake.multibody.tree.Joint_[float], context: pydrake.systems.framework.Context_[float]) → float

Returns the velocity coordinate for joints with a single degree of freedom.

Raises:
  • RuntimeError if the joint does not have a single degree of
  • freedom.
GetParentPlant(self: pydrake.multibody.tree.Joint_[float]) → drake::multibody::MultibodyPlant<double>
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 and upper_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.
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 within position_lower_limits() and position_upper_limits().

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 and upper_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 current default_positions() satisfy the new position limits.

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 and upper_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.
type_name(self: pydrake.multibody.tree.Joint_[float]) → str

Returns a string identifying the type of this joint, such as “revolute” or “prismatic”.

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 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 this Joint object are referred to as parent and child bodies. The parent/child ordering defines the sign conventions for the generalized coordinates and the coordinate ordering for multi-DOF joints. 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. @image html multibody/plant/images/BodyParentChildJoint.png width=50%

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 pose X_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.

AddInDamping(self: pydrake.multibody.tree.Joint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], forces: drake::multibody::MultibodyForces<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >) → None

Adds into forces the force due to damping within this joint.

Parameter context:
The context storing the state and parameters for the model to which this joint belongs.
Parameter forces:
On return, this method will add the force due to damping within this joint. This method aborts if forces is nullptr or if forces does not have the right sizes to accommodate a set of forces for the model to which this joint belongs.
AddInOneForce(self: pydrake.multibody.tree.Joint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], joint_dof: int, joint_tau: pydrake.autodiffutils.AutoDiffXd, forces: drake::multibody::MultibodyForces<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >) → None

Adds into forces a force along the one of the joint’s degrees of freedom indicated by index joint_dof. The meaning for this degree of freedom and even its dimensional units depend on the specific joint sub-class. For a RevoluteJoint for instance, joint_dof can only be 0 since revolute joints’s motion subspace only has one degree of freedom, while the units of joint_tau are those of torque (N⋅m in the MKS system of units). For multi-dof joints please refer to the documentation provided by specific joint sub-classes regarding the meaning of joint_dof.

Parameter context:
The context storing the state and parameters for the model to which this joint belongs.
Parameter joint_dof:
Index specifying one of the degrees of freedom for this joint. The index must be in the range 0 <= joint_dof < num_velocities() or otherwise this method will abort.
Parameter joint_tau:
Generalized force corresponding to the degree of freedom indicated by joint_dof to be added into forces.
Parameter forces:
On return, this method will add force joint_tau for the degree of freedom joint_dof into the output forces. This method aborts if forces is nullptr or if forces doest not have the right sizes to accommodate a set of forces for the model to which this joint belongs.
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.

GetOnePosition(self: pydrake.multibody.tree.Joint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.autodiffutils.AutoDiffXd

Returns the position coordinate for joints with a single degree of freedom.

Raises:
  • RuntimeError if the joint does not have a single degree of
  • freedom.
GetOneVelocity(self: pydrake.multibody.tree.Joint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.autodiffutils.AutoDiffXd

Returns the velocity coordinate for joints with a single degree of freedom.

Raises:
  • RuntimeError if the joint does not have a single degree of
  • freedom.
GetParentPlant(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → drake::multibody::MultibodyPlant<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >
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 and upper_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.
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 within position_lower_limits() and position_upper_limits().

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 and upper_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 current default_positions() satisfy the new position limits.

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 and upper_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.
type_name(self: pydrake.multibody.tree.Joint_[AutoDiffXd]) → str

Returns a string identifying the type of this joint, such as “revolute” or “prismatic”.

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 this Joint object are referred to as parent and child bodies. The parent/child ordering defines the sign conventions for the generalized coordinates and the coordinate ordering for multi-DOF joints. 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. @image html multibody/plant/images/BodyParentChildJoint.png width=50%

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 pose X_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.

AddInDamping(self: pydrake.multibody.tree.Joint_[Expression], context: pydrake.systems.framework.Context_[Expression], forces: drake::multibody::MultibodyForces<drake::symbolic::Expression>) → None

Adds into forces the force due to damping within this joint.

Parameter context:
The context storing the state and parameters for the model to which this joint belongs.
Parameter forces:
On return, this method will add the force due to damping within this joint. This method aborts if forces is nullptr or if forces does not have the right sizes to accommodate a set of forces for the model to which this joint belongs.
AddInOneForce(self: pydrake.multibody.tree.Joint_[Expression], context: pydrake.systems.framework.Context_[Expression], joint_dof: int, joint_tau: pydrake.symbolic.Expression, forces: drake::multibody::MultibodyForces<drake::symbolic::Expression>) → None

Adds into forces a force along the one of the joint’s degrees of freedom indicated by index joint_dof. The meaning for this degree of freedom and even its dimensional units depend on the specific joint sub-class. For a RevoluteJoint for instance, joint_dof can only be 0 since revolute joints’s motion subspace only has one degree of freedom, while the units of joint_tau are those of torque (N⋅m in the MKS system of units). For multi-dof joints please refer to the documentation provided by specific joint sub-classes regarding the meaning of joint_dof.

Parameter context:
The context storing the state and parameters for the model to which this joint belongs.
Parameter joint_dof:
Index specifying one of the degrees of freedom for this joint. The index must be in the range 0 <= joint_dof < num_velocities() or otherwise this method will abort.
Parameter joint_tau:
Generalized force corresponding to the degree of freedom indicated by joint_dof to be added into forces.
Parameter forces:
On return, this method will add force joint_tau for the degree of freedom joint_dof into the output forces. This method aborts if forces is nullptr or if forces doest not have the right sizes to accommodate a set of forces for the model to which this joint belongs.
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.

GetOnePosition(self: pydrake.multibody.tree.Joint_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.symbolic.Expression

Returns the position coordinate for joints with a single degree of freedom.

Raises:
  • RuntimeError if the joint does not have a single degree of
  • freedom.
GetOneVelocity(self: pydrake.multibody.tree.Joint_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.symbolic.Expression

Returns the velocity coordinate for joints with a single degree of freedom.

Raises:
  • RuntimeError if the joint does not have a single degree of
  • freedom.
GetParentPlant(self: pydrake.multibody.tree.Joint_[Expression]) → drake::multibody::MultibodyPlant<drake::symbolic::Expression>
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 and upper_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.
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 within position_lower_limits() and position_upper_limits().

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 and upper_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 current default_positions() satisfy the new position limits.

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 and upper_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.
type_name(self: pydrake.multibody.tree.Joint_[Expression]) → str

Returns a string identifying the type of this joint, such as “revolute” or “prismatic”.

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 this Joint object are referred to as parent and child bodies. The parent/child ordering defines the sign conventions for the generalized coordinates and the coordinate ordering for multi-DOF joints. 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. @image html multibody/plant/images/BodyParentChildJoint.png width=50%

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 pose X_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.

AddInDamping(self: pydrake.multibody.tree.Joint_[float], context: pydrake.systems.framework.Context_[float], forces: drake::multibody::MultibodyForces<double>) → None

Adds into forces the force due to damping within this joint.

Parameter context:
The context storing the state and parameters for the model to which this joint belongs.
Parameter forces:
On return, this method will add the force due to damping within this joint. This method aborts if forces is nullptr or if forces does not have the right sizes to accommodate a set of forces for the model to which this joint belongs.
AddInOneForce(self: pydrake.multibody.tree.Joint_[float], context: pydrake.systems.framework.Context_[float], joint_dof: int, joint_tau: float, forces: drake::multibody::MultibodyForces<double>) → None

Adds into forces a force along the one of the joint’s degrees of freedom indicated by index joint_dof. The meaning for this degree of freedom and even its dimensional units depend on the specific joint sub-class. For a RevoluteJoint for instance, joint_dof can only be 0 since revolute joints’s motion subspace only has one degree of freedom, while the units of joint_tau are those of torque (N⋅m in the MKS system of units). For multi-dof joints please refer to the documentation provided by specific joint sub-classes regarding the meaning of joint_dof.

Parameter context:
The context storing the state and parameters for the model to which this joint belongs.
Parameter joint_dof:
Index specifying one of the degrees of freedom for this joint. The index must be in the range 0 <= joint_dof < num_velocities() or otherwise this method will abort.
Parameter joint_tau:
Generalized force corresponding to the degree of freedom indicated by joint_dof to be added into forces.
Parameter forces:
On return, this method will add force joint_tau for the degree of freedom joint_dof into the output forces. This method aborts if forces is nullptr or if forces doest not have the right sizes to accommodate a set of forces for the model to which this joint belongs.
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.

GetOnePosition(self: pydrake.multibody.tree.Joint_[float], context: pydrake.systems.framework.Context_[float]) → float

Returns the position coordinate for joints with a single degree of freedom.

Raises:
  • RuntimeError if the joint does not have a single degree of
  • freedom.
GetOneVelocity(self: pydrake.multibody.tree.Joint_[float], context: pydrake.systems.framework.Context_[float]) → float

Returns the velocity coordinate for joints with a single degree of freedom.

Raises:
  • RuntimeError if the joint does not have a single degree of
  • freedom.
GetParentPlant(self: pydrake.multibody.tree.Joint_[float]) → drake::multibody::MultibodyPlant<double>
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 and upper_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.
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 within position_lower_limits() and position_upper_limits().

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 and upper_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 current default_positions() satisfy the new position limits.

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 and upper_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.
type_name(self: pydrake.multibody.tree.Joint_[float]) → str

Returns a string identifying the type of this joint, such as “revolute” or “prismatic”.

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

alias of pydrake.multibody.tree.JointActuator_[float]

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.

get_actuation_vector(self: pydrake.multibody.tree.JointActuator_[float], u: numpy.ndarray[numpy.float64[m, 1]]) → numpy.ndarray[numpy.float64[m, 1]]

Gets the actuation values for this actuator from the actuation vector u for the entire model.

Returns:a reference to a nv-dimensional vector, where nv is the number of velocity variables of joint().
GetParentPlant(self: pydrake.multibody.tree.JointActuator_[float]) → drake::multibody::MultibodyPlant<double>
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.

set_actuation_vector(self: pydrake.multibody.tree.JointActuator_[float], u_instance: numpy.ndarray[numpy.float64[m, 1]], u: numpy.ndarray[numpy.float64[m, 1], flags.writeable]) → None

Given the actuation values u_instance for this actuator, this method sets the actuation vector u for the entire MultibodyTree model to which this actuator belongs to.

Parameter u_instance:
Actuation values for this actuator. It must be of size equal to the number of degrees of freedom of the actuated Joint, see Joint::num_velocities(). For units and sign conventions refer to the specific Joint sub-class documentation.
Parameter u:
The vector containing the actuation values for the entire MultibodyTree model to which this actuator belongs to.
Raises:
  • RuntimeError if ``u_instance.size() !=
  • this->joint().num_velocities()``.
Raises:

RuntimeError if u is nullptr.

Raises:
  • RuntimeError if ``u.size() !=
  • this->get_parent_tree().num_actuated_dofs()``.
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.

get_actuation_vector(self: pydrake.multibody.tree.JointActuator_[AutoDiffXd], u: numpy.ndarray[object[m, 1]]) → numpy.ndarray[object[m, 1]]

Gets the actuation values for this actuator from the actuation vector u for the entire model.

Returns:a reference to a nv-dimensional vector, where nv is the number of velocity variables of joint().
GetParentPlant(self: pydrake.multibody.tree.JointActuator_[AutoDiffXd]) → drake::multibody::MultibodyPlant<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >
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.

set_actuation_vector(self: pydrake.multibody.tree.JointActuator_[AutoDiffXd], u_instance: numpy.ndarray[object[m, 1]], u: numpy.ndarray[object[m, 1], flags.writeable]) → None

Given the actuation values u_instance for this actuator, this method sets the actuation vector u for the entire MultibodyTree model to which this actuator belongs to.

Parameter u_instance:
Actuation values for this actuator. It must be of size equal to the number of degrees of freedom of the actuated Joint, see Joint::num_velocities(). For units and sign conventions refer to the specific Joint sub-class documentation.
Parameter u:
The vector containing the actuation values for the entire MultibodyTree model to which this actuator belongs to.
Raises:
  • RuntimeError if ``u_instance.size() !=
  • this->joint().num_velocities()``.
Raises:

RuntimeError if u is nullptr.

Raises:
  • RuntimeError if ``u.size() !=
  • this->get_parent_tree().num_actuated_dofs()``.
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.

get_actuation_vector(self: pydrake.multibody.tree.JointActuator_[Expression], u: numpy.ndarray[object[m, 1]]) → numpy.ndarray[object[m, 1]]

Gets the actuation values for this actuator from the actuation vector u for the entire model.

Returns:a reference to a nv-dimensional vector, where nv is the number of velocity variables of joint().
GetParentPlant(self: pydrake.multibody.tree.JointActuator_[Expression]) → drake::multibody::MultibodyPlant<drake::symbolic::Expression>
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.

set_actuation_vector(self: pydrake.multibody.tree.JointActuator_[Expression], u_instance: numpy.ndarray[object[m, 1]], u: numpy.ndarray[object[m, 1], flags.writeable]) → None

Given the actuation values u_instance for this actuator, this method sets the actuation vector u for the entire MultibodyTree model to which this actuator belongs to.

Parameter u_instance:
Actuation values for this actuator. It must be of size equal to the number of degrees of freedom of the actuated Joint, see Joint::num_velocities(). For units and sign conventions refer to the specific Joint sub-class documentation.
Parameter u:
The vector containing the actuation values for the entire MultibodyTree model to which this actuator belongs to.
Raises:
  • RuntimeError if ``u_instance.size() !=
  • this->joint().num_velocities()``.
Raises:

RuntimeError if u is nullptr.

Raises:
  • RuntimeError if ``u.size() !=
  • this->get_parent_tree().num_actuated_dofs()``.
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.

get_actuation_vector(self: pydrake.multibody.tree.JointActuator_[float], u: numpy.ndarray[numpy.float64[m, 1]]) → numpy.ndarray[numpy.float64[m, 1]]

Gets the actuation values for this actuator from the actuation vector u for the entire model.

Returns:a reference to a nv-dimensional vector, where nv is the number of velocity variables of joint().
GetParentPlant(self: pydrake.multibody.tree.JointActuator_[float]) → drake::multibody::MultibodyPlant<double>
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.

set_actuation_vector(self: pydrake.multibody.tree.JointActuator_[float], u_instance: numpy.ndarray[numpy.float64[m, 1]], u: numpy.ndarray[numpy.float64[m, 1], flags.writeable]) → None

Given the actuation values u_instance for this actuator, this method sets the actuation vector u for the entire MultibodyTree model to which this actuator belongs to.

Parameter u_instance:
Actuation values for this actuator. It must be of size equal to the number of degrees of freedom of the actuated Joint, see Joint::num_velocities(). For units and sign conventions refer to the specific Joint sub-class documentation.
Parameter u:
The vector containing the actuation values for the entire MultibodyTree model to which this actuator belongs to.
Raises:
  • RuntimeError if ``u_instance.size() !=
  • this->joint().num_velocities()``.
Raises:

RuntimeError if u is nullptr.

Raises:
  • RuntimeError if ``u.size() !=
  • this->get_parent_tree().num_actuated_dofs()``.
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.LinearBushingRollPitchYaw

alias of pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]

template pydrake.multibody.tree.LinearBushingRollPitchYaw_

Instantiations: LinearBushingRollPitchYaw_[float], LinearBushingRollPitchYaw_[AutoDiffXd], LinearBushingRollPitchYaw_[Expression]

class LinearBushingRollPitchYaw_[float]

Bases: pydrake.multibody.tree.ForceElement_[float]

This ForceElement models a massless flexible bushing that connects a frame A of a link (body) L0 to a frame C of a link (body) L1. The bushing can apply a torque and force due to stiffness (spring) and dissipation (damper) properties. Frame B is the bushing frame whose origin Bo is halfway between Ao (A’s origin) and Co (C’s origin) and whose unit vectors 𝐁𝐱, 𝐁𝐲, 𝐁𝐳 are “halfway” (in an angle-axis sense) between the unit vectors of frame A and frame C. Frame B is a “floating” frame in the sense that it is calculated from the position and orientation of frames A and C (B is not welded to the bushing). @image html multibody/tree/images/LinearBushingRollPitchYaw.png width=80%

The set of forces on frame C from the bushing is equivalent to a torque 𝐭 on frame C and a force 𝐟 applied to a point Cp of C. The set of forces on frame A from the bushing is equivalent to a torque −𝐭 on frame A and a force −𝐟 applied to a point Ap of A. Points Ap and Cp are coincident with Bo (frame B’s origin).

This “quasi-symmetric” bushing force/torque model was developed at Toyota Research Institute and has advantages compared to traditional bushing models because it employs a bushing-centered “symmetric” frame B and it ensures the moment of −𝐟 on A about Ao is equal to the moment of 𝐟 on C about Co. Traditional models differ as they lack a “symmetric” frame B and apply −𝐟 at Ao, which means the moment of −𝐟 on A about Ao is always zero. Note: This bushing model is not fully symmetric since the orientation between frames A and C is parameterized with roll-pitch-yaw angles [q₀ q₁ q₂]. Since these angles have an inherent sequence, they are not mathematically symmetric.

The torque model depends on spring-damper “gimbal” torques τ [τ₀ τ₁ τ₂] which themselves depend on roll-pitch-yaw angles q [q₀ q₁ q₂] and rates = [q̇₀ q̇₁ q̇₂] via a diagonal torque-stiffness matrix K₀₁₂ and a diagonal torque-damping matrix D₀₁₂ as

⌈ τ₀ ⌉     ⌈k₀    0    0⌉ ⌈ q₀ ⌉     ⌈d₀    0    0⌉ ⌈ q̇₀ ⌉
τ ≜ | τ₁ | = − | 0   k₁    0| | q₁ |  −  | 0   d₁    0| | q̇₁ |
    ⌊ τ₂ ⌋     ⌊ 0    0   k₂⌋ ⌊ q₂ ⌋     ⌊ 0    0   d₂⌋ ⌊ q̇₂ ⌋

where k₀, k₁, k₂ and d₀, d₁, d₂ are torque stiffness and damping constants and must have non-negative values.

Note

τ does not represent a vector expressed in one frame. Instead it is regarded as a 3x1 array of torque scalars associated with roll-pitch yaw.

Note

As discussed in the Advanced section below, τ is not 𝐭 𝐭).

Note

This is a “linear” bushing model as gimbal torque τ varies linearly with q and q̇ as τ = τᴋ + τᴅ where τᴋ = −K₀₁₂ ⋅ q and τᴅ = −D₀₁₂ ⋅ q̇.

The bushing model for the net force 𝐟 on frame C from the bushing depends on scalars x, y, z which are defined so 𝐫 (the position vector from Ao to Co) can be expressed in frame B as 𝐫 p_AoCo = [x y z]ʙ = x 𝐁𝐱 + y 𝐁𝐲 + z 𝐁𝐳. The model for 𝐟 uses a diagonal force-stiffness matrix Kxyᴢ, a diagonal force-damping matrix Dxyᴢ, and defines fx, fy, fz so 𝐟 = [fx fy fz]ʙ.

⌈ fx ⌉      ⌈kx    0    0⌉ ⌈ x ⌉     ⌈dx    0    0⌉ ⌈ ẋ ⌉
| fy | =  − | 0   ky    0| | y |  −  | 0   dy    0| | ẏ |
⌊ fz ⌋      ⌊ 0    0   kz⌋ ⌊ z ⌋     ⌊ 0    0   dz⌋ ⌊ ż ⌋

where kx, ky, kz and dx, dy, dz are force stiffness and damping constants and must have non-negative values.

Note

This is a “linear” bushing model as the force 𝐟 varies linearly with 𝐫 and 𝐫̇̇ as 𝐟 = 𝐟ᴋ + 𝐟ᴅ where 𝐟ᴋ = −Kxyz ⋅ 𝐫 and 𝐟ᴅ = −Dxyz ⋅ 𝐫̇̇.

This bushing’s constructor sets the torque stiffness/damping constants [k₀ k₁ k₂] and [d₀ d₁ d₂] and the force stiffness/damping constants [kx ky kz] and [dx dy dz]. The examples below demonstrate how to model various joints that have a flexible (e.g., rubber) mount. The damping values below with ? may be set to 0 or a reasonable positive number.

Bushing type | torque constants | force constants ——————————–|:--------------------|:—————— z-axis revolute joint | k₀₁₂ = [k₀ k₁ 0] | kxyz = [kx ky kz] ^ | d₀₁₂ = [d₀ d₁ ?] | dxyz = [dx dy dz] x-axis prismatic joint | k₀₁₂ = [k₀ k₁ k₂] | kxyz = [0 ky kz] ^ | d₀₁₂ = [d₀ d₁ d₂] | dxyz = [? dy dz] Ball and socket joint | k₀₁₂ = [0 0 0] | kxyz = [kx ky kz] ^ | d₀₁₂ = [? ? ?] | dxyz = [dx dy dz] Weld/fixed joint | k₀₁₂ = [k₀ k₁ k₂] | kxyz = [kx ky kz] ^ | d₀₁₂ = [d₀ d₁ d₂] | dxyz = [dx dy dz]

Angles q₀, q₁, q₂ are calculated from frame C’s orientation relative to frame A, with [−π < q₀ π, −π/2 q₁ π/2, −π < q₂ π], hence, there is no angle wrapping and torque stiffness has a limited range. Gimbal torques τ can be discontinuous if one of q₀, q₁, q₂ is discontinuous and its associated torque spring constant is nonzero. For example, τ₂ is discontinuous if k₂ 0 and the bushing has a large rotation so q₂ jumps from −π to π. τ can also be discontinuous if one of q̇₀, q̇₁, q̇₂ is discontinuous and its associated torque damper constant is nonzero. For example, τ₀ is discontinuous if d₀ 0 and q̇₀ is undefined (which occurs when pitch = q₁ = π/2). Note: Due to the relationship of 𝐭 to τ shown below, 𝐭 is discontinuous if τ is discontinuous.

As shown below, there are multiple ways to estimate torque and force stiffness and damping constants. Use a method or combination of methods appropriate for your application. For example, some methods are more useful for a real physical bushing whereas other methods (called “penalty methods”) can be more useful when replacing an ideal joint (such as a revolute or fixed/weld joint) with a bushing.

Consider a penalty method if you want a bushing to substitute for a “hard” constraint (e.g., an ideal joint). Since a bushing is inherently compliant it will violate a hard constraint somewhat. The stiffer the bushing, the more accurately it enforces the hard constraint, but at a cost of more computational time. To balance accuracy versus time, consider your tolerance for constraint errors. For example, is it OK for your bushing to displace xₘₐₓ = 1 mm for an estimated Fxₘₐₓ = 100 N? Also, one way to choose a force damping constant dx is by choosing a “reasonably small” settling time tₛ, where settling time tₛ is the interval of time for a system to settle to within 1% (0.01) of an equilibrium solution). Is tₛ = 0.01 s negligible for a robot arm with a 10 s reach maneuver?

**** How to choose a torque stiffness constant k₀ or damping constant d₀. The estimate of stiffness k₀ depends on whether you are modeling a physical bushing (consider stiffness methods 1 or 2 below) or whether you are using a bushing to replace an ideal joint such as a revolute or fixed/weld joint (consider stiffness “penalty methods” 3 or 4 below). 1. Use a static experiment, e.g., apply a known moment load Mx, measure the associated angular displacement Δq (radians), and estimate k₀ = Mx / Δq. 2. Use FEA (finite element analysis) software to estimate k₀. 3. Pick a desired maximum angular displacement qₘₐₓ, estimate a maximum moment load Mxₘₐₓ, and estimate k₀ = Mxₘₐₓ / qₘₐₓ (units of N*m/rad). 4. Choose a characteristic moment of inertia I₀ (directionally dependent), choose a desired angular frequency ωₙ > 0 (in rad/s) and estimate k₀ = I₀ ωₙ² (units of N*m/rad).

The estimate of damping d₀ depends on whether you are modeling a physical bushing (consider damping method 1 below) or whether you are using a bushing to enforce a constraint (consider damping methods 2 or 3 below). 1. Use experiments to estimate a damping ratio ζ and settling time tₛ. Compute “undamped natural frequency” ωₙ from ζ and tₛ (as shown below in the Advanced section), then d₀ = 2 ζ k₀ / ωₙ (units of N*m*s/rad). 2. Choose a damping ratio ζ (e.g., ζ = 1, critical damping) and a desired settling time tₛ, calculate ωₙ (as shown below in the Advanced section), then d₀ = 2 ζ k₀ / ωₙ (units of N*m*s/rad). 3. Choose a damping ratio ζ (e.g., ζ = 1, critical damping), estimate a characteristic moment of inertia and calculate d₀ = 2 ζ √(I₀ k₀).

Refer to Advanced_bushing_stiffness_and_damping “Advanced bushing stiffness and damping” for more details.

**** How to choose a force stiffness constant kx or damping constant dx. The estimate of stiffness kx depends on whether you are modeling a real bushing (consider stiffness methods 1 or 2 below) or whether you are using a bushing to replace an ideal joint such as a revolute or fixed/weld joint (consider stiffness “penalty methods” 3 or 4 below). 1. Use a static experiment, e.g., apply a known force load Fx, measure the associated displacement (stretch) Δx (in meters), and estimate kx = Fx / Δx. 2. Use FEA (finite element analysis) software to estimate kx (units of N/m). 3. Pick a desired maximum displacement xₘₐₓ, estimate a maximum force load Fxₘₐₓ, and estimate kx = Fxₘₐₓ / xₘₐₓ (units of N/m). 4. Choose a characteristic mass m (which may be directionally dependent), choose a desired angular frequency ωₙ > 0 (in rad/s) and estimate kx = m ωₙ² (units of N/m).

The estimate of damping dx depends on whether you are modeling a physical bushing (consider damping method 1 below) or whether you are using a bushing to enforce a constraint (consider damping methods 2 or 3 below). 1. Use experiments to estimate a damping ratio ζ and settling time tₛ. Compute “undamped natural frequency” ωₙ from ζ and tₛ (as shown below in the Advanced section), then dx = 2 ζ kx / ωₙ (units of N*s/m). 2. Choose a damping ratio ζ (e.g., ζ = 1, critical damping) and a desired settling time tₛ, calculate ωₙ (as shown below in the Advanced section), then dx = 2 ζ kx / ωₙ (units of N*s/m). 3. Choose a damping ratio ζ (e.g., ζ = 1, critical damping), estimate a characteristic mass m and calculate dx = 2 ζ √(m kx) (units of N*s/m).

Refer to Advanced_bushing_stiffness_and_damping “Advanced bushing stiffness and damping” for more details.

**** Advanced: Relationship of 𝐭 to τ. To understand how “gimbal torques” τ relate to 𝐭, it helps to remember that the RollPitchYaw class documentation states that a Space-fixed (extrinsic) X-Y-Z rotation with roll-pitch-yaw angles [q₀ q₁ q₂] is equivalent to a Body-fixed (intrinsic) Z-Y-X rotation by yaw-pitch-roll angles [q₂ q₁ q₀]. In the context of “gimbal torques”, the Body-fixed Z-Y-X rotation sequence with angles [q₂ q₁ q₀] is physical meaningful as it produces torques associated with successive frames in a gimbal as τ₂ 𝐀𝐳, τ₁ 𝐏𝐲, τ₀ 𝐂𝐱, where each of 𝐀𝐳, 𝐏𝐲, 𝐂𝐱 are unit vectors associated with a frame in the yaw-pitch-roll rotation sequence and 𝐏𝐲 is a unit vector of the “pitch” intermediate frame. As described earlier, torque 𝐭 is the moment of the bushing forces on frame C about Cp. Scalars tx, ty, tz are defined so 𝐭 can be expressed 𝐭 = [tx ty tz]ᴀ = tx 𝐀𝐱 + ty 𝐀𝐲 + tz 𝐀𝐳. As shown in code documentation, the relationship of [tx ty tz] to [τ₀ τ₁ τ₂] was found by equating 𝐭’s power to τ’s power as 𝐭 ⋅ w_AC = τ ⋅ q̇.

⌈ tx ⌉      ⌈ τ₀ ⌉            ⌈ cos(q₂)/cos(q₁)  sin(q₂)/cos(q₁)   0 ⌉
| ty | = Nᵀ | τ₁ |  where N = |   −sin(q2)            cos(q2)      0 |
⌊ tz ⌋      ⌊ τ₂ ⌋            ⌊ cos(q₂)*tan(q₁)   sin(q₂)*tan(q₁)  1 ⌋

**** Advanced: More on how to choose bushing stiffness and damping constants. The basics on how to choose bushing stiffness and damping constants are at: - Basic_bushing_torque_stiffness_and_damping “How to choose torque stiffness and damping constants” - Basic_bushing_force_stiffness_and_damping “How to choose force stiffness and damping constants”

The list below provides more detail on: The performance tradeoff between high stiffness and long simulation time; loads that affect estimates of Mxₘₐₓ or Fxₘₐₓ; and how a linear 2ⁿᵈ-order ODE provides insight on how to experimentally determine stiffness and damping constants. - Stiffness [k₀ k₁ k₂] and [kx ky kz] affect simulation time and accuracy. Generally, a stiffer bushing better resembles an ideal joint (e.g., a revolute joint or fixed/weld joint). However (depending on integrator), a stiffer bushing usually increases numerical integration time. - An estimate for a maximum load Mxₘₐₓ or Fxₘₐₓ accounts for gravity forces, applied forces, inertia forces (centripetal, Coriolis, gyroscopic), etc. - One way to determine physical stiffness and damping constants is through the mathematical intermediaries ωₙ (units of rad/s) and ζ (no units). The constant ωₙ (called “undamped natural frequency” or “angular frequency”) and constant ζ (called “damping ratio”) relate to the physical constants mass m, damping constant dx, and stiffness constant kx via the following prototypical linear constant-coefficient 2ⁿᵈ-order ODEs.

m ẍ +     dx ẋ +  kx x = 0   or alternatively as
   ẍ + 2 ζ ωₙ ẋ + ωₙ² x = 0   where ωₙ² = kx/m,  ζ = dx / (2 √(m kx))

ωₙ and ζ also appear in the related ODEs for rotational systems, namely

I₀ q̈ +     d₀ q̇ +  k₀ q = 0   or alternatively as
    q̈ + 2 ζ ωₙ q̇ + ωₙ² q = 0   where ωₙ² = k₀/I₀,  ζ = d₀ / (2 √(I₀ k₀))

One way to determine ωₙ is from settling time tₛ which approximates the time for a system to settle to within a specified settling ratio of an equilibrium solutions. Typical values for settling ratio are 1% (0.01), 2% (0.02), 5% (0.05), and 10% (0.10). - When ζ < 0.7 (underdamped), a commonly used approximation is ωₙ ≈ -ln(settling_ratio) / (ζ tₛ) which for settling ratios 0.01 and 0.05 give ωₙ ≈ 4.6 / (ζ tₛ) and ωₙ ≈ 3 / (ζ tₛ). Another commonly used approximation is ωₙ ≈ -ln(settling_ratio √(1- ζ²)) / (ζ tₛ). See https://en.wikipedia.org/wiki/Settling_time or the book Modern Control Engineering by Katsuhiko Ogata. Although these approximate formulas for ωₙ are common, they are somewhat inaccurate. Settling time for underdamped systems is discontinuous and requires solving a nonlinear algebraic equation (an iterative process). For more information, see http://www.scielo.org.co/pdf/rfiua/n66/n66a09.pdf [Ramos-Paja, et. al 2012], “Accurate calculation of settling time in second order systems: a photovoltaic application”. Another reference is https://courses.grainger.illinois.edu/ece486/sp2020/laboratory/docs/lab2/estimates.html - When ζ ≈ 1 (critically damped), ωₙ is determined by choosing a settling ratio and then solving for (ωₙ tₛ) via the nonlinear algebraic equation (1 + ωₙ tₛ)*exp(-ωₙ tₛ) = settling_ratio. Settling ratio | ωₙ ————– | ————- 0.01 | 6.64 / tₛ 0.02 | 5.83 / tₛ 0.05 | 4.74 / tₛ 0.10 | 3.89 / tₛ See https://electronics.stackexchange.com/questions/296567/over-and-critically-damped-systems-settling-time - When ζ ≥ 1.01 (overdamped), ωₙ ≈ -ln(2 settling_ratio sz/s₂) / (s₁ tₛ) where sz = √(ζ² - 1), s₁ = ζ - sz, s₂ = ζ + sz. The derivation and approximation error estimates for this overdamped settling time formula is ApproximateOverdampedSettlingTime “below”.

  • For a real physical bushing, an experiment is one way to estimate damping

constants. For example, to estimate a torque damping constant d₀ associated with underdamped vibrations (damping ratio 0 < ζ < 1), attach the bushing to a massive rod, initially displace the rod by angle Δq, release the rod and measure q(t). From the q(t) measurement, estimate decay ratio (the ratio of successive peak heights above the final steady-state value) calculate logarithmic decrement δ = -ln(decay_ratio), calculate damping ratio ζ = √(δ² / (4π² + δ²)), then calculate d₀ using d₀ = 2 ζ √(I₀ k₀) or d₀ = 2 ζ k₀ / ωₙ. For more information, see https://en.wikipedia.org/wiki/Damping_ratio#Logarithmic_decrement

**** Derivation: Approximate formula for overdamped settling time. Since a literature reference for this formula was not found, the derivation below was done at TRI (it has not been peer reviewed). This formula results from the “dominant pole” solution in the prototypical constant-coefficient linear 2ⁿᵈ-order ODE. For ẋ(0) = 0, mathematics shows poles p₁ = -ωₙ s₁, p₂ = -ωₙ s₂, where sz = √(ζ² - 1), s₁ = ζ - sz, s₂ = ζ + sz. and

x(t) / x(0) = p₂/(p₂-p₁) exp(p₁ t) - p₁/(p₂-p₁) exp(p₂ t)
             = s₂/(s₂-s₁) exp(p₁ t) - s₁/(s₂-s₁) exp(p₂ t)
             =  k/( k-1 ) exp(p₁ t) -  1/( k-1 ) exp(p₂ t) where k = s₂ / s₁
             ≈  k/( k-1 ) exp(p₁ t)                        since p₁ > p₂

Note: k = s₂ / s₁ is real, k > 0, s₂ = k s₁, and p₁ > p₂ (p₁ is less negative then p₂), so exp(p₁ t) decays to zero slower than exp(p₂ t) and exp(p₁ t) ≫ exp(p₂ t) for sufficiently large t. Hence we assume exp(p₂ t) ≈ 0 (which is why p₁ is called the “dominant pole”). Next,

k/(k - 1) = s₂ / s₁ / (s₂/s₁ -1) = s₂ / (s₂ - s₁) = s₂ / (2 sz),  so
  x(t) / x(0)  ≈  s₂ / (2 sz) exp(-s₁ ωₙ t),                        hence
  settling_ratio ≈ s₂ / (2 sz) exp(-s₁ ωₙ tₛ),                      finally
  ωₙ ≈ -ln(settling_ratio 2 sz / s₂) / (s₁ tₛ)

The table below shows that there is little error in this approximate formula for various settling ratios and ζ, particularly for ζ ≥ 1.1. For 1.0 ≤ ζ < 1.1, the critical damping estimates of ωₙ work well. Settling ratio | ζ = 1.01 | ζ = 1.1 | ζ = 1.2 | ζ = 1.3 | ζ = 1.5 ————– | ——– | ——- | ——- | ——- | ——– 0.01 | 1.98% | 0.005% | 2.9E-5% | 1.6E-7% | 2.4E-12% 0.02 | 2.91% | 0.016% | 1.8E-4% | 2.1E-6% | 1.6E-10% 0.05 | 5.10% | 0.076% | 2.3E-3% | 7.0E-5% | 4.4E-8% 0.10 | 8.28% | 0.258% | 1.6E-2% | 1.0E-3% | 3.3E-6% Note: There is a related derivation in the reference below, however, it needlessly makes the oversimplified approximation k/(k - 1) ≈ 1. https://electronics.stackexchange.com/questions/296567/over-and-critically-damped-systems-settling-time

Note

The complete theory for this bushing is documented in the source code. Please look there if you want more information.

Template parameter T:
The underlying scalar type. Must be a valid Eigen scalar.

See also

math::RollPitchYaw for definitions of roll, pitch, yaw [q₀ q₁ q₂].

Note

Per issue #12982, do not directly or indirectly call the following methods as they have not yet been implemented and throw an exception: CalcPotentialEnergy(), CalcConservativePower(), CalcNonConservativePower().

__init__(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], frameA: pydrake.multibody.tree.Frame_[float], frameC: pydrake.multibody.tree.Frame_[float], torque_stiffness_constants: numpy.ndarray[numpy.float64[3, 1]], torque_damping_constants: numpy.ndarray[numpy.float64[3, 1]], force_stiffness_constants: numpy.ndarray[numpy.float64[3, 1]], force_damping_constants: numpy.ndarray[numpy.float64[3, 1]]) → None

Construct a LinearBushingRollPitchYaw B that connects frames A and C, where frame A is welded to a link L0 and frame C is welded to a link L1.

Parameter frameA:
frame A of link (body) L0 that connects to bushing B.
Parameter frameC:
frame C of link (body) L1 that connects to bushing B.
Parameter torque_stiffness_constants:
[k₀ k₁ k₂] multiply the roll-pitch-yaw angles [q₀ q₁ q₂] to produce the spring portion of the “gimbal” torques τ₀, τ₁, τ₂. The SI units of k₀, k₁, k₂ are N*m/rad.
Parameter torque_damping_constants:
[d₀ d₁ d₂] multiply the roll-pitch-yaw rates [q̇₀ q̇₁ q̇₂] to produce the damper portion of the “gimbal” torques τ₀, τ₁, τ₂. The SI units of d₀, d₁, d₂ are N*m*s/rad.
Parameter force_stiffness_constants:
[kx ky kz] multiply the bushing displacements [x y z] to form 𝐟ᴋ, the spring portion of the force 𝐟 = [fx fy fz]ʙ. The SI units of kx, ky, kz are N/m.
Parameter force_damping_constants:
[dx dy dz] multiply the bushing displacement rates [ẋ ż] to form 𝐟ᴅ, the damper portion of the force 𝐟 = [fx fy fz]ʙ. The SI units of dx, dy, dz are N*s/m.

Note

The LinearBushingRollPitchYaw class documentation describes the stiffness and damping constants.

Note

The net moment on C about Co is affected by both the gimbal torque and the moment of 𝐟 about Co. Similarly, for the net moment on A about Ao.

Note

math::RollPitchYaw describes the roll pitch yaw angles q₀, q₁, q₂. The position from Ao to Co is p_AoCo_B = x 𝐁𝐱 + y 𝐁𝐲 + z 𝐁𝐳 = [x y z]ʙ.

Note

The ModelInstanceIndex assigned to this by the constructor is the one assigned to frame C, i.e., frameC.model_instance().

Precondition:
All the stiffness and damping constants must be non-negative.
CalcBushingSpatialForceOnFrameA(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.multibody.math.SpatialForce_[float]

Calculate F_A_A, the bushing’s spatial force on frame A expressed in A. F_A_A contains two vectors: the moment of all bushing forces on A about Ao (−𝐭 + p_AoAp × −𝐟) and the net bushing force on A (−𝐟 expressed in A).

Parameter context:
The state of the multibody system.

See also

CalcBushingSpatialForceOnFrameC().

Raises:RuntimeError if pitch angle is near gimbal-lock. For more info,

See also

RollPitchYaw::DoesCosPitchAngleViolateGimbalLockTolerance().

CalcBushingSpatialForceOnFrameC(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.multibody.math.SpatialForce_[float]

Calculate F_C_C, the bushing’s spatial force on frame C expressed in C. F_C_C contains two vectors: the moment of all bushing forces on C about Co (𝐭 + p_CoCp × 𝐟) and the resultant bushing force on C (𝐟 expressed in C).

Parameter context:
The state of the multibody system.

See also

CalcBushingSpatialForceOnFrameA().

Raises:RuntimeError if pitch angle is near gimbal-lock. For more info,

See also

RollPitchYaw::DoesCosPitchAngleViolateGimbalLockTolerance().

force_damping_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default force damping constants [dx dy dz] (units of N*s/m). Refer to Basic_bushing_force_stiffness_and_damping “How to choose force stiffness and damping constants” for more details.

force_stiffness_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default force stiffness constants [kx ky kz] (units of N/m). Refer to Basic_bushing_force_stiffness_and_damping “How to choose force stiffness and damping constants” for more details.

frameA(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → pydrake.multibody.tree.Frame_[float]

Returns frame A, which is the frame that is welded to link (body) L0 and attached to the bushing.

frameC(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → pydrake.multibody.tree.Frame_[float]

Returns frame C, which is the frame that is welded to link (body) L1 and attached to the bushing.

GetForceDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the force damping constants [dx dy dz] (units of N*s/m) stored in context.

GetForceStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the force stiffness constants [kx ky kz] (units of N/m) stored in context.

GetTorqueDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the torque damping constants [d₀ d₁ d₂] (units of N*m*s/rad) stored in context.

GetTorqueStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the torque stiffness constants [k₀ k₁ k₂] (units of N*m/rad) stored in context.

link0(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → pydrake.multibody.tree.Body_[float]

Returns link (body) L0 (frame A is welded to link L0).

link1(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → pydrake.multibody.tree.Body_[float]

Returns link (body) L1 (frame C is welded to link L1).

SetForceDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float], force_damping: numpy.ndarray[numpy.float64[3, 1]]) → None

Sets the force damping constants [dx dy dz] (units of N*s/m) in context.

SetForceStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float], force_stiffness: numpy.ndarray[numpy.float64[3, 1]]) → None

Sets the force stiffness constants [kx ky kz] (units of N/m) in context.

SetTorqueDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float], torque_damping: numpy.ndarray[numpy.float64[3, 1]]) → None

Sets the torque damping constants [d₀ d₁ d₂] (units of N*m*s/rad) in context.

SetTorqueStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float], torque_stiffness: numpy.ndarray[numpy.float64[3, 1]]) → None

Sets the torque stiffness constants [k₀ k₁ k₂] (units of N*m/rad) in context.

torque_damping_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default torque damping constants [d₀ d₁ d₂] (units of N*m*s/rad). Refer to Basic_bushing_torque_stiffness_and_damping “How to choose torque stiffness and damping constants” for more details.

torque_stiffness_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default torque stiffness constants [k₀ k₁ k₂] (units of N*m/rad). Refer to Basic_bushing_torque_stiffness_and_damping “How to choose torque stiffness and damping constants” for more details.

class pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd]

Bases: pydrake.multibody.tree.ForceElement_[AutoDiffXd]

This ForceElement models a massless flexible bushing that connects a frame A of a link (body) L0 to a frame C of a link (body) L1. The bushing can apply a torque and force due to stiffness (spring) and dissipation (damper) properties. Frame B is the bushing frame whose origin Bo is halfway between Ao (A’s origin) and Co (C’s origin) and whose unit vectors 𝐁𝐱, 𝐁𝐲, 𝐁𝐳 are “halfway” (in an angle-axis sense) between the unit vectors of frame A and frame C. Frame B is a “floating” frame in the sense that it is calculated from the position and orientation of frames A and C (B is not welded to the bushing). @image html multibody/tree/images/LinearBushingRollPitchYaw.png width=80%

The set of forces on frame C from the bushing is equivalent to a torque 𝐭 on frame C and a force 𝐟 applied to a point Cp of C. The set of forces on frame A from the bushing is equivalent to a torque −𝐭 on frame A and a force −𝐟 applied to a point Ap of A. Points Ap and Cp are coincident with Bo (frame B’s origin).

This “quasi-symmetric” bushing force/torque model was developed at Toyota Research Institute and has advantages compared to traditional bushing models because it employs a bushing-centered “symmetric” frame B and it ensures the moment of −𝐟 on A about Ao is equal to the moment of 𝐟 on C about Co. Traditional models differ as they lack a “symmetric” frame B and apply −𝐟 at Ao, which means the moment of −𝐟 on A about Ao is always zero. Note: This bushing model is not fully symmetric since the orientation between frames A and C is parameterized with roll-pitch-yaw angles [q₀ q₁ q₂]. Since these angles have an inherent sequence, they are not mathematically symmetric.

The torque model depends on spring-damper “gimbal” torques τ [τ₀ τ₁ τ₂] which themselves depend on roll-pitch-yaw angles q [q₀ q₁ q₂] and rates = [q̇₀ q̇₁ q̇₂] via a diagonal torque-stiffness matrix K₀₁₂ and a diagonal torque-damping matrix D₀₁₂ as

⌈ τ₀ ⌉     ⌈k₀    0    0⌉ ⌈ q₀ ⌉     ⌈d₀    0    0⌉ ⌈ q̇₀ ⌉
τ ≜ | τ₁ | = − | 0   k₁    0| | q₁ |  −  | 0   d₁    0| | q̇₁ |
    ⌊ τ₂ ⌋     ⌊ 0    0   k₂⌋ ⌊ q₂ ⌋     ⌊ 0    0   d₂⌋ ⌊ q̇₂ ⌋

where k₀, k₁, k₂ and d₀, d₁, d₂ are torque stiffness and damping constants and must have non-negative values.

Note

τ does not represent a vector expressed in one frame. Instead it is regarded as a 3x1 array of torque scalars associated with roll-pitch yaw.

Note

As discussed in the Advanced section below, τ is not 𝐭 𝐭).

Note

This is a “linear” bushing model as gimbal torque τ varies linearly with q and q̇ as τ = τᴋ + τᴅ where τᴋ = −K₀₁₂ ⋅ q and τᴅ = −D₀₁₂ ⋅ q̇.

The bushing model for the net force 𝐟 on frame C from the bushing depends on scalars x, y, z which are defined so 𝐫 (the position vector from Ao to Co) can be expressed in frame B as 𝐫 p_AoCo = [x y z]ʙ = x 𝐁𝐱 + y 𝐁𝐲 + z 𝐁𝐳. The model for 𝐟 uses a diagonal force-stiffness matrix Kxyᴢ, a diagonal force-damping matrix Dxyᴢ, and defines fx, fy, fz so 𝐟 = [fx fy fz]ʙ.

⌈ fx ⌉      ⌈kx    0    0⌉ ⌈ x ⌉     ⌈dx    0    0⌉ ⌈ ẋ ⌉
| fy | =  − | 0   ky    0| | y |  −  | 0   dy    0| | ẏ |
⌊ fz ⌋      ⌊ 0    0   kz⌋ ⌊ z ⌋     ⌊ 0    0   dz⌋ ⌊ ż ⌋

where kx, ky, kz and dx, dy, dz are force stiffness and damping constants and must have non-negative values.

Note

This is a “linear” bushing model as the force 𝐟 varies linearly with 𝐫 and 𝐫̇̇ as 𝐟 = 𝐟ᴋ + 𝐟ᴅ where 𝐟ᴋ = −Kxyz ⋅ 𝐫 and 𝐟ᴅ = −Dxyz ⋅ 𝐫̇̇.

This bushing’s constructor sets the torque stiffness/damping constants [k₀ k₁ k₂] and [d₀ d₁ d₂] and the force stiffness/damping constants [kx ky kz] and [dx dy dz]. The examples below demonstrate how to model various joints that have a flexible (e.g., rubber) mount. The damping values below with ? may be set to 0 or a reasonable positive number.

Bushing type | torque constants | force constants ——————————–|:--------------------|:—————— z-axis revolute joint | k₀₁₂ = [k₀ k₁ 0] | kxyz = [kx ky kz] ^ | d₀₁₂ = [d₀ d₁ ?] | dxyz = [dx dy dz] x-axis prismatic joint | k₀₁₂ = [k₀ k₁ k₂] | kxyz = [0 ky kz] ^ | d₀₁₂ = [d₀ d₁ d₂] | dxyz = [? dy dz] Ball and socket joint | k₀₁₂ = [0 0 0] | kxyz = [kx ky kz] ^ | d₀₁₂ = [? ? ?] | dxyz = [dx dy dz] Weld/fixed joint | k₀₁₂ = [k₀ k₁ k₂] | kxyz = [kx ky kz] ^ | d₀₁₂ = [d₀ d₁ d₂] | dxyz = [dx dy dz]

Angles q₀, q₁, q₂ are calculated from frame C’s orientation relative to frame A, with [−π < q₀ π, −π/2 q₁ π/2, −π < q₂ π], hence, there is no angle wrapping and torque stiffness has a limited range. Gimbal torques τ can be discontinuous if one of q₀, q₁, q₂ is discontinuous and its associated torque spring constant is nonzero. For example, τ₂ is discontinuous if k₂ 0 and the bushing has a large rotation so q₂ jumps from −π to π. τ can also be discontinuous if one of q̇₀, q̇₁, q̇₂ is discontinuous and its associated torque damper constant is nonzero. For example, τ₀ is discontinuous if d₀ 0 and q̇₀ is undefined (which occurs when pitch = q₁ = π/2). Note: Due to the relationship of 𝐭 to τ shown below, 𝐭 is discontinuous if τ is discontinuous.

As shown below, there are multiple ways to estimate torque and force stiffness and damping constants. Use a method or combination of methods appropriate for your application. For example, some methods are more useful for a real physical bushing whereas other methods (called “penalty methods”) can be more useful when replacing an ideal joint (such as a revolute or fixed/weld joint) with a bushing.

Consider a penalty method if you want a bushing to substitute for a “hard” constraint (e.g., an ideal joint). Since a bushing is inherently compliant it will violate a hard constraint somewhat. The stiffer the bushing, the more accurately it enforces the hard constraint, but at a cost of more computational time. To balance accuracy versus time, consider your tolerance for constraint errors. For example, is it OK for your bushing to displace xₘₐₓ = 1 mm for an estimated Fxₘₐₓ = 100 N? Also, one way to choose a force damping constant dx is by choosing a “reasonably small” settling time tₛ, where settling time tₛ is the interval of time for a system to settle to within 1% (0.01) of an equilibrium solution). Is tₛ = 0.01 s negligible for a robot arm with a 10 s reach maneuver?

**** How to choose a torque stiffness constant k₀ or damping constant d₀. The estimate of stiffness k₀ depends on whether you are modeling a physical bushing (consider stiffness methods 1 or 2 below) or whether you are using a bushing to replace an ideal joint such as a revolute or fixed/weld joint (consider stiffness “penalty methods” 3 or 4 below). 1. Use a static experiment, e.g., apply a known moment load Mx, measure the associated angular displacement Δq (radians), and estimate k₀ = Mx / Δq. 2. Use FEA (finite element analysis) software to estimate k₀. 3. Pick a desired maximum angular displacement qₘₐₓ, estimate a maximum moment load Mxₘₐₓ, and estimate k₀ = Mxₘₐₓ / qₘₐₓ (units of N*m/rad). 4. Choose a characteristic moment of inertia I₀ (directionally dependent), choose a desired angular frequency ωₙ > 0 (in rad/s) and estimate k₀ = I₀ ωₙ² (units of N*m/rad).

The estimate of damping d₀ depends on whether you are modeling a physical bushing (consider damping method 1 below) or whether you are using a bushing to enforce a constraint (consider damping methods 2 or 3 below). 1. Use experiments to estimate a damping ratio ζ and settling time tₛ. Compute “undamped natural frequency” ωₙ from ζ and tₛ (as shown below in the Advanced section), then d₀ = 2 ζ k₀ / ωₙ (units of N*m*s/rad). 2. Choose a damping ratio ζ (e.g., ζ = 1, critical damping) and a desired settling time tₛ, calculate ωₙ (as shown below in the Advanced section), then d₀ = 2 ζ k₀ / ωₙ (units of N*m*s/rad). 3. Choose a damping ratio ζ (e.g., ζ = 1, critical damping), estimate a characteristic moment of inertia and calculate d₀ = 2 ζ √(I₀ k₀).

Refer to Advanced_bushing_stiffness_and_damping “Advanced bushing stiffness and damping” for more details.

**** How to choose a force stiffness constant kx or damping constant dx. The estimate of stiffness kx depends on whether you are modeling a real bushing (consider stiffness methods 1 or 2 below) or whether you are using a bushing to replace an ideal joint such as a revolute or fixed/weld joint (consider stiffness “penalty methods” 3 or 4 below). 1. Use a static experiment, e.g., apply a known force load Fx, measure the associated displacement (stretch) Δx (in meters), and estimate kx = Fx / Δx. 2. Use FEA (finite element analysis) software to estimate kx (units of N/m). 3. Pick a desired maximum displacement xₘₐₓ, estimate a maximum force load Fxₘₐₓ, and estimate kx = Fxₘₐₓ / xₘₐₓ (units of N/m). 4. Choose a characteristic mass m (which may be directionally dependent), choose a desired angular frequency ωₙ > 0 (in rad/s) and estimate kx = m ωₙ² (units of N/m).

The estimate of damping dx depends on whether you are modeling a physical bushing (consider damping method 1 below) or whether you are using a bushing to enforce a constraint (consider damping methods 2 or 3 below). 1. Use experiments to estimate a damping ratio ζ and settling time tₛ. Compute “undamped natural frequency” ωₙ from ζ and tₛ (as shown below in the Advanced section), then dx = 2 ζ kx / ωₙ (units of N*s/m). 2. Choose a damping ratio ζ (e.g., ζ = 1, critical damping) and a desired settling time tₛ, calculate ωₙ (as shown below in the Advanced section), then dx = 2 ζ kx / ωₙ (units of N*s/m). 3. Choose a damping ratio ζ (e.g., ζ = 1, critical damping), estimate a characteristic mass m and calculate dx = 2 ζ √(m kx) (units of N*s/m).

Refer to Advanced_bushing_stiffness_and_damping “Advanced bushing stiffness and damping” for more details.

**** Advanced: Relationship of 𝐭 to τ. To understand how “gimbal torques” τ relate to 𝐭, it helps to remember that the RollPitchYaw class documentation states that a Space-fixed (extrinsic) X-Y-Z rotation with roll-pitch-yaw angles [q₀ q₁ q₂] is equivalent to a Body-fixed (intrinsic) Z-Y-X rotation by yaw-pitch-roll angles [q₂ q₁ q₀]. In the context of “gimbal torques”, the Body-fixed Z-Y-X rotation sequence with angles [q₂ q₁ q₀] is physical meaningful as it produces torques associated with successive frames in a gimbal as τ₂ 𝐀𝐳, τ₁ 𝐏𝐲, τ₀ 𝐂𝐱, where each of 𝐀𝐳, 𝐏𝐲, 𝐂𝐱 are unit vectors associated with a frame in the yaw-pitch-roll rotation sequence and 𝐏𝐲 is a unit vector of the “pitch” intermediate frame. As described earlier, torque 𝐭 is the moment of the bushing forces on frame C about Cp. Scalars tx, ty, tz are defined so 𝐭 can be expressed 𝐭 = [tx ty tz]ᴀ = tx 𝐀𝐱 + ty 𝐀𝐲 + tz 𝐀𝐳. As shown in code documentation, the relationship of [tx ty tz] to [τ₀ τ₁ τ₂] was found by equating 𝐭’s power to τ’s power as 𝐭 ⋅ w_AC = τ ⋅ q̇.

⌈ tx ⌉      ⌈ τ₀ ⌉            ⌈ cos(q₂)/cos(q₁)  sin(q₂)/cos(q₁)   0 ⌉
| ty | = Nᵀ | τ₁ |  where N = |   −sin(q2)            cos(q2)      0 |
⌊ tz ⌋      ⌊ τ₂ ⌋            ⌊ cos(q₂)*tan(q₁)   sin(q₂)*tan(q₁)  1 ⌋

**** Advanced: More on how to choose bushing stiffness and damping constants. The basics on how to choose bushing stiffness and damping constants are at: - Basic_bushing_torque_stiffness_and_damping “How to choose torque stiffness and damping constants” - Basic_bushing_force_stiffness_and_damping “How to choose force stiffness and damping constants”

The list below provides more detail on: The performance tradeoff between high stiffness and long simulation time; loads that affect estimates of Mxₘₐₓ or Fxₘₐₓ; and how a linear 2ⁿᵈ-order ODE provides insight on how to experimentally determine stiffness and damping constants. - Stiffness [k₀ k₁ k₂] and [kx ky kz] affect simulation time and accuracy. Generally, a stiffer bushing better resembles an ideal joint (e.g., a revolute joint or fixed/weld joint). However (depending on integrator), a stiffer bushing usually increases numerical integration time. - An estimate for a maximum load Mxₘₐₓ or Fxₘₐₓ accounts for gravity forces, applied forces, inertia forces (centripetal, Coriolis, gyroscopic), etc. - One way to determine physical stiffness and damping constants is through the mathematical intermediaries ωₙ (units of rad/s) and ζ (no units). The constant ωₙ (called “undamped natural frequency” or “angular frequency”) and constant ζ (called “damping ratio”) relate to the physical constants mass m, damping constant dx, and stiffness constant kx via the following prototypical linear constant-coefficient 2ⁿᵈ-order ODEs.

m ẍ +     dx ẋ +  kx x = 0   or alternatively as
   ẍ + 2 ζ ωₙ ẋ + ωₙ² x = 0   where ωₙ² = kx/m,  ζ = dx / (2 √(m kx))

ωₙ and ζ also appear in the related ODEs for rotational systems, namely

I₀ q̈ +     d₀ q̇ +  k₀ q = 0   or alternatively as
    q̈ + 2 ζ ωₙ q̇ + ωₙ² q = 0   where ωₙ² = k₀/I₀,  ζ = d₀ / (2 √(I₀ k₀))

One way to determine ωₙ is from settling time tₛ which approximates the time for a system to settle to within a specified settling ratio of an equilibrium solutions. Typical values for settling ratio are 1% (0.01), 2% (0.02), 5% (0.05), and 10% (0.10). - When ζ < 0.7 (underdamped), a commonly used approximation is ωₙ ≈ -ln(settling_ratio) / (ζ tₛ) which for settling ratios 0.01 and 0.05 give ωₙ ≈ 4.6 / (ζ tₛ) and ωₙ ≈ 3 / (ζ tₛ). Another commonly used approximation is ωₙ ≈ -ln(settling_ratio √(1- ζ²)) / (ζ tₛ). See https://en.wikipedia.org/wiki/Settling_time or the book Modern Control Engineering by Katsuhiko Ogata. Although these approximate formulas for ωₙ are common, they are somewhat inaccurate. Settling time for underdamped systems is discontinuous and requires solving a nonlinear algebraic equation (an iterative process). For more information, see http://www.scielo.org.co/pdf/rfiua/n66/n66a09.pdf [Ramos-Paja, et. al 2012], “Accurate calculation of settling time in second order systems: a photovoltaic application”. Another reference is https://courses.grainger.illinois.edu/ece486/sp2020/laboratory/docs/lab2/estimates.html - When ζ ≈ 1 (critically damped), ωₙ is determined by choosing a settling ratio and then solving for (ωₙ tₛ) via the nonlinear algebraic equation (1 + ωₙ tₛ)*exp(-ωₙ tₛ) = settling_ratio. Settling ratio | ωₙ ————– | ————- 0.01 | 6.64 / tₛ 0.02 | 5.83 / tₛ 0.05 | 4.74 / tₛ 0.10 | 3.89 / tₛ See https://electronics.stackexchange.com/questions/296567/over-and-critically-damped-systems-settling-time - When ζ ≥ 1.01 (overdamped), ωₙ ≈ -ln(2 settling_ratio sz/s₂) / (s₁ tₛ) where sz = √(ζ² - 1), s₁ = ζ - sz, s₂ = ζ + sz. The derivation and approximation error estimates for this overdamped settling time formula is ApproximateOverdampedSettlingTime “below”.

  • For a real physical bushing, an experiment is one way to estimate damping

constants. For example, to estimate a torque damping constant d₀ associated with underdamped vibrations (damping ratio 0 < ζ < 1), attach the bushing to a massive rod, initially displace the rod by angle Δq, release the rod and measure q(t). From the q(t) measurement, estimate decay ratio (the ratio of successive peak heights above the final steady-state value) calculate logarithmic decrement δ = -ln(decay_ratio), calculate damping ratio ζ = √(δ² / (4π² + δ²)), then calculate d₀ using d₀ = 2 ζ √(I₀ k₀) or d₀ = 2 ζ k₀ / ωₙ. For more information, see https://en.wikipedia.org/wiki/Damping_ratio#Logarithmic_decrement

**** Derivation: Approximate formula for overdamped settling time. Since a literature reference for this formula was not found, the derivation below was done at TRI (it has not been peer reviewed). This formula results from the “dominant pole” solution in the prototypical constant-coefficient linear 2ⁿᵈ-order ODE. For ẋ(0) = 0, mathematics shows poles p₁ = -ωₙ s₁, p₂ = -ωₙ s₂, where sz = √(ζ² - 1), s₁ = ζ - sz, s₂ = ζ + sz. and

x(t) / x(0) = p₂/(p₂-p₁) exp(p₁ t) - p₁/(p₂-p₁) exp(p₂ t)
             = s₂/(s₂-s₁) exp(p₁ t) - s₁/(s₂-s₁) exp(p₂ t)
             =  k/( k-1 ) exp(p₁ t) -  1/( k-1 ) exp(p₂ t) where k = s₂ / s₁
             ≈  k/( k-1 ) exp(p₁ t)                        since p₁ > p₂

Note: k = s₂ / s₁ is real, k > 0, s₂ = k s₁, and p₁ > p₂ (p₁ is less negative then p₂), so exp(p₁ t) decays to zero slower than exp(p₂ t) and exp(p₁ t) ≫ exp(p₂ t) for sufficiently large t. Hence we assume exp(p₂ t) ≈ 0 (which is why p₁ is called the “dominant pole”). Next,

k/(k - 1) = s₂ / s₁ / (s₂/s₁ -1) = s₂ / (s₂ - s₁) = s₂ / (2 sz),  so
  x(t) / x(0)  ≈  s₂ / (2 sz) exp(-s₁ ωₙ t),                        hence
  settling_ratio ≈ s₂ / (2 sz) exp(-s₁ ωₙ tₛ),                      finally
  ωₙ ≈ -ln(settling_ratio 2 sz / s₂) / (s₁ tₛ)

The table below shows that there is little error in this approximate formula for various settling ratios and ζ, particularly for ζ ≥ 1.1. For 1.0 ≤ ζ < 1.1, the critical damping estimates of ωₙ work well. Settling ratio | ζ = 1.01 | ζ = 1.1 | ζ = 1.2 | ζ = 1.3 | ζ = 1.5 ————– | ——– | ——- | ——- | ——- | ——– 0.01 | 1.98% | 0.005% | 2.9E-5% | 1.6E-7% | 2.4E-12% 0.02 | 2.91% | 0.016% | 1.8E-4% | 2.1E-6% | 1.6E-10% 0.05 | 5.10% | 0.076% | 2.3E-3% | 7.0E-5% | 4.4E-8% 0.10 | 8.28% | 0.258% | 1.6E-2% | 1.0E-3% | 3.3E-6% Note: There is a related derivation in the reference below, however, it needlessly makes the oversimplified approximation k/(k - 1) ≈ 1. https://electronics.stackexchange.com/questions/296567/over-and-critically-damped-systems-settling-time

Note

The complete theory for this bushing is documented in the source code. Please look there if you want more information.

Template parameter T:
The underlying scalar type. Must be a valid Eigen scalar.

See also

math::RollPitchYaw for definitions of roll, pitch, yaw [q₀ q₁ q₂].

Note

Per issue #12982, do not directly or indirectly call the following methods as they have not yet been implemented and throw an exception: CalcPotentialEnergy(), CalcConservativePower(), CalcNonConservativePower().

__init__(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd], frameA: pydrake.multibody.tree.Frame_[AutoDiffXd], frameC: pydrake.multibody.tree.Frame_[AutoDiffXd], torque_stiffness_constants: numpy.ndarray[numpy.float64[3, 1]], torque_damping_constants: numpy.ndarray[numpy.float64[3, 1]], force_stiffness_constants: numpy.ndarray[numpy.float64[3, 1]], force_damping_constants: numpy.ndarray[numpy.float64[3, 1]]) → None

Construct a LinearBushingRollPitchYaw B that connects frames A and C, where frame A is welded to a link L0 and frame C is welded to a link L1.

Parameter frameA:
frame A of link (body) L0 that connects to bushing B.
Parameter frameC:
frame C of link (body) L1 that connects to bushing B.
Parameter torque_stiffness_constants:
[k₀ k₁ k₂] multiply the roll-pitch-yaw angles [q₀ q₁ q₂] to produce the spring portion of the “gimbal” torques τ₀, τ₁, τ₂. The SI units of k₀, k₁, k₂ are N*m/rad.
Parameter torque_damping_constants:
[d₀ d₁ d₂] multiply the roll-pitch-yaw rates [q̇₀ q̇₁ q̇₂] to produce the damper portion of the “gimbal” torques τ₀, τ₁, τ₂. The SI units of d₀, d₁, d₂ are N*m*s/rad.
Parameter force_stiffness_constants:
[kx ky kz] multiply the bushing displacements [x y z] to form 𝐟ᴋ, the spring portion of the force 𝐟 = [fx fy fz]ʙ. The SI units of kx, ky, kz are N/m.
Parameter force_damping_constants:
[dx dy dz] multiply the bushing displacement rates [ẋ ż] to form 𝐟ᴅ, the damper portion of the force 𝐟 = [fx fy fz]ʙ. The SI units of dx, dy, dz are N*s/m.

Note

The LinearBushingRollPitchYaw class documentation describes the stiffness and damping constants.

Note

The net moment on C about Co is affected by both the gimbal torque and the moment of 𝐟 about Co. Similarly, for the net moment on A about Ao.

Note

math::RollPitchYaw describes the roll pitch yaw angles q₀, q₁, q₂. The position from Ao to Co is p_AoCo_B = x 𝐁𝐱 + y 𝐁𝐲 + z 𝐁𝐳 = [x y z]ʙ.

Note

The ModelInstanceIndex assigned to this by the constructor is the one assigned to frame C, i.e., frameC.model_instance().

Precondition:
All the stiffness and damping constants must be non-negative.
CalcBushingSpatialForceOnFrameA(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.multibody.math.SpatialForce_[AutoDiffXd]

Calculate F_A_A, the bushing’s spatial force on frame A expressed in A. F_A_A contains two vectors: the moment of all bushing forces on A about Ao (−𝐭 + p_AoAp × −𝐟) and the net bushing force on A (−𝐟 expressed in A).

Parameter context:
The state of the multibody system.

See also

CalcBushingSpatialForceOnFrameC().

Raises:RuntimeError if pitch angle is near gimbal-lock. For more info,

See also

RollPitchYaw::DoesCosPitchAngleViolateGimbalLockTolerance().

CalcBushingSpatialForceOnFrameC(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.multibody.math.SpatialForce_[AutoDiffXd]

Calculate F_C_C, the bushing’s spatial force on frame C expressed in C. F_C_C contains two vectors: the moment of all bushing forces on C about Co (𝐭 + p_CoCp × 𝐟) and the resultant bushing force on C (𝐟 expressed in C).

Parameter context:
The state of the multibody system.

See also

CalcBushingSpatialForceOnFrameA().

Raises:RuntimeError if pitch angle is near gimbal-lock. For more info,

See also

RollPitchYaw::DoesCosPitchAngleViolateGimbalLockTolerance().

force_damping_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default force damping constants [dx dy dz] (units of N*s/m). Refer to Basic_bushing_force_stiffness_and_damping “How to choose force stiffness and damping constants” for more details.

force_stiffness_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default force stiffness constants [kx ky kz] (units of N/m). Refer to Basic_bushing_force_stiffness_and_damping “How to choose force stiffness and damping constants” for more details.

frameA(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd]) → pydrake.multibody.tree.Frame_[AutoDiffXd]

Returns frame A, which is the frame that is welded to link (body) L0 and attached to the bushing.

frameC(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd]) → pydrake.multibody.tree.Frame_[AutoDiffXd]

Returns frame C, which is the frame that is welded to link (body) L1 and attached to the bushing.

GetForceDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → numpy.ndarray[object[3, 1]]

Returns the force damping constants [dx dy dz] (units of N*s/m) stored in context.

GetForceStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → numpy.ndarray[object[3, 1]]

Returns the force stiffness constants [kx ky kz] (units of N/m) stored in context.

GetTorqueDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → numpy.ndarray[object[3, 1]]

Returns the torque damping constants [d₀ d₁ d₂] (units of N*m*s/rad) stored in context.

GetTorqueStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → numpy.ndarray[object[3, 1]]

Returns the torque stiffness constants [k₀ k₁ k₂] (units of N*m/rad) stored in context.

link0(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd]) → pydrake.multibody.tree.Body_[AutoDiffXd]

Returns link (body) L0 (frame A is welded to link L0).

link1(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd]) → pydrake.multibody.tree.Body_[AutoDiffXd]

Returns link (body) L1 (frame C is welded to link L1).

SetForceDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], force_damping: numpy.ndarray[object[3, 1]]) → None

Sets the force damping constants [dx dy dz] (units of N*s/m) in context.

SetForceStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], force_stiffness: numpy.ndarray[object[3, 1]]) → None

Sets the force stiffness constants [kx ky kz] (units of N/m) in context.

SetTorqueDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], torque_damping: numpy.ndarray[object[3, 1]]) → None

Sets the torque damping constants [d₀ d₁ d₂] (units of N*m*s/rad) in context.

SetTorqueStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], torque_stiffness: numpy.ndarray[object[3, 1]]) → None

Sets the torque stiffness constants [k₀ k₁ k₂] (units of N*m/rad) in context.

torque_damping_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default torque damping constants [d₀ d₁ d₂] (units of N*m*s/rad). Refer to Basic_bushing_torque_stiffness_and_damping “How to choose torque stiffness and damping constants” for more details.

torque_stiffness_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[AutoDiffXd]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default torque stiffness constants [k₀ k₁ k₂] (units of N*m/rad). Refer to Basic_bushing_torque_stiffness_and_damping “How to choose torque stiffness and damping constants” for more details.

class pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression]

Bases: pydrake.multibody.tree.ForceElement_[Expression]

This ForceElement models a massless flexible bushing that connects a frame A of a link (body) L0 to a frame C of a link (body) L1. The bushing can apply a torque and force due to stiffness (spring) and dissipation (damper) properties. Frame B is the bushing frame whose origin Bo is halfway between Ao (A’s origin) and Co (C’s origin) and whose unit vectors 𝐁𝐱, 𝐁𝐲, 𝐁𝐳 are “halfway” (in an angle-axis sense) between the unit vectors of frame A and frame C. Frame B is a “floating” frame in the sense that it is calculated from the position and orientation of frames A and C (B is not welded to the bushing). @image html multibody/tree/images/LinearBushingRollPitchYaw.png width=80%

The set of forces on frame C from the bushing is equivalent to a torque 𝐭 on frame C and a force 𝐟 applied to a point Cp of C. The set of forces on frame A from the bushing is equivalent to a torque −𝐭 on frame A and a force −𝐟 applied to a point Ap of A. Points Ap and Cp are coincident with Bo (frame B’s origin).

This “quasi-symmetric” bushing force/torque model was developed at Toyota Research Institute and has advantages compared to traditional bushing models because it employs a bushing-centered “symmetric” frame B and it ensures the moment of −𝐟 on A about Ao is equal to the moment of 𝐟 on C about Co. Traditional models differ as they lack a “symmetric” frame B and apply −𝐟 at Ao, which means the moment of −𝐟 on A about Ao is always zero. Note: This bushing model is not fully symmetric since the orientation between frames A and C is parameterized with roll-pitch-yaw angles [q₀ q₁ q₂]. Since these angles have an inherent sequence, they are not mathematically symmetric.

The torque model depends on spring-damper “gimbal” torques τ [τ₀ τ₁ τ₂] which themselves depend on roll-pitch-yaw angles q [q₀ q₁ q₂] and rates = [q̇₀ q̇₁ q̇₂] via a diagonal torque-stiffness matrix K₀₁₂ and a diagonal torque-damping matrix D₀₁₂ as

⌈ τ₀ ⌉     ⌈k₀    0    0⌉ ⌈ q₀ ⌉     ⌈d₀    0    0⌉ ⌈ q̇₀ ⌉
τ ≜ | τ₁ | = − | 0   k₁    0| | q₁ |  −  | 0   d₁    0| | q̇₁ |
    ⌊ τ₂ ⌋     ⌊ 0    0   k₂⌋ ⌊ q₂ ⌋     ⌊ 0    0   d₂⌋ ⌊ q̇₂ ⌋

where k₀, k₁, k₂ and d₀, d₁, d₂ are torque stiffness and damping constants and must have non-negative values.

Note

τ does not represent a vector expressed in one frame. Instead it is regarded as a 3x1 array of torque scalars associated with roll-pitch yaw.

Note

As discussed in the Advanced section below, τ is not 𝐭 𝐭).

Note

This is a “linear” bushing model as gimbal torque τ varies linearly with q and q̇ as τ = τᴋ + τᴅ where τᴋ = −K₀₁₂ ⋅ q and τᴅ = −D₀₁₂ ⋅ q̇.

The bushing model for the net force 𝐟 on frame C from the bushing depends on scalars x, y, z which are defined so 𝐫 (the position vector from Ao to Co) can be expressed in frame B as 𝐫 p_AoCo = [x y z]ʙ = x 𝐁𝐱 + y 𝐁𝐲 + z 𝐁𝐳. The model for 𝐟 uses a diagonal force-stiffness matrix Kxyᴢ, a diagonal force-damping matrix Dxyᴢ, and defines fx, fy, fz so 𝐟 = [fx fy fz]ʙ.

⌈ fx ⌉      ⌈kx    0    0⌉ ⌈ x ⌉     ⌈dx    0    0⌉ ⌈ ẋ ⌉
| fy | =  − | 0   ky    0| | y |  −  | 0   dy    0| | ẏ |
⌊ fz ⌋      ⌊ 0    0   kz⌋ ⌊ z ⌋     ⌊ 0    0   dz⌋ ⌊ ż ⌋

where kx, ky, kz and dx, dy, dz are force stiffness and damping constants and must have non-negative values.

Note

This is a “linear” bushing model as the force 𝐟 varies linearly with 𝐫 and 𝐫̇̇ as 𝐟 = 𝐟ᴋ + 𝐟ᴅ where 𝐟ᴋ = −Kxyz ⋅ 𝐫 and 𝐟ᴅ = −Dxyz ⋅ 𝐫̇̇.

This bushing’s constructor sets the torque stiffness/damping constants [k₀ k₁ k₂] and [d₀ d₁ d₂] and the force stiffness/damping constants [kx ky kz] and [dx dy dz]. The examples below demonstrate how to model various joints that have a flexible (e.g., rubber) mount. The damping values below with ? may be set to 0 or a reasonable positive number.

Bushing type | torque constants | force constants ——————————–|:--------------------|:—————— z-axis revolute joint | k₀₁₂ = [k₀ k₁ 0] | kxyz = [kx ky kz] ^ | d₀₁₂ = [d₀ d₁ ?] | dxyz = [dx dy dz] x-axis prismatic joint | k₀₁₂ = [k₀ k₁ k₂] | kxyz = [0 ky kz] ^ | d₀₁₂ = [d₀ d₁ d₂] | dxyz = [? dy dz] Ball and socket joint | k₀₁₂ = [0 0 0] | kxyz = [kx ky kz] ^ | d₀₁₂ = [? ? ?] | dxyz = [dx dy dz] Weld/fixed joint | k₀₁₂ = [k₀ k₁ k₂] | kxyz = [kx ky kz] ^ | d₀₁₂ = [d₀ d₁ d₂] | dxyz = [dx dy dz]

Angles q₀, q₁, q₂ are calculated from frame C’s orientation relative to frame A, with [−π < q₀ π, −π/2 q₁ π/2, −π < q₂ π], hence, there is no angle wrapping and torque stiffness has a limited range. Gimbal torques τ can be discontinuous if one of q₀, q₁, q₂ is discontinuous and its associated torque spring constant is nonzero. For example, τ₂ is discontinuous if k₂ 0 and the bushing has a large rotation so q₂ jumps from −π to π. τ can also be discontinuous if one of q̇₀, q̇₁, q̇₂ is discontinuous and its associated torque damper constant is nonzero. For example, τ₀ is discontinuous if d₀ 0 and q̇₀ is undefined (which occurs when pitch = q₁ = π/2). Note: Due to the relationship of 𝐭 to τ shown below, 𝐭 is discontinuous if τ is discontinuous.

As shown below, there are multiple ways to estimate torque and force stiffness and damping constants. Use a method or combination of methods appropriate for your application. For example, some methods are more useful for a real physical bushing whereas other methods (called “penalty methods”) can be more useful when replacing an ideal joint (such as a revolute or fixed/weld joint) with a bushing.

Consider a penalty method if you want a bushing to substitute for a “hard” constraint (e.g., an ideal joint). Since a bushing is inherently compliant it will violate a hard constraint somewhat. The stiffer the bushing, the more accurately it enforces the hard constraint, but at a cost of more computational time. To balance accuracy versus time, consider your tolerance for constraint errors. For example, is it OK for your bushing to displace xₘₐₓ = 1 mm for an estimated Fxₘₐₓ = 100 N? Also, one way to choose a force damping constant dx is by choosing a “reasonably small” settling time tₛ, where settling time tₛ is the interval of time for a system to settle to within 1% (0.01) of an equilibrium solution). Is tₛ = 0.01 s negligible for a robot arm with a 10 s reach maneuver?

**** How to choose a torque stiffness constant k₀ or damping constant d₀. The estimate of stiffness k₀ depends on whether you are modeling a physical bushing (consider stiffness methods 1 or 2 below) or whether you are using a bushing to replace an ideal joint such as a revolute or fixed/weld joint (consider stiffness “penalty methods” 3 or 4 below). 1. Use a static experiment, e.g., apply a known moment load Mx, measure the associated angular displacement Δq (radians), and estimate k₀ = Mx / Δq. 2. Use FEA (finite element analysis) software to estimate k₀. 3. Pick a desired maximum angular displacement qₘₐₓ, estimate a maximum moment load Mxₘₐₓ, and estimate k₀ = Mxₘₐₓ / qₘₐₓ (units of N*m/rad). 4. Choose a characteristic moment of inertia I₀ (directionally dependent), choose a desired angular frequency ωₙ > 0 (in rad/s) and estimate k₀ = I₀ ωₙ² (units of N*m/rad).

The estimate of damping d₀ depends on whether you are modeling a physical bushing (consider damping method 1 below) or whether you are using a bushing to enforce a constraint (consider damping methods 2 or 3 below). 1. Use experiments to estimate a damping ratio ζ and settling time tₛ. Compute “undamped natural frequency” ωₙ from ζ and tₛ (as shown below in the Advanced section), then d₀ = 2 ζ k₀ / ωₙ (units of N*m*s/rad). 2. Choose a damping ratio ζ (e.g., ζ = 1, critical damping) and a desired settling time tₛ, calculate ωₙ (as shown below in the Advanced section), then d₀ = 2 ζ k₀ / ωₙ (units of N*m*s/rad). 3. Choose a damping ratio ζ (e.g., ζ = 1, critical damping), estimate a characteristic moment of inertia and calculate d₀ = 2 ζ √(I₀ k₀).

Refer to Advanced_bushing_stiffness_and_damping “Advanced bushing stiffness and damping” for more details.

**** How to choose a force stiffness constant kx or damping constant dx. The estimate of stiffness kx depends on whether you are modeling a real bushing (consider stiffness methods 1 or 2 below) or whether you are using a bushing to replace an ideal joint such as a revolute or fixed/weld joint (consider stiffness “penalty methods” 3 or 4 below). 1. Use a static experiment, e.g., apply a known force load Fx, measure the associated displacement (stretch) Δx (in meters), and estimate kx = Fx / Δx. 2. Use FEA (finite element analysis) software to estimate kx (units of N/m). 3. Pick a desired maximum displacement xₘₐₓ, estimate a maximum force load Fxₘₐₓ, and estimate kx = Fxₘₐₓ / xₘₐₓ (units of N/m). 4. Choose a characteristic mass m (which may be directionally dependent), choose a desired angular frequency ωₙ > 0 (in rad/s) and estimate kx = m ωₙ² (units of N/m).

The estimate of damping dx depends on whether you are modeling a physical bushing (consider damping method 1 below) or whether you are using a bushing to enforce a constraint (consider damping methods 2 or 3 below). 1. Use experiments to estimate a damping ratio ζ and settling time tₛ. Compute “undamped natural frequency” ωₙ from ζ and tₛ (as shown below in the Advanced section), then dx = 2 ζ kx / ωₙ (units of N*s/m). 2. Choose a damping ratio ζ (e.g., ζ = 1, critical damping) and a desired settling time tₛ, calculate ωₙ (as shown below in the Advanced section), then dx = 2 ζ kx / ωₙ (units of N*s/m). 3. Choose a damping ratio ζ (e.g., ζ = 1, critical damping), estimate a characteristic mass m and calculate dx = 2 ζ √(m kx) (units of N*s/m).

Refer to Advanced_bushing_stiffness_and_damping “Advanced bushing stiffness and damping” for more details.

**** Advanced: Relationship of 𝐭 to τ. To understand how “gimbal torques” τ relate to 𝐭, it helps to remember that the RollPitchYaw class documentation states that a Space-fixed (extrinsic) X-Y-Z rotation with roll-pitch-yaw angles [q₀ q₁ q₂] is equivalent to a Body-fixed (intrinsic) Z-Y-X rotation by yaw-pitch-roll angles [q₂ q₁ q₀]. In the context of “gimbal torques”, the Body-fixed Z-Y-X rotation sequence with angles [q₂ q₁ q₀] is physical meaningful as it produces torques associated with successive frames in a gimbal as τ₂ 𝐀𝐳, τ₁ 𝐏𝐲, τ₀ 𝐂𝐱, where each of 𝐀𝐳, 𝐏𝐲, 𝐂𝐱 are unit vectors associated with a frame in the yaw-pitch-roll rotation sequence and 𝐏𝐲 is a unit vector of the “pitch” intermediate frame. As described earlier, torque 𝐭 is the moment of the bushing forces on frame C about Cp. Scalars tx, ty, tz are defined so 𝐭 can be expressed 𝐭 = [tx ty tz]ᴀ = tx 𝐀𝐱 + ty 𝐀𝐲 + tz 𝐀𝐳. As shown in code documentation, the relationship of [tx ty tz] to [τ₀ τ₁ τ₂] was found by equating 𝐭’s power to τ’s power as 𝐭 ⋅ w_AC = τ ⋅ q̇.

⌈ tx ⌉      ⌈ τ₀ ⌉            ⌈ cos(q₂)/cos(q₁)  sin(q₂)/cos(q₁)   0 ⌉
| ty | = Nᵀ | τ₁ |  where N = |   −sin(q2)            cos(q2)      0 |
⌊ tz ⌋      ⌊ τ₂ ⌋            ⌊ cos(q₂)*tan(q₁)   sin(q₂)*tan(q₁)  1 ⌋

**** Advanced: More on how to choose bushing stiffness and damping constants. The basics on how to choose bushing stiffness and damping constants are at: - Basic_bushing_torque_stiffness_and_damping “How to choose torque stiffness and damping constants” - Basic_bushing_force_stiffness_and_damping “How to choose force stiffness and damping constants”

The list below provides more detail on: The performance tradeoff between high stiffness and long simulation time; loads that affect estimates of Mxₘₐₓ or Fxₘₐₓ; and how a linear 2ⁿᵈ-order ODE provides insight on how to experimentally determine stiffness and damping constants. - Stiffness [k₀ k₁ k₂] and [kx ky kz] affect simulation time and accuracy. Generally, a stiffer bushing better resembles an ideal joint (e.g., a revolute joint or fixed/weld joint). However (depending on integrator), a stiffer bushing usually increases numerical integration time. - An estimate for a maximum load Mxₘₐₓ or Fxₘₐₓ accounts for gravity forces, applied forces, inertia forces (centripetal, Coriolis, gyroscopic), etc. - One way to determine physical stiffness and damping constants is through the mathematical intermediaries ωₙ (units of rad/s) and ζ (no units). The constant ωₙ (called “undamped natural frequency” or “angular frequency”) and constant ζ (called “damping ratio”) relate to the physical constants mass m, damping constant dx, and stiffness constant kx via the following prototypical linear constant-coefficient 2ⁿᵈ-order ODEs.

m ẍ +     dx ẋ +  kx x = 0   or alternatively as
   ẍ + 2 ζ ωₙ ẋ + ωₙ² x = 0   where ωₙ² = kx/m,  ζ = dx / (2 √(m kx))

ωₙ and ζ also appear in the related ODEs for rotational systems, namely

I₀ q̈ +     d₀ q̇ +  k₀ q = 0   or alternatively as
    q̈ + 2 ζ ωₙ q̇ + ωₙ² q = 0   where ωₙ² = k₀/I₀,  ζ = d₀ / (2 √(I₀ k₀))

One way to determine ωₙ is from settling time tₛ which approximates the time for a system to settle to within a specified settling ratio of an equilibrium solutions. Typical values for settling ratio are 1% (0.01), 2% (0.02), 5% (0.05), and 10% (0.10). - When ζ < 0.7 (underdamped), a commonly used approximation is ωₙ ≈ -ln(settling_ratio) / (ζ tₛ) which for settling ratios 0.01 and 0.05 give ωₙ ≈ 4.6 / (ζ tₛ) and ωₙ ≈ 3 / (ζ tₛ). Another commonly used approximation is ωₙ ≈ -ln(settling_ratio √(1- ζ²)) / (ζ tₛ). See https://en.wikipedia.org/wiki/Settling_time or the book Modern Control Engineering by Katsuhiko Ogata. Although these approximate formulas for ωₙ are common, they are somewhat inaccurate. Settling time for underdamped systems is discontinuous and requires solving a nonlinear algebraic equation (an iterative process). For more information, see http://www.scielo.org.co/pdf/rfiua/n66/n66a09.pdf [Ramos-Paja, et. al 2012], “Accurate calculation of settling time in second order systems: a photovoltaic application”. Another reference is https://courses.grainger.illinois.edu/ece486/sp2020/laboratory/docs/lab2/estimates.html - When ζ ≈ 1 (critically damped), ωₙ is determined by choosing a settling ratio and then solving for (ωₙ tₛ) via the nonlinear algebraic equation (1 + ωₙ tₛ)*exp(-ωₙ tₛ) = settling_ratio. Settling ratio | ωₙ ————– | ————- 0.01 | 6.64 / tₛ 0.02 | 5.83 / tₛ 0.05 | 4.74 / tₛ 0.10 | 3.89 / tₛ See https://electronics.stackexchange.com/questions/296567/over-and-critically-damped-systems-settling-time - When ζ ≥ 1.01 (overdamped), ωₙ ≈ -ln(2 settling_ratio sz/s₂) / (s₁ tₛ) where sz = √(ζ² - 1), s₁ = ζ - sz, s₂ = ζ + sz. The derivation and approximation error estimates for this overdamped settling time formula is ApproximateOverdampedSettlingTime “below”.

  • For a real physical bushing, an experiment is one way to estimate damping

constants. For example, to estimate a torque damping constant d₀ associated with underdamped vibrations (damping ratio 0 < ζ < 1), attach the bushing to a massive rod, initially displace the rod by angle Δq, release the rod and measure q(t). From the q(t) measurement, estimate decay ratio (the ratio of successive peak heights above the final steady-state value) calculate logarithmic decrement δ = -ln(decay_ratio), calculate damping ratio ζ = √(δ² / (4π² + δ²)), then calculate d₀ using d₀ = 2 ζ √(I₀ k₀) or d₀ = 2 ζ k₀ / ωₙ. For more information, see https://en.wikipedia.org/wiki/Damping_ratio#Logarithmic_decrement

**** Derivation: Approximate formula for overdamped settling time. Since a literature reference for this formula was not found, the derivation below was done at TRI (it has not been peer reviewed). This formula results from the “dominant pole” solution in the prototypical constant-coefficient linear 2ⁿᵈ-order ODE. For ẋ(0) = 0, mathematics shows poles p₁ = -ωₙ s₁, p₂ = -ωₙ s₂, where sz = √(ζ² - 1), s₁ = ζ - sz, s₂ = ζ + sz. and

x(t) / x(0) = p₂/(p₂-p₁) exp(p₁ t) - p₁/(p₂-p₁) exp(p₂ t)
             = s₂/(s₂-s₁) exp(p₁ t) - s₁/(s₂-s₁) exp(p₂ t)
             =  k/( k-1 ) exp(p₁ t) -  1/( k-1 ) exp(p₂ t) where k = s₂ / s₁
             ≈  k/( k-1 ) exp(p₁ t)                        since p₁ > p₂

Note: k = s₂ / s₁ is real, k > 0, s₂ = k s₁, and p₁ > p₂ (p₁ is less negative then p₂), so exp(p₁ t) decays to zero slower than exp(p₂ t) and exp(p₁ t) ≫ exp(p₂ t) for sufficiently large t. Hence we assume exp(p₂ t) ≈ 0 (which is why p₁ is called the “dominant pole”). Next,

k/(k - 1) = s₂ / s₁ / (s₂/s₁ -1) = s₂ / (s₂ - s₁) = s₂ / (2 sz),  so
  x(t) / x(0)  ≈  s₂ / (2 sz) exp(-s₁ ωₙ t),                        hence
  settling_ratio ≈ s₂ / (2 sz) exp(-s₁ ωₙ tₛ),                      finally
  ωₙ ≈ -ln(settling_ratio 2 sz / s₂) / (s₁ tₛ)

The table below shows that there is little error in this approximate formula for various settling ratios and ζ, particularly for ζ ≥ 1.1. For 1.0 ≤ ζ < 1.1, the critical damping estimates of ωₙ work well. Settling ratio | ζ = 1.01 | ζ = 1.1 | ζ = 1.2 | ζ = 1.3 | ζ = 1.5 ————– | ——– | ——- | ——- | ——- | ——– 0.01 | 1.98% | 0.005% | 2.9E-5% | 1.6E-7% | 2.4E-12% 0.02 | 2.91% | 0.016% | 1.8E-4% | 2.1E-6% | 1.6E-10% 0.05 | 5.10% | 0.076% | 2.3E-3% | 7.0E-5% | 4.4E-8% 0.10 | 8.28% | 0.258% | 1.6E-2% | 1.0E-3% | 3.3E-6% Note: There is a related derivation in the reference below, however, it needlessly makes the oversimplified approximation k/(k - 1) ≈ 1. https://electronics.stackexchange.com/questions/296567/over-and-critically-damped-systems-settling-time

Note

The complete theory for this bushing is documented in the source code. Please look there if you want more information.

Template parameter T:
The underlying scalar type. Must be a valid Eigen scalar.

See also

math::RollPitchYaw for definitions of roll, pitch, yaw [q₀ q₁ q₂].

Note

Per issue #12982, do not directly or indirectly call the following methods as they have not yet been implemented and throw an exception: CalcPotentialEnergy(), CalcConservativePower(), CalcNonConservativePower().

__init__(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression], frameA: pydrake.multibody.tree.Frame_[Expression], frameC: pydrake.multibody.tree.Frame_[Expression], torque_stiffness_constants: numpy.ndarray[numpy.float64[3, 1]], torque_damping_constants: numpy.ndarray[numpy.float64[3, 1]], force_stiffness_constants: numpy.ndarray[numpy.float64[3, 1]], force_damping_constants: numpy.ndarray[numpy.float64[3, 1]]) → None

Construct a LinearBushingRollPitchYaw B that connects frames A and C, where frame A is welded to a link L0 and frame C is welded to a link L1.

Parameter frameA:
frame A of link (body) L0 that connects to bushing B.
Parameter frameC:
frame C of link (body) L1 that connects to bushing B.
Parameter torque_stiffness_constants:
[k₀ k₁ k₂] multiply the roll-pitch-yaw angles [q₀ q₁ q₂] to produce the spring portion of the “gimbal” torques τ₀, τ₁, τ₂. The SI units of k₀, k₁, k₂ are N*m/rad.
Parameter torque_damping_constants:
[d₀ d₁ d₂] multiply the roll-pitch-yaw rates [q̇₀ q̇₁ q̇₂] to produce the damper portion of the “gimbal” torques τ₀, τ₁, τ₂. The SI units of d₀, d₁, d₂ are N*m*s/rad.
Parameter force_stiffness_constants:
[kx ky kz] multiply the bushing displacements [x y z] to form 𝐟ᴋ, the spring portion of the force 𝐟 = [fx fy fz]ʙ. The SI units of kx, ky, kz are N/m.
Parameter force_damping_constants:
[dx dy dz] multiply the bushing displacement rates [ẋ ż] to form 𝐟ᴅ, the damper portion of the force 𝐟 = [fx fy fz]ʙ. The SI units of dx, dy, dz are N*s/m.

Note

The LinearBushingRollPitchYaw class documentation describes the stiffness and damping constants.

Note

The net moment on C about Co is affected by both the gimbal torque and the moment of 𝐟 about Co. Similarly, for the net moment on A about Ao.

Note

math::RollPitchYaw describes the roll pitch yaw angles q₀, q₁, q₂. The position from Ao to Co is p_AoCo_B = x 𝐁𝐱 + y 𝐁𝐲 + z 𝐁𝐳 = [x y z]ʙ.

Note

The ModelInstanceIndex assigned to this by the constructor is the one assigned to frame C, i.e., frameC.model_instance().

Precondition:
All the stiffness and damping constants must be non-negative.
CalcBushingSpatialForceOnFrameA(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.multibody.math.SpatialForce_[Expression]

Calculate F_A_A, the bushing’s spatial force on frame A expressed in A. F_A_A contains two vectors: the moment of all bushing forces on A about Ao (−𝐭 + p_AoAp × −𝐟) and the net bushing force on A (−𝐟 expressed in A).

Parameter context:
The state of the multibody system.

See also

CalcBushingSpatialForceOnFrameC().

Raises:RuntimeError if pitch angle is near gimbal-lock. For more info,

See also

RollPitchYaw::DoesCosPitchAngleViolateGimbalLockTolerance().

CalcBushingSpatialForceOnFrameC(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.multibody.math.SpatialForce_[Expression]

Calculate F_C_C, the bushing’s spatial force on frame C expressed in C. F_C_C contains two vectors: the moment of all bushing forces on C about Co (𝐭 + p_CoCp × 𝐟) and the resultant bushing force on C (𝐟 expressed in C).

Parameter context:
The state of the multibody system.

See also

CalcBushingSpatialForceOnFrameA().

Raises:RuntimeError if pitch angle is near gimbal-lock. For more info,

See also

RollPitchYaw::DoesCosPitchAngleViolateGimbalLockTolerance().

force_damping_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default force damping constants [dx dy dz] (units of N*s/m). Refer to Basic_bushing_force_stiffness_and_damping “How to choose force stiffness and damping constants” for more details.

force_stiffness_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default force stiffness constants [kx ky kz] (units of N/m). Refer to Basic_bushing_force_stiffness_and_damping “How to choose force stiffness and damping constants” for more details.

frameA(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression]) → pydrake.multibody.tree.Frame_[Expression]

Returns frame A, which is the frame that is welded to link (body) L0 and attached to the bushing.

frameC(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression]) → pydrake.multibody.tree.Frame_[Expression]

Returns frame C, which is the frame that is welded to link (body) L1 and attached to the bushing.

GetForceDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression], context: pydrake.systems.framework.Context_[Expression]) → numpy.ndarray[object[3, 1]]

Returns the force damping constants [dx dy dz] (units of N*s/m) stored in context.

GetForceStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression], context: pydrake.systems.framework.Context_[Expression]) → numpy.ndarray[object[3, 1]]

Returns the force stiffness constants [kx ky kz] (units of N/m) stored in context.

GetTorqueDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression], context: pydrake.systems.framework.Context_[Expression]) → numpy.ndarray[object[3, 1]]

Returns the torque damping constants [d₀ d₁ d₂] (units of N*m*s/rad) stored in context.

GetTorqueStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression], context: pydrake.systems.framework.Context_[Expression]) → numpy.ndarray[object[3, 1]]

Returns the torque stiffness constants [k₀ k₁ k₂] (units of N*m/rad) stored in context.

link0(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression]) → pydrake.multibody.tree.Body_[Expression]

Returns link (body) L0 (frame A is welded to link L0).

link1(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression]) → pydrake.multibody.tree.Body_[Expression]

Returns link (body) L1 (frame C is welded to link L1).

SetForceDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression], context: pydrake.systems.framework.Context_[Expression], force_damping: numpy.ndarray[object[3, 1]]) → None

Sets the force damping constants [dx dy dz] (units of N*s/m) in context.

SetForceStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression], context: pydrake.systems.framework.Context_[Expression], force_stiffness: numpy.ndarray[object[3, 1]]) → None

Sets the force stiffness constants [kx ky kz] (units of N/m) in context.

SetTorqueDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression], context: pydrake.systems.framework.Context_[Expression], torque_damping: numpy.ndarray[object[3, 1]]) → None

Sets the torque damping constants [d₀ d₁ d₂] (units of N*m*s/rad) in context.

SetTorqueStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression], context: pydrake.systems.framework.Context_[Expression], torque_stiffness: numpy.ndarray[object[3, 1]]) → None

Sets the torque stiffness constants [k₀ k₁ k₂] (units of N*m/rad) in context.

torque_damping_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default torque damping constants [d₀ d₁ d₂] (units of N*m*s/rad). Refer to Basic_bushing_torque_stiffness_and_damping “How to choose torque stiffness and damping constants” for more details.

torque_stiffness_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[Expression]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default torque stiffness constants [k₀ k₁ k₂] (units of N*m/rad). Refer to Basic_bushing_torque_stiffness_and_damping “How to choose torque stiffness and damping constants” for more details.

class pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]

Bases: pydrake.multibody.tree.ForceElement_[float]

This ForceElement models a massless flexible bushing that connects a frame A of a link (body) L0 to a frame C of a link (body) L1. The bushing can apply a torque and force due to stiffness (spring) and dissipation (damper) properties. Frame B is the bushing frame whose origin Bo is halfway between Ao (A’s origin) and Co (C’s origin) and whose unit vectors 𝐁𝐱, 𝐁𝐲, 𝐁𝐳 are “halfway” (in an angle-axis sense) between the unit vectors of frame A and frame C. Frame B is a “floating” frame in the sense that it is calculated from the position and orientation of frames A and C (B is not welded to the bushing). @image html multibody/tree/images/LinearBushingRollPitchYaw.png width=80%

The set of forces on frame C from the bushing is equivalent to a torque 𝐭 on frame C and a force 𝐟 applied to a point Cp of C. The set of forces on frame A from the bushing is equivalent to a torque −𝐭 on frame A and a force −𝐟 applied to a point Ap of A. Points Ap and Cp are coincident with Bo (frame B’s origin).

This “quasi-symmetric” bushing force/torque model was developed at Toyota Research Institute and has advantages compared to traditional bushing models because it employs a bushing-centered “symmetric” frame B and it ensures the moment of −𝐟 on A about Ao is equal to the moment of 𝐟 on C about Co. Traditional models differ as they lack a “symmetric” frame B and apply −𝐟 at Ao, which means the moment of −𝐟 on A about Ao is always zero. Note: This bushing model is not fully symmetric since the orientation between frames A and C is parameterized with roll-pitch-yaw angles [q₀ q₁ q₂]. Since these angles have an inherent sequence, they are not mathematically symmetric.

The torque model depends on spring-damper “gimbal” torques τ [τ₀ τ₁ τ₂] which themselves depend on roll-pitch-yaw angles q [q₀ q₁ q₂] and rates = [q̇₀ q̇₁ q̇₂] via a diagonal torque-stiffness matrix K₀₁₂ and a diagonal torque-damping matrix D₀₁₂ as

⌈ τ₀ ⌉     ⌈k₀    0    0⌉ ⌈ q₀ ⌉     ⌈d₀    0    0⌉ ⌈ q̇₀ ⌉
τ ≜ | τ₁ | = − | 0   k₁    0| | q₁ |  −  | 0   d₁    0| | q̇₁ |
    ⌊ τ₂ ⌋     ⌊ 0    0   k₂⌋ ⌊ q₂ ⌋     ⌊ 0    0   d₂⌋ ⌊ q̇₂ ⌋

where k₀, k₁, k₂ and d₀, d₁, d₂ are torque stiffness and damping constants and must have non-negative values.

Note

τ does not represent a vector expressed in one frame. Instead it is regarded as a 3x1 array of torque scalars associated with roll-pitch yaw.

Note

As discussed in the Advanced section below, τ is not 𝐭 𝐭).

Note

This is a “linear” bushing model as gimbal torque τ varies linearly with q and q̇ as τ = τᴋ + τᴅ where τᴋ = −K₀₁₂ ⋅ q and τᴅ = −D₀₁₂ ⋅ q̇.

The bushing model for the net force 𝐟 on frame C from the bushing depends on scalars x, y, z which are defined so 𝐫 (the position vector from Ao to Co) can be expressed in frame B as 𝐫 p_AoCo = [x y z]ʙ = x 𝐁𝐱 + y 𝐁𝐲 + z 𝐁𝐳. The model for 𝐟 uses a diagonal force-stiffness matrix Kxyᴢ, a diagonal force-damping matrix Dxyᴢ, and defines fx, fy, fz so 𝐟 = [fx fy fz]ʙ.

⌈ fx ⌉      ⌈kx    0    0⌉ ⌈ x ⌉     ⌈dx    0    0⌉ ⌈ ẋ ⌉
| fy | =  − | 0   ky    0| | y |  −  | 0   dy    0| | ẏ |
⌊ fz ⌋      ⌊ 0    0   kz⌋ ⌊ z ⌋     ⌊ 0    0   dz⌋ ⌊ ż ⌋

where kx, ky, kz and dx, dy, dz are force stiffness and damping constants and must have non-negative values.

Note

This is a “linear” bushing model as the force 𝐟 varies linearly with 𝐫 and 𝐫̇̇ as 𝐟 = 𝐟ᴋ + 𝐟ᴅ where 𝐟ᴋ = −Kxyz ⋅ 𝐫 and 𝐟ᴅ = −Dxyz ⋅ 𝐫̇̇.

This bushing’s constructor sets the torque stiffness/damping constants [k₀ k₁ k₂] and [d₀ d₁ d₂] and the force stiffness/damping constants [kx ky kz] and [dx dy dz]. The examples below demonstrate how to model various joints that have a flexible (e.g., rubber) mount. The damping values below with ? may be set to 0 or a reasonable positive number.

Bushing type | torque constants | force constants ——————————–|:--------------------|:—————— z-axis revolute joint | k₀₁₂ = [k₀ k₁ 0] | kxyz = [kx ky kz] ^ | d₀₁₂ = [d₀ d₁ ?] | dxyz = [dx dy dz] x-axis prismatic joint | k₀₁₂ = [k₀ k₁ k₂] | kxyz = [0 ky kz] ^ | d₀₁₂ = [d₀ d₁ d₂] | dxyz = [? dy dz] Ball and socket joint | k₀₁₂ = [0 0 0] | kxyz = [kx ky kz] ^ | d₀₁₂ = [? ? ?] | dxyz = [dx dy dz] Weld/fixed joint | k₀₁₂ = [k₀ k₁ k₂] | kxyz = [kx ky kz] ^ | d₀₁₂ = [d₀ d₁ d₂] | dxyz = [dx dy dz]

Angles q₀, q₁, q₂ are calculated from frame C’s orientation relative to frame A, with [−π < q₀ π, −π/2 q₁ π/2, −π < q₂ π], hence, there is no angle wrapping and torque stiffness has a limited range. Gimbal torques τ can be discontinuous if one of q₀, q₁, q₂ is discontinuous and its associated torque spring constant is nonzero. For example, τ₂ is discontinuous if k₂ 0 and the bushing has a large rotation so q₂ jumps from −π to π. τ can also be discontinuous if one of q̇₀, q̇₁, q̇₂ is discontinuous and its associated torque damper constant is nonzero. For example, τ₀ is discontinuous if d₀ 0 and q̇₀ is undefined (which occurs when pitch = q₁ = π/2). Note: Due to the relationship of 𝐭 to τ shown below, 𝐭 is discontinuous if τ is discontinuous.

As shown below, there are multiple ways to estimate torque and force stiffness and damping constants. Use a method or combination of methods appropriate for your application. For example, some methods are more useful for a real physical bushing whereas other methods (called “penalty methods”) can be more useful when replacing an ideal joint (such as a revolute or fixed/weld joint) with a bushing.

Consider a penalty method if you want a bushing to substitute for a “hard” constraint (e.g., an ideal joint). Since a bushing is inherently compliant it will violate a hard constraint somewhat. The stiffer the bushing, the more accurately it enforces the hard constraint, but at a cost of more computational time. To balance accuracy versus time, consider your tolerance for constraint errors. For example, is it OK for your bushing to displace xₘₐₓ = 1 mm for an estimated Fxₘₐₓ = 100 N? Also, one way to choose a force damping constant dx is by choosing a “reasonably small” settling time tₛ, where settling time tₛ is the interval of time for a system to settle to within 1% (0.01) of an equilibrium solution). Is tₛ = 0.01 s negligible for a robot arm with a 10 s reach maneuver?

**** How to choose a torque stiffness constant k₀ or damping constant d₀. The estimate of stiffness k₀ depends on whether you are modeling a physical bushing (consider stiffness methods 1 or 2 below) or whether you are using a bushing to replace an ideal joint such as a revolute or fixed/weld joint (consider stiffness “penalty methods” 3 or 4 below). 1. Use a static experiment, e.g., apply a known moment load Mx, measure the associated angular displacement Δq (radians), and estimate k₀ = Mx / Δq. 2. Use FEA (finite element analysis) software to estimate k₀. 3. Pick a desired maximum angular displacement qₘₐₓ, estimate a maximum moment load Mxₘₐₓ, and estimate k₀ = Mxₘₐₓ / qₘₐₓ (units of N*m/rad). 4. Choose a characteristic moment of inertia I₀ (directionally dependent), choose a desired angular frequency ωₙ > 0 (in rad/s) and estimate k₀ = I₀ ωₙ² (units of N*m/rad).

The estimate of damping d₀ depends on whether you are modeling a physical bushing (consider damping method 1 below) or whether you are using a bushing to enforce a constraint (consider damping methods 2 or 3 below). 1. Use experiments to estimate a damping ratio ζ and settling time tₛ. Compute “undamped natural frequency” ωₙ from ζ and tₛ (as shown below in the Advanced section), then d₀ = 2 ζ k₀ / ωₙ (units of N*m*s/rad). 2. Choose a damping ratio ζ (e.g., ζ = 1, critical damping) and a desired settling time tₛ, calculate ωₙ (as shown below in the Advanced section), then d₀ = 2 ζ k₀ / ωₙ (units of N*m*s/rad). 3. Choose a damping ratio ζ (e.g., ζ = 1, critical damping), estimate a characteristic moment of inertia and calculate d₀ = 2 ζ √(I₀ k₀).

Refer to Advanced_bushing_stiffness_and_damping “Advanced bushing stiffness and damping” for more details.

**** How to choose a force stiffness constant kx or damping constant dx. The estimate of stiffness kx depends on whether you are modeling a real bushing (consider stiffness methods 1 or 2 below) or whether you are using a bushing to replace an ideal joint such as a revolute or fixed/weld joint (consider stiffness “penalty methods” 3 or 4 below). 1. Use a static experiment, e.g., apply a known force load Fx, measure the associated displacement (stretch) Δx (in meters), and estimate kx = Fx / Δx. 2. Use FEA (finite element analysis) software to estimate kx (units of N/m). 3. Pick a desired maximum displacement xₘₐₓ, estimate a maximum force load Fxₘₐₓ, and estimate kx = Fxₘₐₓ / xₘₐₓ (units of N/m). 4. Choose a characteristic mass m (which may be directionally dependent), choose a desired angular frequency ωₙ > 0 (in rad/s) and estimate kx = m ωₙ² (units of N/m).

The estimate of damping dx depends on whether you are modeling a physical bushing (consider damping method 1 below) or whether you are using a bushing to enforce a constraint (consider damping methods 2 or 3 below). 1. Use experiments to estimate a damping ratio ζ and settling time tₛ. Compute “undamped natural frequency” ωₙ from ζ and tₛ (as shown below in the Advanced section), then dx = 2 ζ kx / ωₙ (units of N*s/m). 2. Choose a damping ratio ζ (e.g., ζ = 1, critical damping) and a desired settling time tₛ, calculate ωₙ (as shown below in the Advanced section), then dx = 2 ζ kx / ωₙ (units of N*s/m). 3. Choose a damping ratio ζ (e.g., ζ = 1, critical damping), estimate a characteristic mass m and calculate dx = 2 ζ √(m kx) (units of N*s/m).

Refer to Advanced_bushing_stiffness_and_damping “Advanced bushing stiffness and damping” for more details.

**** Advanced: Relationship of 𝐭 to τ. To understand how “gimbal torques” τ relate to 𝐭, it helps to remember that the RollPitchYaw class documentation states that a Space-fixed (extrinsic) X-Y-Z rotation with roll-pitch-yaw angles [q₀ q₁ q₂] is equivalent to a Body-fixed (intrinsic) Z-Y-X rotation by yaw-pitch-roll angles [q₂ q₁ q₀]. In the context of “gimbal torques”, the Body-fixed Z-Y-X rotation sequence with angles [q₂ q₁ q₀] is physical meaningful as it produces torques associated with successive frames in a gimbal as τ₂ 𝐀𝐳, τ₁ 𝐏𝐲, τ₀ 𝐂𝐱, where each of 𝐀𝐳, 𝐏𝐲, 𝐂𝐱 are unit vectors associated with a frame in the yaw-pitch-roll rotation sequence and 𝐏𝐲 is a unit vector of the “pitch” intermediate frame. As described earlier, torque 𝐭 is the moment of the bushing forces on frame C about Cp. Scalars tx, ty, tz are defined so 𝐭 can be expressed 𝐭 = [tx ty tz]ᴀ = tx 𝐀𝐱 + ty 𝐀𝐲 + tz 𝐀𝐳. As shown in code documentation, the relationship of [tx ty tz] to [τ₀ τ₁ τ₂] was found by equating 𝐭’s power to τ’s power as 𝐭 ⋅ w_AC = τ ⋅ q̇.

⌈ tx ⌉      ⌈ τ₀ ⌉            ⌈ cos(q₂)/cos(q₁)  sin(q₂)/cos(q₁)   0 ⌉
| ty | = Nᵀ | τ₁ |  where N = |   −sin(q2)            cos(q2)      0 |
⌊ tz ⌋      ⌊ τ₂ ⌋            ⌊ cos(q₂)*tan(q₁)   sin(q₂)*tan(q₁)  1 ⌋

**** Advanced: More on how to choose bushing stiffness and damping constants. The basics on how to choose bushing stiffness and damping constants are at: - Basic_bushing_torque_stiffness_and_damping “How to choose torque stiffness and damping constants” - Basic_bushing_force_stiffness_and_damping “How to choose force stiffness and damping constants”

The list below provides more detail on: The performance tradeoff between high stiffness and long simulation time; loads that affect estimates of Mxₘₐₓ or Fxₘₐₓ; and how a linear 2ⁿᵈ-order ODE provides insight on how to experimentally determine stiffness and damping constants. - Stiffness [k₀ k₁ k₂] and [kx ky kz] affect simulation time and accuracy. Generally, a stiffer bushing better resembles an ideal joint (e.g., a revolute joint or fixed/weld joint). However (depending on integrator), a stiffer bushing usually increases numerical integration time. - An estimate for a maximum load Mxₘₐₓ or Fxₘₐₓ accounts for gravity forces, applied forces, inertia forces (centripetal, Coriolis, gyroscopic), etc. - One way to determine physical stiffness and damping constants is through the mathematical intermediaries ωₙ (units of rad/s) and ζ (no units). The constant ωₙ (called “undamped natural frequency” or “angular frequency”) and constant ζ (called “damping ratio”) relate to the physical constants mass m, damping constant dx, and stiffness constant kx via the following prototypical linear constant-coefficient 2ⁿᵈ-order ODEs.

m ẍ +     dx ẋ +  kx x = 0   or alternatively as
   ẍ + 2 ζ ωₙ ẋ + ωₙ² x = 0   where ωₙ² = kx/m,  ζ = dx / (2 √(m kx))

ωₙ and ζ also appear in the related ODEs for rotational systems, namely

I₀ q̈ +     d₀ q̇ +  k₀ q = 0   or alternatively as
    q̈ + 2 ζ ωₙ q̇ + ωₙ² q = 0   where ωₙ² = k₀/I₀,  ζ = d₀ / (2 √(I₀ k₀))

One way to determine ωₙ is from settling time tₛ which approximates the time for a system to settle to within a specified settling ratio of an equilibrium solutions. Typical values for settling ratio are 1% (0.01), 2% (0.02), 5% (0.05), and 10% (0.10). - When ζ < 0.7 (underdamped), a commonly used approximation is ωₙ ≈ -ln(settling_ratio) / (ζ tₛ) which for settling ratios 0.01 and 0.05 give ωₙ ≈ 4.6 / (ζ tₛ) and ωₙ ≈ 3 / (ζ tₛ). Another commonly used approximation is ωₙ ≈ -ln(settling_ratio √(1- ζ²)) / (ζ tₛ). See https://en.wikipedia.org/wiki/Settling_time or the book Modern Control Engineering by Katsuhiko Ogata. Although these approximate formulas for ωₙ are common, they are somewhat inaccurate. Settling time for underdamped systems is discontinuous and requires solving a nonlinear algebraic equation (an iterative process). For more information, see http://www.scielo.org.co/pdf/rfiua/n66/n66a09.pdf [Ramos-Paja, et. al 2012], “Accurate calculation of settling time in second order systems: a photovoltaic application”. Another reference is https://courses.grainger.illinois.edu/ece486/sp2020/laboratory/docs/lab2/estimates.html - When ζ ≈ 1 (critically damped), ωₙ is determined by choosing a settling ratio and then solving for (ωₙ tₛ) via the nonlinear algebraic equation (1 + ωₙ tₛ)*exp(-ωₙ tₛ) = settling_ratio. Settling ratio | ωₙ ————– | ————- 0.01 | 6.64 / tₛ 0.02 | 5.83 / tₛ 0.05 | 4.74 / tₛ 0.10 | 3.89 / tₛ See https://electronics.stackexchange.com/questions/296567/over-and-critically-damped-systems-settling-time - When ζ ≥ 1.01 (overdamped), ωₙ ≈ -ln(2 settling_ratio sz/s₂) / (s₁ tₛ) where sz = √(ζ² - 1), s₁ = ζ - sz, s₂ = ζ + sz. The derivation and approximation error estimates for this overdamped settling time formula is ApproximateOverdampedSettlingTime “below”.

  • For a real physical bushing, an experiment is one way to estimate damping

constants. For example, to estimate a torque damping constant d₀ associated with underdamped vibrations (damping ratio 0 < ζ < 1), attach the bushing to a massive rod, initially displace the rod by angle Δq, release the rod and measure q(t). From the q(t) measurement, estimate decay ratio (the ratio of successive peak heights above the final steady-state value) calculate logarithmic decrement δ = -ln(decay_ratio), calculate damping ratio ζ = √(δ² / (4π² + δ²)), then calculate d₀ using d₀ = 2 ζ √(I₀ k₀) or d₀ = 2 ζ k₀ / ωₙ. For more information, see https://en.wikipedia.org/wiki/Damping_ratio#Logarithmic_decrement

**** Derivation: Approximate formula for overdamped settling time. Since a literature reference for this formula was not found, the derivation below was done at TRI (it has not been peer reviewed). This formula results from the “dominant pole” solution in the prototypical constant-coefficient linear 2ⁿᵈ-order ODE. For ẋ(0) = 0, mathematics shows poles p₁ = -ωₙ s₁, p₂ = -ωₙ s₂, where sz = √(ζ² - 1), s₁ = ζ - sz, s₂ = ζ + sz. and

x(t) / x(0) = p₂/(p₂-p₁) exp(p₁ t) - p₁/(p₂-p₁) exp(p₂ t)
             = s₂/(s₂-s₁) exp(p₁ t) - s₁/(s₂-s₁) exp(p₂ t)
             =  k/( k-1 ) exp(p₁ t) -  1/( k-1 ) exp(p₂ t) where k = s₂ / s₁
             ≈  k/( k-1 ) exp(p₁ t)                        since p₁ > p₂

Note: k = s₂ / s₁ is real, k > 0, s₂ = k s₁, and p₁ > p₂ (p₁ is less negative then p₂), so exp(p₁ t) decays to zero slower than exp(p₂ t) and exp(p₁ t) ≫ exp(p₂ t) for sufficiently large t. Hence we assume exp(p₂ t) ≈ 0 (which is why p₁ is called the “dominant pole”). Next,

k/(k - 1) = s₂ / s₁ / (s₂/s₁ -1) = s₂ / (s₂ - s₁) = s₂ / (2 sz),  so
  x(t) / x(0)  ≈  s₂ / (2 sz) exp(-s₁ ωₙ t),                        hence
  settling_ratio ≈ s₂ / (2 sz) exp(-s₁ ωₙ tₛ),                      finally
  ωₙ ≈ -ln(settling_ratio 2 sz / s₂) / (s₁ tₛ)

The table below shows that there is little error in this approximate formula for various settling ratios and ζ, particularly for ζ ≥ 1.1. For 1.0 ≤ ζ < 1.1, the critical damping estimates of ωₙ work well. Settling ratio | ζ = 1.01 | ζ = 1.1 | ζ = 1.2 | ζ = 1.3 | ζ = 1.5 ————– | ——– | ——- | ——- | ——- | ——– 0.01 | 1.98% | 0.005% | 2.9E-5% | 1.6E-7% | 2.4E-12% 0.02 | 2.91% | 0.016% | 1.8E-4% | 2.1E-6% | 1.6E-10% 0.05 | 5.10% | 0.076% | 2.3E-3% | 7.0E-5% | 4.4E-8% 0.10 | 8.28% | 0.258% | 1.6E-2% | 1.0E-3% | 3.3E-6% Note: There is a related derivation in the reference below, however, it needlessly makes the oversimplified approximation k/(k - 1) ≈ 1. https://electronics.stackexchange.com/questions/296567/over-and-critically-damped-systems-settling-time

Note

The complete theory for this bushing is documented in the source code. Please look there if you want more information.

Template parameter T:
The underlying scalar type. Must be a valid Eigen scalar.

See also

math::RollPitchYaw for definitions of roll, pitch, yaw [q₀ q₁ q₂].

Note

Per issue #12982, do not directly or indirectly call the following methods as they have not yet been implemented and throw an exception: CalcPotentialEnergy(), CalcConservativePower(), CalcNonConservativePower().

__init__(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], frameA: pydrake.multibody.tree.Frame_[float], frameC: pydrake.multibody.tree.Frame_[float], torque_stiffness_constants: numpy.ndarray[numpy.float64[3, 1]], torque_damping_constants: numpy.ndarray[numpy.float64[3, 1]], force_stiffness_constants: numpy.ndarray[numpy.float64[3, 1]], force_damping_constants: numpy.ndarray[numpy.float64[3, 1]]) → None

Construct a LinearBushingRollPitchYaw B that connects frames A and C, where frame A is welded to a link L0 and frame C is welded to a link L1.

Parameter frameA:
frame A of link (body) L0 that connects to bushing B.
Parameter frameC:
frame C of link (body) L1 that connects to bushing B.
Parameter torque_stiffness_constants:
[k₀ k₁ k₂] multiply the roll-pitch-yaw angles [q₀ q₁ q₂] to produce the spring portion of the “gimbal” torques τ₀, τ₁, τ₂. The SI units of k₀, k₁, k₂ are N*m/rad.
Parameter torque_damping_constants:
[d₀ d₁ d₂] multiply the roll-pitch-yaw rates [q̇₀ q̇₁ q̇₂] to produce the damper portion of the “gimbal” torques τ₀, τ₁, τ₂. The SI units of d₀, d₁, d₂ are N*m*s/rad.
Parameter force_stiffness_constants:
[kx ky kz] multiply the bushing displacements [x y z] to form 𝐟ᴋ, the spring portion of the force 𝐟 = [fx fy fz]ʙ. The SI units of kx, ky, kz are N/m.
Parameter force_damping_constants:
[dx dy dz] multiply the bushing displacement rates [ẋ ż] to form 𝐟ᴅ, the damper portion of the force 𝐟 = [fx fy fz]ʙ. The SI units of dx, dy, dz are N*s/m.

Note

The LinearBushingRollPitchYaw class documentation describes the stiffness and damping constants.

Note

The net moment on C about Co is affected by both the gimbal torque and the moment of 𝐟 about Co. Similarly, for the net moment on A about Ao.

Note

math::RollPitchYaw describes the roll pitch yaw angles q₀, q₁, q₂. The position from Ao to Co is p_AoCo_B = x 𝐁𝐱 + y 𝐁𝐲 + z 𝐁𝐳 = [x y z]ʙ.

Note

The ModelInstanceIndex assigned to this by the constructor is the one assigned to frame C, i.e., frameC.model_instance().

Precondition:
All the stiffness and damping constants must be non-negative.
CalcBushingSpatialForceOnFrameA(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.multibody.math.SpatialForce_[float]

Calculate F_A_A, the bushing’s spatial force on frame A expressed in A. F_A_A contains two vectors: the moment of all bushing forces on A about Ao (−𝐭 + p_AoAp × −𝐟) and the net bushing force on A (−𝐟 expressed in A).

Parameter context:
The state of the multibody system.

See also

CalcBushingSpatialForceOnFrameC().

Raises:RuntimeError if pitch angle is near gimbal-lock. For more info,

See also

RollPitchYaw::DoesCosPitchAngleViolateGimbalLockTolerance().

CalcBushingSpatialForceOnFrameC(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.multibody.math.SpatialForce_[float]

Calculate F_C_C, the bushing’s spatial force on frame C expressed in C. F_C_C contains two vectors: the moment of all bushing forces on C about Co (𝐭 + p_CoCp × 𝐟) and the resultant bushing force on C (𝐟 expressed in C).

Parameter context:
The state of the multibody system.

See also

CalcBushingSpatialForceOnFrameA().

Raises:RuntimeError if pitch angle is near gimbal-lock. For more info,

See also

RollPitchYaw::DoesCosPitchAngleViolateGimbalLockTolerance().

force_damping_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default force damping constants [dx dy dz] (units of N*s/m). Refer to Basic_bushing_force_stiffness_and_damping “How to choose force stiffness and damping constants” for more details.

force_stiffness_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default force stiffness constants [kx ky kz] (units of N/m). Refer to Basic_bushing_force_stiffness_and_damping “How to choose force stiffness and damping constants” for more details.

frameA(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → pydrake.multibody.tree.Frame_[float]

Returns frame A, which is the frame that is welded to link (body) L0 and attached to the bushing.

frameC(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → pydrake.multibody.tree.Frame_[float]

Returns frame C, which is the frame that is welded to link (body) L1 and attached to the bushing.

GetForceDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the force damping constants [dx dy dz] (units of N*s/m) stored in context.

GetForceStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the force stiffness constants [kx ky kz] (units of N/m) stored in context.

GetTorqueDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the torque damping constants [d₀ d₁ d₂] (units of N*m*s/rad) stored in context.

GetTorqueStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the torque stiffness constants [k₀ k₁ k₂] (units of N*m/rad) stored in context.

link0(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → pydrake.multibody.tree.Body_[float]

Returns link (body) L0 (frame A is welded to link L0).

link1(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → pydrake.multibody.tree.Body_[float]

Returns link (body) L1 (frame C is welded to link L1).

SetForceDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float], force_damping: numpy.ndarray[numpy.float64[3, 1]]) → None

Sets the force damping constants [dx dy dz] (units of N*s/m) in context.

SetForceStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float], force_stiffness: numpy.ndarray[numpy.float64[3, 1]]) → None

Sets the force stiffness constants [kx ky kz] (units of N/m) in context.

SetTorqueDampingConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float], torque_damping: numpy.ndarray[numpy.float64[3, 1]]) → None

Sets the torque damping constants [d₀ d₁ d₂] (units of N*m*s/rad) in context.

SetTorqueStiffnessConstants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float], context: pydrake.systems.framework.Context_[float], torque_stiffness: numpy.ndarray[numpy.float64[3, 1]]) → None

Sets the torque stiffness constants [k₀ k₁ k₂] (units of N*m/rad) in context.

torque_damping_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default torque damping constants [d₀ d₁ d₂] (units of N*m*s/rad). Refer to Basic_bushing_torque_stiffness_and_damping “How to choose torque stiffness and damping constants” for more details.

torque_stiffness_constants(self: pydrake.multibody.tree.LinearBushingRollPitchYaw_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the default torque stiffness constants [k₀ k₁ k₂] (units of N*m/rad). Refer to Basic_bushing_torque_stiffness_and_damping “How to choose torque stiffness and damping constants” for more details.

pydrake.multibody.tree.LinearSpringDamper

alias of pydrake.multibody.tree.LinearSpringDamper_[float]

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, = (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 on bodyB. Point P is defined by its position p_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.
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 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, = (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_[AutoDiffXd], bodyA: pydrake.multibody.tree.Body_[AutoDiffXd], p_AP: numpy.ndarray[numpy.float64[3, 1]], bodyB: pydrake.multibody.tree.Body_[AutoDiffXd], 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 on bodyB. Point P is defined by its position p_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.
bodyA(self: pydrake.multibody.tree.LinearSpringDamper_[AutoDiffXd]) → pydrake.multibody.tree.Body_[AutoDiffXd]
bodyB(self: pydrake.multibody.tree.LinearSpringDamper_[AutoDiffXd]) → pydrake.multibody.tree.Body_[AutoDiffXd]
damping(self: pydrake.multibody.tree.LinearSpringDamper_[AutoDiffXd]) → float
free_length(self: pydrake.multibody.tree.LinearSpringDamper_[AutoDiffXd]) → float
p_AP(self: pydrake.multibody.tree.LinearSpringDamper_[AutoDiffXd]) → 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_[AutoDiffXd]) → 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_[AutoDiffXd]) → float
class pydrake.multibody.tree.LinearSpringDamper_[Expression]

Bases: pydrake.multibody.tree.ForceElement_[Expression]

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, = (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_[Expression], bodyA: pydrake.multibody.tree.Body_[Expression], p_AP: numpy.ndarray[numpy.float64[3, 1]], bodyB: pydrake.multibody.tree.Body_[Expression], 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 on bodyB. Point P is defined by its position p_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.
bodyA(self: pydrake.multibody.tree.LinearSpringDamper_[Expression]) → pydrake.multibody.tree.Body_[Expression]
bodyB(self: pydrake.multibody.tree.LinearSpringDamper_[Expression]) → pydrake.multibody.tree.Body_[Expression]
damping(self: pydrake.multibody.tree.LinearSpringDamper_[Expression]) → float
free_length(self: pydrake.multibody.tree.LinearSpringDamper_[Expression]) → float
p_AP(self: pydrake.multibody.tree.LinearSpringDamper_[Expression]) → 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_[Expression]) → 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_[Expression]) → float
class pydrake.multibody.tree.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, = (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 on bodyB. Point P is defined by its position p_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.
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 pydrake.multibody.tree.ModelInstanceIndex

Type used to identify model instances by index within a multibody tree system.

__init__(self: pydrake.multibody.tree.ModelInstanceIndex, 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.ModelInstanceIndex) → 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.MultibodyForces

alias of pydrake.multibody.tree.MultibodyForces_[float]

template pydrake.multibody.tree.MultibodyForces_

Instantiations: MultibodyForces_[float], MultibodyForces_[AutoDiffXd], MultibodyForces_[Expression]

class MultibodyForces_[float]

A class to hold a set of forces applied to a MultibodyTree system. Forces can include generalized forces as well as body spatial forces.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.multibody.tree.MultibodyForces_[float], plant: drake::multibody::MultibodyPlant<double>) -> None

Constructs a force object to store a set of forces to be applied to the multibody model for plant. Forces are initialized to zero, meaning no forces are applied. plant must have been already finalized with MultibodyPlant::Finalize() or this constructor will abort.

  1. __init__(self: pydrake.multibody.tree.MultibodyForces_[float], nb: int, nv: int) -> None

Number of bodies and number of generalized velocities overload. This constructor is useful for constructing the MultibodyForces structure before a MultibodyPlant has been consructed.

AddInForces(self: pydrake.multibody.tree.MultibodyForces_[float], addend: pydrake.multibody.tree.MultibodyForces_[float]) → None

Adds into this the force contribution stored in addend.

generalized_forces(self: pydrake.multibody.tree.MultibodyForces_[float]) → numpy.ndarray[numpy.float64[m, 1]]

(Advanced) Returns a constant reference to the vector of generalized forces stored by this forces object.

mutable_generalized_forces(self: pydrake.multibody.tree.MultibodyForces_[float]) → numpy.ndarray[numpy.float64[m, 1]]

(Advanced) Mutable version of generalized_forces().

num_bodies(self: pydrake.multibody.tree.MultibodyForces_[float]) → int

Returns the number of bodies for which this force object applies. Determined at construction from the given model MultibodyTree object.

num_velocities(self: pydrake.multibody.tree.MultibodyForces_[float]) → int

Returns the number of generalized velocities for the model to which these forces apply. The number of generalized forces in a multibody model always equals the number of generalized velocities. Determined at construction from the given model MultibodyTree object.

SetZero(self: pydrake.multibody.tree.MultibodyForces_[float]) → pydrake.multibody.tree.MultibodyForces_[float]

Sets this to store zero forces (no applied forces).

class pydrake.multibody.tree.MultibodyForces_[AutoDiffXd]

A class to hold a set of forces applied to a MultibodyTree system. Forces can include generalized forces as well as body spatial forces.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.multibody.tree.MultibodyForces_[AutoDiffXd], plant: drake::multibody::MultibodyPlant<Eigen::AutoDiffScalar<Eigen::Matrix<double, -1, 1, 0, -1, 1> > >) -> None

Constructs a force object to store a set of forces to be applied to the multibody model for plant. Forces are initialized to zero, meaning no forces are applied. plant must have been already finalized with MultibodyPlant::Finalize() or this constructor will abort.

  1. __init__(self: pydrake.multibody.tree.MultibodyForces_[AutoDiffXd], nb: int, nv: int) -> None

Number of bodies and number of generalized velocities overload. This constructor is useful for constructing the MultibodyForces structure before a MultibodyPlant has been consructed.

AddInForces(self: pydrake.multibody.tree.MultibodyForces_[AutoDiffXd], addend: pydrake.multibody.tree.MultibodyForces_[AutoDiffXd]) → None

Adds into this the force contribution stored in addend.

generalized_forces(self: pydrake.multibody.tree.MultibodyForces_[AutoDiffXd]) → numpy.ndarray[object[m, 1]]

(Advanced) Returns a constant reference to the vector of generalized forces stored by this forces object.

mutable_generalized_forces(self: pydrake.multibody.tree.MultibodyForces_[AutoDiffXd]) → numpy.ndarray[object[m, 1]]

(Advanced) Mutable version of generalized_forces().

num_bodies(self: pydrake.multibody.tree.MultibodyForces_[AutoDiffXd]) → int

Returns the number of bodies for which this force object applies. Determined at construction from the given model MultibodyTree object.

num_velocities(self: pydrake.multibody.tree.MultibodyForces_[AutoDiffXd]) → int

Returns the number of generalized velocities for the model to which these forces apply. The number of generalized forces in a multibody model always equals the number of generalized velocities. Determined at construction from the given model MultibodyTree object.

SetZero(self: pydrake.multibody.tree.MultibodyForces_[AutoDiffXd]) → pydrake.multibody.tree.MultibodyForces_[AutoDiffXd]

Sets this to store zero forces (no applied forces).

class pydrake.multibody.tree.MultibodyForces_[Expression]

A class to hold a set of forces applied to a MultibodyTree system. Forces can include generalized forces as well as body spatial forces.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.multibody.tree.MultibodyForces_[Expression], plant: drake::multibody::MultibodyPlant<drake::symbolic::Expression>) -> None

Constructs a force object to store a set of forces to be applied to the multibody model for plant. Forces are initialized to zero, meaning no forces are applied. plant must have been already finalized with MultibodyPlant::Finalize() or this constructor will abort.

  1. __init__(self: pydrake.multibody.tree.MultibodyForces_[Expression], nb: int, nv: int) -> None

Number of bodies and number of generalized velocities overload. This constructor is useful for constructing the MultibodyForces structure before a MultibodyPlant has been consructed.

AddInForces(self: pydrake.multibody.tree.MultibodyForces_[Expression], addend: pydrake.multibody.tree.MultibodyForces_[Expression]) → None

Adds into this the force contribution stored in addend.

generalized_forces(self: pydrake.multibody.tree.MultibodyForces_[Expression]) → numpy.ndarray[object[m, 1]]

(Advanced) Returns a constant reference to the vector of generalized forces stored by this forces object.

mutable_generalized_forces(self: pydrake.multibody.tree.MultibodyForces_[Expression]) → numpy.ndarray[object[m, 1]]

(Advanced) Mutable version of generalized_forces().

num_bodies(self: pydrake.multibody.tree.MultibodyForces_[Expression]) → int

Returns the number of bodies for which this force object applies. Determined at construction from the given model MultibodyTree object.

num_velocities(self: pydrake.multibody.tree.MultibodyForces_[Expression]) → int

Returns the number of generalized velocities for the model to which these forces apply. The number of generalized forces in a multibody model always equals the number of generalized velocities. Determined at construction from the given model MultibodyTree object.

SetZero(self: pydrake.multibody.tree.MultibodyForces_[Expression]) → pydrake.multibody.tree.MultibodyForces_[Expression]

Sets this to store zero forces (no applied forces).

class pydrake.multibody.tree.MultibodyForces_[float]

A class to hold a set of forces applied to a MultibodyTree system. Forces can include generalized forces as well as body spatial forces.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.multibody.tree.MultibodyForces_[float], plant: drake::multibody::MultibodyPlant<double>) -> None

Constructs a force object to store a set of forces to be applied to the multibody model for plant. Forces are initialized to zero, meaning no forces are applied. plant must have been already finalized with MultibodyPlant::Finalize() or this constructor will abort.

  1. __init__(self: pydrake.multibody.tree.MultibodyForces_[float], nb: int, nv: int) -> None

Number of bodies and number of generalized velocities overload. This constructor is useful for constructing the MultibodyForces structure before a MultibodyPlant has been consructed.

AddInForces(self: pydrake.multibody.tree.MultibodyForces_[float], addend: pydrake.multibody.tree.MultibodyForces_[float]) → None

Adds into this the force contribution stored in addend.

generalized_forces(self: pydrake.multibody.tree.MultibodyForces_[float]) → numpy.ndarray[numpy.float64[m, 1]]

(Advanced) Returns a constant reference to the vector of generalized forces stored by this forces object.

mutable_generalized_forces(self: pydrake.multibody.tree.MultibodyForces_[float]) → numpy.ndarray[numpy.float64[m, 1]]

(Advanced) Mutable version of generalized_forces().

num_bodies(self: pydrake.multibody.tree.MultibodyForces_[float]) → int

Returns the number of bodies for which this force object applies. Determined at construction from the given model MultibodyTree object.

num_velocities(self: pydrake.multibody.tree.MultibodyForces_[float]) → int

Returns the number of generalized velocities for the model to which these forces apply. The number of generalized forces in a multibody model always equals the number of generalized velocities. Determined at construction from the given model MultibodyTree object.

SetZero(self: pydrake.multibody.tree.MultibodyForces_[float]) → pydrake.multibody.tree.MultibodyForces_[float]

Sets this to store zero forces (no applied forces).

pydrake.multibody.tree.PlanarJoint

alias of pydrake.multibody.tree.PlanarJoint_[float]

template pydrake.multibody.tree.PlanarJoint_

Instantiations: PlanarJoint_[float], PlanarJoint_[AutoDiffXd], PlanarJoint_[Expression]

class PlanarJoint_[float]

Bases: pydrake.multibody.tree.Joint_[float]

This joint models a planar joint allowing two bodies to translate and rotate relative to one another in a plane with three degrees of freedom. 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 translate within the x-y plane of frame F and to rotate about the z-axis, with M’s z-axis Mz and F’s z-axis Fz coincident at all times. The translations along the x- and y-axes of F, the rotation about the z-axis and their rates specify the state of the joint. Zero (x, y, θ) corresponds to frames F and M being coincident and aligned. Translation (x, y) is defined to be positive in the direction of the respective axes and the rotation θ is defined to be positive according to the right-hand-rule with the thumb aligned in the direction of frame F’s z-axis.

__init__(self: pydrake.multibody.tree.PlanarJoint_[float], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[float], frame_on_child: pydrake.multibody.tree.Frame_[float], damping: numpy.ndarray[numpy.float64[3, 1]] = array([ 0., 0., 0.])) → None

Constructor to create a planar joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B translate and rotate as described in the class’s documentation. 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⋅s/m for translation and N⋅m⋅s for rotation, used to model losses within the joint. See documentation of damping() for details on modelling of the damping force and torque.
Raises:RuntimeError if any element of damping is negative.
damping(self: pydrake.multibody.tree.PlanarJoint_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns this joint’s damping constant in N⋅s/m for the translational degrees and N⋅m⋅s for the rotational degree. The damping force (in N) is modeled as fᵢ = -dampingᵢ⋅vᵢ, i = 1, 2 i.e. opposing motion, with vᵢ the translation rates along the i-th axis for this joint (see get_translational_velocity()) and fᵢ the force on child body B at Mo and expressed in F. That is, f_BMo_F = (f₁, f₂). The damping torque (in N⋅m) is modeled as τ = -damping₃⋅ω i.e. opposing motion, with ω the angular rate for this joint (see get_angular_velocity()) and τ the torque on child body B expressed in frame F as t_B_F = τ⋅Fz_F.

get_angular_velocity(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float]) → float

Gets the rate of change, in radians per second, of this joint’s angle θ from context. See class documentation for the definition of this angle.

Parameter context:
The context of the model this joint belongs to.
Returns theta_dot:
The rate of change of this joint’s angle θ as stored in the context.
get_default_rotation(self: pydrake.multibody.tree.PlanarJoint_[float]) → float

Gets the default angle for this joint.

Returns theta:
The default angle of this joint.
get_default_translation(self: pydrake.multibody.tree.PlanarJoint_[float]) → numpy.ndarray[numpy.float64[2, 1]]

Gets the default position for this joint.

Returns p_FoMo_F:
The default position of this joint.
get_rotation(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float]) → float

Gets the angle θ of this joint from context.

Parameter context:
The context of the model this joint belongs to.
Returns theta:
The angle of this joint stored in the context. See class documentation for details.
get_translation(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[2, 1]]

Gets the position of this joint from context.

Parameter context:
The context of the model this joint belongs to.
Returns p_FoMo_F:
The position of this joint stored in the context ordered as (x, y). See class documentation for details.
get_translational_velocity(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[2, 1]]

Gets the translational velocity v_FoMo_F, in meters per second, of this joint’s Mo measured and expressed in frame F from context.

Parameter context:
The context of the model this joint belongs to.
Returns v_FoMo_F:
The translational velocity of this joint as stored in the context.
set_angular_velocity(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float], theta_dot: float) → pydrake.multibody.tree.PlanarJoint_[float]

Sets the rate of change, in radians per second, of this joint’s angle θ (see class documentation) to theta_dot. The new rate of change gets stored in context.

Parameter context:
The context of the model this joint belongs to.
Parameter theta_dot:
The desired rates of change of this joint’s angle in radians per second.
Returns:a constant reference to this joint.
set_default_pose(self: pydrake.multibody.tree.PlanarJoint_[float], p_FoMo_F: numpy.ndarray[numpy.float64[2, 1]], theta: float) → None

Sets the default position and angle of this joint.

Parameter p_FoMo_F:
The desired default position of the joint
Parameter theta:
The desired default angle of the joint
set_default_rotation(self: pydrake.multibody.tree.PlanarJoint_[float], theta: float) → None

Sets the default angle of this joint.

Parameter theta:
The desired default angle of the joint
set_default_translation(self: pydrake.multibody.tree.PlanarJoint_[float], p_FoMo_F: numpy.ndarray[numpy.float64[2, 1]]) → None

Sets the default position of this joint.

Parameter p_FoMo_F:
The desired default position of the joint
set_pose(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float], p_FoMo_F: numpy.ndarray[numpy.float64[2, 1]], theta: float) → pydrake.multibody.tree.PlanarJoint_[float]

Sets the context so that the position of this joint equals p_FoMo_F and its angle equals theta.

Parameter context:
The context of the model this joint belongs to.
Parameter p_FoMo_F:
The desired position in meters to be stored in context ordered as (x, y). See class documentation for details.
Parameter theta:
The desired angle in radians to be stored in context. See class documentation for details.
Returns:a constant reference to this joint.
set_random_pose_distribution(self: pydrake.multibody.tree.PlanarJoint_[float], p_FoMo_F: numpy.ndarray[object[2, 1]], theta: pydrake.symbolic.Expression) → None

Sets the random distribution that the position and angle of this joint will be randomly sampled from. See class documentation for details on the definition of the position and angle.

set_rotation(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float], theta: float) → pydrake.multibody.tree.PlanarJoint_[float]

Sets the context so that the angle θ of this joint equals theta.

Parameter context:
The context of the model this joint belongs to.
Parameter theta:
The desired angle in radians to be stored in context. See class documentation for details.
Returns:a constant reference to this joint.
set_translation(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float], p_FoMo_F: numpy.ndarray[numpy.float64[2, 1]]) → pydrake.multibody.tree.PlanarJoint_[float]

Sets the context so that the position of this joint equals p_FoMo_F.

Parameter context:
The context of the model this joint belongs to.
Parameter p_FoMo_F:
The desired position in meters to be stored in context ordered as (x, y). See class documentation for details.
Returns:a constant reference to this joint.
set_translational_velocity(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float], v_FoMo_F: numpy.ndarray[numpy.float64[2, 1]]) → pydrake.multibody.tree.PlanarJoint_[float]

Sets the translational velocity, in meters per second, of this this joint’s Mo measured and expressed in frame F to v_FoMo_F. The new translational velocity gets stored in context.

Parameter context:
The context of the model this joint belongs to.
Parameter v_FoMo_F:
The desired translational velocity of this joint in meters per second.
Returns:a constant reference to this joint.
class pydrake.multibody.tree.PlanarJoint_[AutoDiffXd]

Bases: pydrake.multibody.tree.Joint_[AutoDiffXd]

This joint models a planar joint allowing two bodies to translate and rotate relative to one another in a plane with three degrees of freedom. 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 translate within the x-y plane of frame F and to rotate about the z-axis, with M’s z-axis Mz and F’s z-axis Fz coincident at all times. The translations along the x- and y-axes of F, the rotation about the z-axis and their rates specify the state of the joint. Zero (x, y, θ) corresponds to frames F and M being coincident and aligned. Translation (x, y) is defined to be positive in the direction of the respective axes and the rotation θ is defined to be positive according to the right-hand-rule with the thumb aligned in the direction of frame F’s z-axis.

__init__(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[AutoDiffXd], frame_on_child: pydrake.multibody.tree.Frame_[AutoDiffXd], damping: numpy.ndarray[numpy.float64[3, 1]] = array([ 0., 0., 0.])) → None

Constructor to create a planar joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B translate and rotate as described in the class’s documentation. 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⋅s/m for translation and N⋅m⋅s for rotation, used to model losses within the joint. See documentation of damping() for details on modelling of the damping force and torque.
Raises:RuntimeError if any element of damping is negative.
damping(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd]) → numpy.ndarray[numpy.float64[3, 1]]

Returns this joint’s damping constant in N⋅s/m for the translational degrees and N⋅m⋅s for the rotational degree. The damping force (in N) is modeled as fᵢ = -dampingᵢ⋅vᵢ, i = 1, 2 i.e. opposing motion, with vᵢ the translation rates along the i-th axis for this joint (see get_translational_velocity()) and fᵢ the force on child body B at Mo and expressed in F. That is, f_BMo_F = (f₁, f₂). The damping torque (in N⋅m) is modeled as τ = -damping₃⋅ω i.e. opposing motion, with ω the angular rate for this joint (see get_angular_velocity()) and τ the torque on child body B expressed in frame F as t_B_F = τ⋅Fz_F.

get_angular_velocity(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.autodiffutils.AutoDiffXd

Gets the rate of change, in radians per second, of this joint’s angle θ from context. See class documentation for the definition of this angle.

Parameter context:
The context of the model this joint belongs to.
Returns theta_dot:
The rate of change of this joint’s angle θ as stored in the context.
get_default_rotation(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd]) → float

Gets the default angle for this joint.

Returns theta:
The default angle of this joint.
get_default_translation(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd]) → numpy.ndarray[numpy.float64[2, 1]]

Gets the default position for this joint.

Returns p_FoMo_F:
The default position of this joint.
get_rotation(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.autodiffutils.AutoDiffXd

Gets the angle θ of this joint from context.

Parameter context:
The context of the model this joint belongs to.
Returns theta:
The angle of this joint stored in the context. See class documentation for details.
get_translation(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → numpy.ndarray[object[2, 1]]

Gets the position of this joint from context.

Parameter context:
The context of the model this joint belongs to.
Returns p_FoMo_F:
The position of this joint stored in the context ordered as (x, y). See class documentation for details.
get_translational_velocity(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → numpy.ndarray[object[2, 1]]

Gets the translational velocity v_FoMo_F, in meters per second, of this joint’s Mo measured and expressed in frame F from context.

Parameter context:
The context of the model this joint belongs to.
Returns v_FoMo_F:
The translational velocity of this joint as stored in the context.
set_angular_velocity(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], theta_dot: pydrake.autodiffutils.AutoDiffXd) → pydrake.multibody.tree.PlanarJoint_[AutoDiffXd]

Sets the rate of change, in radians per second, of this joint’s angle θ (see class documentation) to theta_dot. The new rate of change gets stored in context.

Parameter context:
The context of the model this joint belongs to.
Parameter theta_dot:
The desired rates of change of this joint’s angle in radians per second.
Returns:a constant reference to this joint.
set_default_pose(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], p_FoMo_F: numpy.ndarray[numpy.float64[2, 1]], theta: float) → None

Sets the default position and angle of this joint.

Parameter p_FoMo_F:
The desired default position of the joint
Parameter theta:
The desired default angle of the joint
set_default_rotation(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], theta: float) → None

Sets the default angle of this joint.

Parameter theta:
The desired default angle of the joint
set_default_translation(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], p_FoMo_F: numpy.ndarray[numpy.float64[2, 1]]) → None

Sets the default position of this joint.

Parameter p_FoMo_F:
The desired default position of the joint
set_pose(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], p_FoMo_F: numpy.ndarray[object[2, 1]], theta: pydrake.autodiffutils.AutoDiffXd) → pydrake.multibody.tree.PlanarJoint_[AutoDiffXd]

Sets the context so that the position of this joint equals p_FoMo_F and its angle equals theta.

Parameter context:
The context of the model this joint belongs to.
Parameter p_FoMo_F:
The desired position in meters to be stored in context ordered as (x, y). See class documentation for details.
Parameter theta:
The desired angle in radians to be stored in context. See class documentation for details.
Returns:a constant reference to this joint.
set_random_pose_distribution(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], p_FoMo_F: numpy.ndarray[object[2, 1]], theta: pydrake.symbolic.Expression) → None

Sets the random distribution that the position and angle of this joint will be randomly sampled from. See class documentation for details on the definition of the position and angle.

set_rotation(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], theta: pydrake.autodiffutils.AutoDiffXd) → pydrake.multibody.tree.PlanarJoint_[AutoDiffXd]

Sets the context so that the angle θ of this joint equals theta.

Parameter context:
The context of the model this joint belongs to.
Parameter theta:
The desired angle in radians to be stored in context. See class documentation for details.
Returns:a constant reference to this joint.
set_translation(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], p_FoMo_F: numpy.ndarray[object[2, 1]]) → pydrake.multibody.tree.PlanarJoint_[AutoDiffXd]

Sets the context so that the position of this joint equals p_FoMo_F.

Parameter context:
The context of the model this joint belongs to.
Parameter p_FoMo_F:
The desired position in meters to be stored in context ordered as (x, y). See class documentation for details.
Returns:a constant reference to this joint.
set_translational_velocity(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], v_FoMo_F: numpy.ndarray[object[2, 1]]) → pydrake.multibody.tree.PlanarJoint_[AutoDiffXd]

Sets the translational velocity, in meters per second, of this this joint’s Mo measured and expressed in frame F to v_FoMo_F. The new translational velocity gets stored in context.

Parameter context:
The context of the model this joint belongs to.
Parameter v_FoMo_F:
The desired translational velocity of this joint in meters per second.
Returns:a constant reference to this joint.
class pydrake.multibody.tree.PlanarJoint_[Expression]

Bases: pydrake.multibody.tree.Joint_[Expression]

This joint models a planar joint allowing two bodies to translate and rotate relative to one another in a plane with three degrees of freedom. 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 translate within the x-y plane of frame F and to rotate about the z-axis, with M’s z-axis Mz and F’s z-axis Fz coincident at all times. The translations along the x- and y-axes of F, the rotation about the z-axis and their rates specify the state of the joint. Zero (x, y, θ) corresponds to frames F and M being coincident and aligned. Translation (x, y) is defined to be positive in the direction of the respective axes and the rotation θ is defined to be positive according to the right-hand-rule with the thumb aligned in the direction of frame F’s z-axis.

__init__(self: pydrake.multibody.tree.PlanarJoint_[Expression], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[Expression], frame_on_child: pydrake.multibody.tree.Frame_[Expression], damping: numpy.ndarray[numpy.float64[3, 1]] = array([ 0., 0., 0.])) → None

Constructor to create a planar joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B translate and rotate as described in the class’s documentation. 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⋅s/m for translation and N⋅m⋅s for rotation, used to model losses within the joint. See documentation of damping() for details on modelling of the damping force and torque.
Raises:RuntimeError if any element of damping is negative.
damping(self: pydrake.multibody.tree.PlanarJoint_[Expression]) → numpy.ndarray[numpy.float64[3, 1]]

Returns this joint’s damping constant in N⋅s/m for the translational degrees and N⋅m⋅s for the rotational degree. The damping force (in N) is modeled as fᵢ = -dampingᵢ⋅vᵢ, i = 1, 2 i.e. opposing motion, with vᵢ the translation rates along the i-th axis for this joint (see get_translational_velocity()) and fᵢ the force on child body B at Mo and expressed in F. That is, f_BMo_F = (f₁, f₂). The damping torque (in N⋅m) is modeled as τ = -damping₃⋅ω i.e. opposing motion, with ω the angular rate for this joint (see get_angular_velocity()) and τ the torque on child body B expressed in frame F as t_B_F = τ⋅Fz_F.

get_angular_velocity(self: pydrake.multibody.tree.PlanarJoint_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.symbolic.Expression

Gets the rate of change, in radians per second, of this joint’s angle θ from context. See class documentation for the definition of this angle.

Parameter context:
The context of the model this joint belongs to.
Returns theta_dot:
The rate of change of this joint’s angle θ as stored in the context.
get_default_rotation(self: pydrake.multibody.tree.PlanarJoint_[Expression]) → float

Gets the default angle for this joint.

Returns theta:
The default angle of this joint.
get_default_translation(self: pydrake.multibody.tree.PlanarJoint_[Expression]) → numpy.ndarray[numpy.float64[2, 1]]

Gets the default position for this joint.

Returns p_FoMo_F:
The default position of this joint.
get_rotation(self: pydrake.multibody.tree.PlanarJoint_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.symbolic.Expression

Gets the angle θ of this joint from context.

Parameter context:
The context of the model this joint belongs to.
Returns theta:
The angle of this joint stored in the context. See class documentation for details.
get_translation(self: pydrake.multibody.tree.PlanarJoint_[Expression], context: pydrake.systems.framework.Context_[Expression]) → numpy.ndarray[object[2, 1]]

Gets the position of this joint from context.

Parameter context:
The context of the model this joint belongs to.
Returns p_FoMo_F:
The position of this joint stored in the context ordered as (x, y). See class documentation for details.
get_translational_velocity(self: pydrake.multibody.tree.PlanarJoint_[Expression], context: pydrake.systems.framework.Context_[Expression]) → numpy.ndarray[object[2, 1]]

Gets the translational velocity v_FoMo_F, in meters per second, of this joint’s Mo measured and expressed in frame F from context.

Parameter context:
The context of the model this joint belongs to.
Returns v_FoMo_F:
The translational velocity of this joint as stored in the context.
set_angular_velocity(self: pydrake.multibody.tree.PlanarJoint_[Expression], context: pydrake.systems.framework.Context_[Expression], theta_dot: pydrake.symbolic.Expression) → pydrake.multibody.tree.PlanarJoint_[Expression]

Sets the rate of change, in radians per second, of this joint’s angle θ (see class documentation) to theta_dot. The new rate of change gets stored in context.

Parameter context:
The context of the model this joint belongs to.
Parameter theta_dot:
The desired rates of change of this joint’s angle in radians per second.
Returns:a constant reference to this joint.
set_default_pose(self: pydrake.multibody.tree.PlanarJoint_[Expression], p_FoMo_F: numpy.ndarray[numpy.float64[2, 1]], theta: float) → None

Sets the default position and angle of this joint.

Parameter p_FoMo_F:
The desired default position of the joint
Parameter theta:
The desired default angle of the joint
set_default_rotation(self: pydrake.multibody.tree.PlanarJoint_[Expression], theta: float) → None

Sets the default angle of this joint.

Parameter theta:
The desired default angle of the joint
set_default_translation(self: pydrake.multibody.tree.PlanarJoint_[Expression], p_FoMo_F: numpy.ndarray[numpy.float64[2, 1]]) → None

Sets the default position of this joint.

Parameter p_FoMo_F:
The desired default position of the joint
set_pose(self: pydrake.multibody.tree.PlanarJoint_[Expression], context: pydrake.systems.framework.Context_[Expression], p_FoMo_F: numpy.ndarray[object[2, 1]], theta: pydrake.symbolic.Expression) → pydrake.multibody.tree.PlanarJoint_[Expression]

Sets the context so that the position of this joint equals p_FoMo_F and its angle equals theta.

Parameter context:
The context of the model this joint belongs to.
Parameter p_FoMo_F:
The desired position in meters to be stored in context ordered as (x, y). See class documentation for details.
Parameter theta:
The desired angle in radians to be stored in context. See class documentation for details.
Returns:a constant reference to this joint.
set_random_pose_distribution(self: pydrake.multibody.tree.PlanarJoint_[Expression], p_FoMo_F: numpy.ndarray[object[2, 1]], theta: pydrake.symbolic.Expression) → None

Sets the random distribution that the position and angle of this joint will be randomly sampled from. See class documentation for details on the definition of the position and angle.

set_rotation(self: pydrake.multibody.tree.PlanarJoint_[Expression], context: pydrake.systems.framework.Context_[Expression], theta: pydrake.symbolic.Expression) → pydrake.multibody.tree.PlanarJoint_[Expression]

Sets the context so that the angle θ of this joint equals theta.

Parameter context:
The context of the model this joint belongs to.
Parameter theta:
The desired angle in radians to be stored in context. See class documentation for details.
Returns:a constant reference to this joint.
set_translation(self: pydrake.multibody.tree.PlanarJoint_[Expression], context: pydrake.systems.framework.Context_[Expression], p_FoMo_F: numpy.ndarray[object[2, 1]]) → pydrake.multibody.tree.PlanarJoint_[Expression]

Sets the context so that the position of this joint equals p_FoMo_F.

Parameter context:
The context of the model this joint belongs to.
Parameter p_FoMo_F:
The desired position in meters to be stored in context ordered as (x, y). See class documentation for details.
Returns:a constant reference to this joint.
set_translational_velocity(self: pydrake.multibody.tree.PlanarJoint_[Expression], context: pydrake.systems.framework.Context_[Expression], v_FoMo_F: numpy.ndarray[object[2, 1]]) → pydrake.multibody.tree.PlanarJoint_[Expression]

Sets the translational velocity, in meters per second, of this this joint’s Mo measured and expressed in frame F to v_FoMo_F. The new translational velocity gets stored in context.

Parameter context:
The context of the model this joint belongs to.
Parameter v_FoMo_F:
The desired translational velocity of this joint in meters per second.
Returns:a constant reference to this joint.
class pydrake.multibody.tree.PlanarJoint_[float]

Bases: pydrake.multibody.tree.Joint_[float]

This joint models a planar joint allowing two bodies to translate and rotate relative to one another in a plane with three degrees of freedom. 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 translate within the x-y plane of frame F and to rotate about the z-axis, with M’s z-axis Mz and F’s z-axis Fz coincident at all times. The translations along the x- and y-axes of F, the rotation about the z-axis and their rates specify the state of the joint. Zero (x, y, θ) corresponds to frames F and M being coincident and aligned. Translation (x, y) is defined to be positive in the direction of the respective axes and the rotation θ is defined to be positive according to the right-hand-rule with the thumb aligned in the direction of frame F’s z-axis.

__init__(self: pydrake.multibody.tree.PlanarJoint_[float], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[float], frame_on_child: pydrake.multibody.tree.Frame_[float], damping: numpy.ndarray[numpy.float64[3, 1]] = array([ 0., 0., 0.])) → None

Constructor to create a planar joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B translate and rotate as described in the class’s documentation. 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⋅s/m for translation and N⋅m⋅s for rotation, used to model losses within the joint. See documentation of damping() for details on modelling of the damping force and torque.
Raises:RuntimeError if any element of damping is negative.
damping(self: pydrake.multibody.tree.PlanarJoint_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns this joint’s damping constant in N⋅s/m for the translational degrees and N⋅m⋅s for the rotational degree. The damping force (in N) is modeled as fᵢ = -dampingᵢ⋅vᵢ, i = 1, 2 i.e. opposing motion, with vᵢ the translation rates along the i-th axis for this joint (see get_translational_velocity()) and fᵢ the force on child body B at Mo and expressed in F. That is, f_BMo_F = (f₁, f₂). The damping torque (in N⋅m) is modeled as τ = -damping₃⋅ω i.e. opposing motion, with ω the angular rate for this joint (see get_angular_velocity()) and τ the torque on child body B expressed in frame F as t_B_F = τ⋅Fz_F.

get_angular_velocity(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float]) → float

Gets the rate of change, in radians per second, of this joint’s angle θ from context. See class documentation for the definition of this angle.

Parameter context:
The context of the model this joint belongs to.
Returns theta_dot:
The rate of change of this joint’s angle θ as stored in the context.
get_default_rotation(self: pydrake.multibody.tree.PlanarJoint_[float]) → float

Gets the default angle for this joint.

Returns theta:
The default angle of this joint.
get_default_translation(self: pydrake.multibody.tree.PlanarJoint_[float]) → numpy.ndarray[numpy.float64[2, 1]]

Gets the default position for this joint.

Returns p_FoMo_F:
The default position of this joint.
get_rotation(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float]) → float

Gets the angle θ of this joint from context.

Parameter context:
The context of the model this joint belongs to.
Returns theta:
The angle of this joint stored in the context. See class documentation for details.
get_translation(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[2, 1]]

Gets the position of this joint from context.

Parameter context:
The context of the model this joint belongs to.
Returns p_FoMo_F:
The position of this joint stored in the context ordered as (x, y). See class documentation for details.
get_translational_velocity(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float]) → numpy.ndarray[numpy.float64[2, 1]]

Gets the translational velocity v_FoMo_F, in meters per second, of this joint’s Mo measured and expressed in frame F from context.

Parameter context:
The context of the model this joint belongs to.
Returns v_FoMo_F:
The translational velocity of this joint as stored in the context.
set_angular_velocity(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float], theta_dot: float) → pydrake.multibody.tree.PlanarJoint_[float]

Sets the rate of change, in radians per second, of this joint’s angle θ (see class documentation) to theta_dot. The new rate of change gets stored in context.

Parameter context:
The context of the model this joint belongs to.
Parameter theta_dot:
The desired rates of change of this joint’s angle in radians per second.
Returns:a constant reference to this joint.
set_default_pose(self: pydrake.multibody.tree.PlanarJoint_[float], p_FoMo_F: numpy.ndarray[numpy.float64[2, 1]], theta: float) → None

Sets the default position and angle of this joint.

Parameter p_FoMo_F:
The desired default position of the joint
Parameter theta:
The desired default angle of the joint
set_default_rotation(self: pydrake.multibody.tree.PlanarJoint_[float], theta: float) → None

Sets the default angle of this joint.

Parameter theta:
The desired default angle of the joint
set_default_translation(self: pydrake.multibody.tree.PlanarJoint_[float], p_FoMo_F: numpy.ndarray[numpy.float64[2, 1]]) → None

Sets the default position of this joint.

Parameter p_FoMo_F:
The desired default position of the joint
set_pose(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float], p_FoMo_F: numpy.ndarray[numpy.float64[2, 1]], theta: float) → pydrake.multibody.tree.PlanarJoint_[float]

Sets the context so that the position of this joint equals p_FoMo_F and its angle equals theta.

Parameter context:
The context of the model this joint belongs to.
Parameter p_FoMo_F:
The desired position in meters to be stored in context ordered as (x, y). See class documentation for details.
Parameter theta:
The desired angle in radians to be stored in context. See class documentation for details.
Returns:a constant reference to this joint.
set_random_pose_distribution(self: pydrake.multibody.tree.PlanarJoint_[float], p_FoMo_F: numpy.ndarray[object[2, 1]], theta: pydrake.symbolic.Expression) → None

Sets the random distribution that the position and angle of this joint will be randomly sampled from. See class documentation for details on the definition of the position and angle.

set_rotation(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float], theta: float) → pydrake.multibody.tree.PlanarJoint_[float]

Sets the context so that the angle θ of this joint equals theta.

Parameter context:
The context of the model this joint belongs to.
Parameter theta:
The desired angle in radians to be stored in context. See class documentation for details.
Returns:a constant reference to this joint.
set_translation(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float], p_FoMo_F: numpy.ndarray[numpy.float64[2, 1]]) → pydrake.multibody.tree.PlanarJoint_[float]

Sets the context so that the position of this joint equals p_FoMo_F.

Parameter context:
The context of the model this joint belongs to.
Parameter p_FoMo_F:
The desired position in meters to be stored in context ordered as (x, y). See class documentation for details.
Returns:a constant reference to this joint.
set_translational_velocity(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float], v_FoMo_F: numpy.ndarray[numpy.float64[2, 1]]) → pydrake.multibody.tree.PlanarJoint_[float]

Sets the translational velocity, in meters per second, of this this joint’s Mo measured and expressed in frame F to v_FoMo_F. The new translational velocity gets stored in context.

Parameter context:
The context of the model this joint belongs to.
Parameter v_FoMo_F:
The desired translational velocity of this joint in meters per second.
Returns:a constant reference to this joint.
pydrake.multibody.tree.PrismaticJoint

alias of pydrake.multibody.tree.PrismaticJoint_[float]

template pydrake.multibody.tree.PrismaticJoint_

Instantiations: PrismaticJoint_[float], PrismaticJoint_[AutoDiffXd], PrismaticJoint_[Expression]

class PrismaticJoint_[float]

Bases: pydrake.multibody.tree.Joint_[float]

This Joint allows two bodies to translate relative to one another along a common axis. 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 frames F and M to translate with respect to each other along an axis â. The translation distance is defined positive when child body B translates along the direction of â. Axis â is constant and has the same measures in both frames F and M, that is, â_F = â_M.

__init__(self: pydrake.multibody.tree.PrismaticJoint_[float], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[float], frame_on_child: pydrake.multibody.tree.Frame_[float], axis: numpy.ndarray[numpy.float64[3, 1]], pos_lower_limit: float = -inf, pos_upper_limit: float = inf, damping: float = 0) → None

Constructor to create a prismatic joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, translate relatively to one another along a common axis. See this class’s documentation for further details on the definition of these frames and translation distance. The first three arguments to this constructor are those of the Joint class constructor. See the Joint class’s documentation for details. The additional parameter axis is:

Parameter axis:
A vector in ℝ³ specifying the translation axis for this joint. Given that frame M only translates with respect to F and there is no relative rotation, the measures of axis in either frame F or M are exactly the same, that is, axis_F = axis_M. This vector can have any length, only the direction is used.
Parameter pos_lower_limit:
Lower position limit, in meters, for the translation coordinate (see get_translation()).
Parameter pos_upper_limit:
Upper position limit, in meters, for the translation coordinate (see get_translation()).
Parameter damping:
Viscous damping coefficient, in N⋅s/m, used to model losses within the joint. The damping force (in N) is modeled as f = -damping⋅v, i.e. opposing motion, with v the translational speed for this joint (see get_translation_rate()).
Raises:
  • RuntimeError if the L2 norm of axis is less than the square
  • root of machine epsilon.
Raises:

RuntimeError if damping is negative.

Raises:

RuntimeError if pos_lower_limit > pos_upper_limit.

acceleration_lower_limit(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Returns the acceleration lower limit for this joint in meters per second squared.

acceleration_upper_limit(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Returns the acceleration upper limit for this joint in meters per second squared.

damping(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Returns this joint’s damping constant in N⋅s/m.

get_default_translation(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Gets the default translation. Wrapper for the more general Joint::default_positions().

Returns:The default translation of this stored in default_positions_.
get_translation(self: pydrake.multibody.tree.PrismaticJoint_[float], context: pydrake.systems.framework.Context_[float]) → float

Gets the translation distance of this mobilizer from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The translation coordinate of this joint read from context.
get_translation_rate(self: pydrake.multibody.tree.PrismaticJoint_[float], context: pydrake.systems.framework.Context_[float]) → float

Gets the rate of change, in meters per second, of this joint’s translation distance (see get_translation()) from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The rate of change of this joint’s translation read from context.
position_lower_limit(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Returns the position lower limit for this joint in meters.

position_upper_limit(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Returns the position upper limit for this joint in meters.

set_default_translation(self: pydrake.multibody.tree.PrismaticJoint_[float], translation: float) → None

Sets the default_positions of this joint (in this case a single translation)

Parameter translation:
The desired default translation of the joint
set_random_translation_distribution(self: pydrake.multibody.tree.PrismaticJoint_[float], translation: pydrake.symbolic.Expression) → None
set_translation(self: pydrake.multibody.tree.PrismaticJoint_[float], context: pydrake.systems.framework.Context_[float], translation: float) → pydrake.multibody.tree.PrismaticJoint_[float]

Sets context so that the generalized coordinate corresponding to the translation distance of this joint equals translation.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter translation:
The desired translation in meters to be stored in context.
Returns:a constant reference to this joint.
set_translation_rate(self: pydrake.multibody.tree.PrismaticJoint_[float], context: pydrake.systems.framework.Context_[float], translation_dot: float) → pydrake.multibody.tree.PrismaticJoint_[float]

Sets the rate of change, in meters per second, of this joint’s translation distance to translation_dot. The new rate of change translation_dot gets stored in context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter translation_dot:
The desired rate of change of this joints’s translation in meters per second.
Returns:a constant reference to this joint.
translation_axis(self: pydrake.multibody.tree.PrismaticJoint_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the axis of translation for this joint as a unit vector. Since the measures of this axis in either frame F or M are the same (see this class’s documentation for frames’s definitions) then, axis = axis_F = axis_M.

velocity_lower_limit(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Returns the velocity lower limit for this joint in meters per second.

velocity_upper_limit(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Returns the velocity upper limit for this joint in meters per second.

class pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd]

Bases: pydrake.multibody.tree.Joint_[AutoDiffXd]

This Joint allows two bodies to translate relative to one another along a common axis. 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 frames F and M to translate with respect to each other along an axis â. The translation distance is defined positive when child body B translates along the direction of â. Axis â is constant and has the same measures in both frames F and M, that is, â_F = â_M.

__init__(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[AutoDiffXd], frame_on_child: pydrake.multibody.tree.Frame_[AutoDiffXd], axis: numpy.ndarray[numpy.float64[3, 1]], pos_lower_limit: float = -inf, pos_upper_limit: float = inf, damping: float = 0) → None

Constructor to create a prismatic joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, translate relatively to one another along a common axis. See this class’s documentation for further details on the definition of these frames and translation distance. The first three arguments to this constructor are those of the Joint class constructor. See the Joint class’s documentation for details. The additional parameter axis is:

Parameter axis:
A vector in ℝ³ specifying the translation axis for this joint. Given that frame M only translates with respect to F and there is no relative rotation, the measures of axis in either frame F or M are exactly the same, that is, axis_F = axis_M. This vector can have any length, only the direction is used.
Parameter pos_lower_limit:
Lower position limit, in meters, for the translation coordinate (see get_translation()).
Parameter pos_upper_limit:
Upper position limit, in meters, for the translation coordinate (see get_translation()).
Parameter damping:
Viscous damping coefficient, in N⋅s/m, used to model losses within the joint. The damping force (in N) is modeled as f = -damping⋅v, i.e. opposing motion, with v the translational speed for this joint (see get_translation_rate()).
Raises:
  • RuntimeError if the L2 norm of axis is less than the square
  • root of machine epsilon.
Raises:

RuntimeError if damping is negative.

Raises:

RuntimeError if pos_lower_limit > pos_upper_limit.

acceleration_lower_limit(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd]) → float

Returns the acceleration lower limit for this joint in meters per second squared.

acceleration_upper_limit(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd]) → float

Returns the acceleration upper limit for this joint in meters per second squared.

damping(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd]) → float

Returns this joint’s damping constant in N⋅s/m.

get_default_translation(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd]) → float

Gets the default translation. Wrapper for the more general Joint::default_positions().

Returns:The default translation of this stored in default_positions_.
get_translation(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.autodiffutils.AutoDiffXd

Gets the translation distance of this mobilizer from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The translation coordinate of this joint read from context.
get_translation_rate(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.autodiffutils.AutoDiffXd

Gets the rate of change, in meters per second, of this joint’s translation distance (see get_translation()) from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The rate of change of this joint’s translation read from context.
position_lower_limit(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd]) → float

Returns the position lower limit for this joint in meters.

position_upper_limit(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd]) → float

Returns the position upper limit for this joint in meters.

set_default_translation(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd], translation: float) → None

Sets the default_positions of this joint (in this case a single translation)

Parameter translation:
The desired default translation of the joint
set_random_translation_distribution(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd], translation: pydrake.symbolic.Expression) → None
set_translation(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], translation: pydrake.autodiffutils.AutoDiffXd) → pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd]

Sets context so that the generalized coordinate corresponding to the translation distance of this joint equals translation.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter translation:
The desired translation in meters to be stored in context.
Returns:a constant reference to this joint.
set_translation_rate(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], translation_dot: pydrake.autodiffutils.AutoDiffXd) → pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd]

Sets the rate of change, in meters per second, of this joint’s translation distance to translation_dot. The new rate of change translation_dot gets stored in context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter translation_dot:
The desired rate of change of this joints’s translation in meters per second.
Returns:a constant reference to this joint.
translation_axis(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the axis of translation for this joint as a unit vector. Since the measures of this axis in either frame F or M are the same (see this class’s documentation for frames’s definitions) then, axis = axis_F = axis_M.

velocity_lower_limit(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd]) → float

Returns the velocity lower limit for this joint in meters per second.

velocity_upper_limit(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd]) → float

Returns the velocity upper limit for this joint in meters per second.

class pydrake.multibody.tree.PrismaticJoint_[Expression]

Bases: pydrake.multibody.tree.Joint_[Expression]

This Joint allows two bodies to translate relative to one another along a common axis. 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 frames F and M to translate with respect to each other along an axis â. The translation distance is defined positive when child body B translates along the direction of â. Axis â is constant and has the same measures in both frames F and M, that is, â_F = â_M.

__init__(self: pydrake.multibody.tree.PrismaticJoint_[Expression], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[Expression], frame_on_child: pydrake.multibody.tree.Frame_[Expression], axis: numpy.ndarray[numpy.float64[3, 1]], pos_lower_limit: float = -inf, pos_upper_limit: float = inf, damping: float = 0) → None

Constructor to create a prismatic joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, translate relatively to one another along a common axis. See this class’s documentation for further details on the definition of these frames and translation distance. The first three arguments to this constructor are those of the Joint class constructor. See the Joint class’s documentation for details. The additional parameter axis is:

Parameter axis:
A vector in ℝ³ specifying the translation axis for this joint. Given that frame M only translates with respect to F and there is no relative rotation, the measures of axis in either frame F or M are exactly the same, that is, axis_F = axis_M. This vector can have any length, only the direction is used.
Parameter pos_lower_limit:
Lower position limit, in meters, for the translation coordinate (see get_translation()).
Parameter pos_upper_limit:
Upper position limit, in meters, for the translation coordinate (see get_translation()).
Parameter damping:
Viscous damping coefficient, in N⋅s/m, used to model losses within the joint. The damping force (in N) is modeled as f = -damping⋅v, i.e. opposing motion, with v the translational speed for this joint (see get_translation_rate()).
Raises:
  • RuntimeError if the L2 norm of axis is less than the square
  • root of machine epsilon.
Raises:

RuntimeError if damping is negative.

Raises:

RuntimeError if pos_lower_limit > pos_upper_limit.

acceleration_lower_limit(self: pydrake.multibody.tree.PrismaticJoint_[Expression]) → float

Returns the acceleration lower limit for this joint in meters per second squared.

acceleration_upper_limit(self: pydrake.multibody.tree.PrismaticJoint_[Expression]) → float

Returns the acceleration upper limit for this joint in meters per second squared.

damping(self: pydrake.multibody.tree.PrismaticJoint_[Expression]) → float

Returns this joint’s damping constant in N⋅s/m.

get_default_translation(self: pydrake.multibody.tree.PrismaticJoint_[Expression]) → float

Gets the default translation. Wrapper for the more general Joint::default_positions().

Returns:The default translation of this stored in default_positions_.
get_translation(self: pydrake.multibody.tree.PrismaticJoint_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.symbolic.Expression

Gets the translation distance of this mobilizer from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The translation coordinate of this joint read from context.
get_translation_rate(self: pydrake.multibody.tree.PrismaticJoint_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.symbolic.Expression

Gets the rate of change, in meters per second, of this joint’s translation distance (see get_translation()) from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The rate of change of this joint’s translation read from context.
position_lower_limit(self: pydrake.multibody.tree.PrismaticJoint_[Expression]) → float

Returns the position lower limit for this joint in meters.

position_upper_limit(self: pydrake.multibody.tree.PrismaticJoint_[Expression]) → float

Returns the position upper limit for this joint in meters.

set_default_translation(self: pydrake.multibody.tree.PrismaticJoint_[Expression], translation: float) → None

Sets the default_positions of this joint (in this case a single translation)

Parameter translation:
The desired default translation of the joint
set_random_translation_distribution(self: pydrake.multibody.tree.PrismaticJoint_[Expression], translation: pydrake.symbolic.Expression) → None
set_translation(self: pydrake.multibody.tree.PrismaticJoint_[Expression], context: pydrake.systems.framework.Context_[Expression], translation: pydrake.symbolic.Expression) → pydrake.multibody.tree.PrismaticJoint_[Expression]

Sets context so that the generalized coordinate corresponding to the translation distance of this joint equals translation.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter translation:
The desired translation in meters to be stored in context.
Returns:a constant reference to this joint.
set_translation_rate(self: pydrake.multibody.tree.PrismaticJoint_[Expression], context: pydrake.systems.framework.Context_[Expression], translation_dot: pydrake.symbolic.Expression) → pydrake.multibody.tree.PrismaticJoint_[Expression]

Sets the rate of change, in meters per second, of this joint’s translation distance to translation_dot. The new rate of change translation_dot gets stored in context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter translation_dot:
The desired rate of change of this joints’s translation in meters per second.
Returns:a constant reference to this joint.
translation_axis(self: pydrake.multibody.tree.PrismaticJoint_[Expression]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the axis of translation for this joint as a unit vector. Since the measures of this axis in either frame F or M are the same (see this class’s documentation for frames’s definitions) then, axis = axis_F = axis_M.

velocity_lower_limit(self: pydrake.multibody.tree.PrismaticJoint_[Expression]) → float

Returns the velocity lower limit for this joint in meters per second.

velocity_upper_limit(self: pydrake.multibody.tree.PrismaticJoint_[Expression]) → float

Returns the velocity upper limit for this joint in meters per second.

class pydrake.multibody.tree.PrismaticJoint_[float]

Bases: pydrake.multibody.tree.Joint_[float]

This Joint allows two bodies to translate relative to one another along a common axis. 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 frames F and M to translate with respect to each other along an axis â. The translation distance is defined positive when child body B translates along the direction of â. Axis â is constant and has the same measures in both frames F and M, that is, â_F = â_M.

__init__(self: pydrake.multibody.tree.PrismaticJoint_[float], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[float], frame_on_child: pydrake.multibody.tree.Frame_[float], axis: numpy.ndarray[numpy.float64[3, 1]], pos_lower_limit: float = -inf, pos_upper_limit: float = inf, damping: float = 0) → None

Constructor to create a prismatic joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, translate relatively to one another along a common axis. See this class’s documentation for further details on the definition of these frames and translation distance. The first three arguments to this constructor are those of the Joint class constructor. See the Joint class’s documentation for details. The additional parameter axis is:

Parameter axis:
A vector in ℝ³ specifying the translation axis for this joint. Given that frame M only translates with respect to F and there is no relative rotation, the measures of axis in either frame F or M are exactly the same, that is, axis_F = axis_M. This vector can have any length, only the direction is used.
Parameter pos_lower_limit:
Lower position limit, in meters, for the translation coordinate (see get_translation()).
Parameter pos_upper_limit:
Upper position limit, in meters, for the translation coordinate (see get_translation()).
Parameter damping:
Viscous damping coefficient, in N⋅s/m, used to model losses within the joint. The damping force (in N) is modeled as f = -damping⋅v, i.e. opposing motion, with v the translational speed for this joint (see get_translation_rate()).
Raises:
  • RuntimeError if the L2 norm of axis is less than the square
  • root of machine epsilon.
Raises:

RuntimeError if damping is negative.

Raises:

RuntimeError if pos_lower_limit > pos_upper_limit.

acceleration_lower_limit(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Returns the acceleration lower limit for this joint in meters per second squared.

acceleration_upper_limit(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Returns the acceleration upper limit for this joint in meters per second squared.

damping(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Returns this joint’s damping constant in N⋅s/m.

get_default_translation(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Gets the default translation. Wrapper for the more general Joint::default_positions().

Returns:The default translation of this stored in default_positions_.
get_translation(self: pydrake.multibody.tree.PrismaticJoint_[float], context: pydrake.systems.framework.Context_[float]) → float

Gets the translation distance of this mobilizer from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The translation coordinate of this joint read from context.
get_translation_rate(self: pydrake.multibody.tree.PrismaticJoint_[float], context: pydrake.systems.framework.Context_[float]) → float

Gets the rate of change, in meters per second, of this joint’s translation distance (see get_translation()) from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The rate of change of this joint’s translation read from context.
position_lower_limit(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Returns the position lower limit for this joint in meters.

position_upper_limit(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Returns the position upper limit for this joint in meters.

set_default_translation(self: pydrake.multibody.tree.PrismaticJoint_[float], translation: float) → None

Sets the default_positions of this joint (in this case a single translation)

Parameter translation:
The desired default translation of the joint
set_random_translation_distribution(self: pydrake.multibody.tree.PrismaticJoint_[float], translation: pydrake.symbolic.Expression) → None
set_translation(self: pydrake.multibody.tree.PrismaticJoint_[float], context: pydrake.systems.framework.Context_[float], translation: float) → pydrake.multibody.tree.PrismaticJoint_[float]

Sets context so that the generalized coordinate corresponding to the translation distance of this joint equals translation.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter translation:
The desired translation in meters to be stored in context.
Returns:a constant reference to this joint.
set_translation_rate(self: pydrake.multibody.tree.PrismaticJoint_[float], context: pydrake.systems.framework.Context_[float], translation_dot: float) → pydrake.multibody.tree.PrismaticJoint_[float]

Sets the rate of change, in meters per second, of this joint’s translation distance to translation_dot. The new rate of change translation_dot gets stored in context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter translation_dot:
The desired rate of change of this joints’s translation in meters per second.
Returns:a constant reference to this joint.
translation_axis(self: pydrake.multibody.tree.PrismaticJoint_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the axis of translation for this joint as a unit vector. Since the measures of this axis in either frame F or M are the same (see this class’s documentation for frames’s definitions) then, axis = axis_F = axis_M.

velocity_lower_limit(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Returns the velocity lower limit for this joint in meters per second.

velocity_upper_limit(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float

Returns the velocity upper limit for this joint in meters per second.

pydrake.multibody.tree.RevoluteJoint

alias of pydrake.multibody.tree.RevoluteJoint_[float]

template pydrake.multibody.tree.RevoluteJoint_

Instantiations: RevoluteJoint_[float], RevoluteJoint_[AutoDiffXd], RevoluteJoint_[Expression]

class RevoluteJoint_[float]

Bases: pydrake.multibody.tree.Joint_[float]

This Joint allows two bodies to rotate relatively to one another around a common axis. 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 frames F and M to rotate with respect to each other about an axis â. The rotation angle’s sign is defined such that child body B rotates about axis â according to the right hand rule, with thumb aligned in the axis direction. Axis â is constant and has the same measures in both frames F and M, that is, â_F = â_M.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.multibody.tree.RevoluteJoint_[float], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[float], frame_on_child: pydrake.multibody.tree.Frame_[float], axis: numpy.ndarray[numpy.float64[3, 1]], damping: float = 0) -> None

Constructor to create a revolute joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, rotate relatively to one another about a common axis. See this class’s documentation for further details on the definition of these frames and rotation angle. This constructor signature creates a joint with no joint limits, i.e. the joint position, velocity and acceleration limits are the pair (-∞, ∞). 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 axis:
A vector in ℝ³ specifying the axis of revolution for this joint. Given that frame M only rotates with respect to F and their origins are coincident at all times, the measures of axis in either frame F or M are exactly the same, that is, axis_F = axis_M. In other words, axis_F (or axis_M) is the eigenvector of R_FM with eigenvalue equal to one. This vector can have any length, only the direction is used. This method aborts if axis is the zero vector.
Parameter damping:
Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e. opposing motion, with ω the angular rate for this joint (see get_angular_rate()).
Raises:RuntimeError if damping is negative.
  1. __init__(self: pydrake.multibody.tree.RevoluteJoint_[float], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[float], frame_on_child: pydrake.multibody.tree.Frame_[float], axis: numpy.ndarray[numpy.float64[3, 1]], pos_lower_limit: float, pos_upper_limit: float, damping: float = 0.0) -> None

Constructor to create a revolute joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, rotate relatively to one another about a common axis. See this class’s documentation for further details on the definition of these frames and rotation angle. 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 axis:
A vector in ℝ³ specifying the axis of revolution for this joint. Given that frame M only rotates with respect to F and their origins are coincident at all times, the measures of axis in either frame F or M are exactly the same, that is, axis_F = axis_M. In other words, axis_F (or axis_M) is the eigenvector of R_FM with eigenvalue equal to one. This vector can have any length, only the direction is used. This method aborts if axis is the zero vector.
Parameter pos_lower_limit:
Lower position limit, in radians, for the rotation coordinate (see get_angle()).
Parameter pos_upper_limit:
Upper position limit, in radians, for the rotation coordinate (see get_angle()).
Parameter damping:
Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e. opposing motion, with ω the angular rate for this joint (see get_angular_rate()).
Raises:RuntimeError if damping is negative.
Raises:RuntimeError if pos_lower_limit > pos_upper_limit.
acceleration_lower_limit(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Returns the acceleration lower limit for this joint in radians / s².

acceleration_upper_limit(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Returns the acceleration upper limit for this joint in radians / s².

damping(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Returns this joint’s damping constant in N⋅m⋅s.

get_angle(self: pydrake.multibody.tree.RevoluteJoint_[float], context: pydrake.systems.framework.Context_[float]) → float

Gets the rotation angle of this mobilizer from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The angle coordinate of this joint stored in the context.
get_angular_rate(self: pydrake.multibody.tree.RevoluteJoint_[float], context: pydrake.systems.framework.Context_[float]) → float

Gets the rate of change, in radians per second, of this joint’s angle (see get_angle()) from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The rate of change of this joint’s angle as stored in the context.
get_default_angle(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Gets the default rotation angle. Wrapper for the more general Joint::default_positions().

Returns:The default angle of this stored in default_positions_
position_lower_limit(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Returns the position lower limit for this joint in radians.

position_upper_limit(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Returns the position upper limit for this joint in radians.

revolute_axis(self: pydrake.multibody.tree.RevoluteJoint_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the axis of revolution of this joint as a unit vector. Since the measures of this axis in either frame F or M are the same (see this class’s documentation for frames’s definitions) then, axis = axis_F = axis_M.

set_angle(self: pydrake.multibody.tree.RevoluteJoint_[float], context: pydrake.systems.framework.Context_[float], angle: float) → pydrake.multibody.tree.RevoluteJoint_[float]

Sets the context so that the generalized coordinate corresponding to the rotation angle of this joint equals angle.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter angle:
The desired angle in radians to be stored in context.
Returns:a constant reference to this joint.
set_angular_rate(self: pydrake.multibody.tree.RevoluteJoint_[float], context: pydrake.systems.framework.Context_[float], angle: float) → pydrake.multibody.tree.RevoluteJoint_[float]

Sets the rate of change, in radians per second, of this this joint’s angle to theta_dot. The new rate of change theta_dot gets stored in context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter theta_dot:
The desired rate of change of this joints’s angle in radians per second.
Returns:a constant reference to this joint.
set_default_angle(self: pydrake.multibody.tree.RevoluteJoint_[float], angle: float) → None

Sets the default_positions of this joint (in this case a single angle).

Parameter angle:
The desired default angle of the joint
set_random_angle_distribution(self: pydrake.multibody.tree.RevoluteJoint_[float], angle: pydrake.symbolic.Expression) → None
velocity_lower_limit(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Returns the velocity lower limit for this joint in radians / s.

velocity_upper_limit(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Returns the velocity upper limit for this joint in radians / s.

class pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd]

Bases: pydrake.multibody.tree.Joint_[AutoDiffXd]

This Joint allows two bodies to rotate relatively to one another around a common axis. 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 frames F and M to rotate with respect to each other about an axis â. The rotation angle’s sign is defined such that child body B rotates about axis â according to the right hand rule, with thumb aligned in the axis direction. Axis â is constant and has the same measures in both frames F and M, that is, â_F = â_M.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[AutoDiffXd], frame_on_child: pydrake.multibody.tree.Frame_[AutoDiffXd], axis: numpy.ndarray[numpy.float64[3, 1]], damping: float = 0) -> None

Constructor to create a revolute joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, rotate relatively to one another about a common axis. See this class’s documentation for further details on the definition of these frames and rotation angle. This constructor signature creates a joint with no joint limits, i.e. the joint position, velocity and acceleration limits are the pair (-∞, ∞). 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 axis:
A vector in ℝ³ specifying the axis of revolution for this joint. Given that frame M only rotates with respect to F and their origins are coincident at all times, the measures of axis in either frame F or M are exactly the same, that is, axis_F = axis_M. In other words, axis_F (or axis_M) is the eigenvector of R_FM with eigenvalue equal to one. This vector can have any length, only the direction is used. This method aborts if axis is the zero vector.
Parameter damping:
Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e. opposing motion, with ω the angular rate for this joint (see get_angular_rate()).
Raises:RuntimeError if damping is negative.
  1. __init__(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[AutoDiffXd], frame_on_child: pydrake.multibody.tree.Frame_[AutoDiffXd], axis: numpy.ndarray[numpy.float64[3, 1]], pos_lower_limit: float, pos_upper_limit: float, damping: float = 0.0) -> None

Constructor to create a revolute joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, rotate relatively to one another about a common axis. See this class’s documentation for further details on the definition of these frames and rotation angle. 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 axis:
A vector in ℝ³ specifying the axis of revolution for this joint. Given that frame M only rotates with respect to F and their origins are coincident at all times, the measures of axis in either frame F or M are exactly the same, that is, axis_F = axis_M. In other words, axis_F (or axis_M) is the eigenvector of R_FM with eigenvalue equal to one. This vector can have any length, only the direction is used. This method aborts if axis is the zero vector.
Parameter pos_lower_limit:
Lower position limit, in radians, for the rotation coordinate (see get_angle()).
Parameter pos_upper_limit:
Upper position limit, in radians, for the rotation coordinate (see get_angle()).
Parameter damping:
Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e. opposing motion, with ω the angular rate for this joint (see get_angular_rate()).
Raises:RuntimeError if damping is negative.
Raises:RuntimeError if pos_lower_limit > pos_upper_limit.
acceleration_lower_limit(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd]) → float

Returns the acceleration lower limit for this joint in radians / s².

acceleration_upper_limit(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd]) → float

Returns the acceleration upper limit for this joint in radians / s².

damping(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd]) → float

Returns this joint’s damping constant in N⋅m⋅s.

get_angle(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.autodiffutils.AutoDiffXd

Gets the rotation angle of this mobilizer from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The angle coordinate of this joint stored in the context.
get_angular_rate(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.autodiffutils.AutoDiffXd

Gets the rate of change, in radians per second, of this joint’s angle (see get_angle()) from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The rate of change of this joint’s angle as stored in the context.
get_default_angle(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd]) → float

Gets the default rotation angle. Wrapper for the more general Joint::default_positions().

Returns:The default angle of this stored in default_positions_
position_lower_limit(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd]) → float

Returns the position lower limit for this joint in radians.

position_upper_limit(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd]) → float

Returns the position upper limit for this joint in radians.

revolute_axis(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the axis of revolution of this joint as a unit vector. Since the measures of this axis in either frame F or M are the same (see this class’s documentation for frames’s definitions) then, axis = axis_F = axis_M.

set_angle(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], angle: pydrake.autodiffutils.AutoDiffXd) → pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd]

Sets the context so that the generalized coordinate corresponding to the rotation angle of this joint equals angle.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter angle:
The desired angle in radians to be stored in context.
Returns:a constant reference to this joint.
set_angular_rate(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], angle: pydrake.autodiffutils.AutoDiffXd) → pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd]

Sets the rate of change, in radians per second, of this this joint’s angle to theta_dot. The new rate of change theta_dot gets stored in context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter theta_dot:
The desired rate of change of this joints’s angle in radians per second.
Returns:a constant reference to this joint.
set_default_angle(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd], angle: float) → None

Sets the default_positions of this joint (in this case a single angle).

Parameter angle:
The desired default angle of the joint
set_random_angle_distribution(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd], angle: pydrake.symbolic.Expression) → None
velocity_lower_limit(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd]) → float

Returns the velocity lower limit for this joint in radians / s.

velocity_upper_limit(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd]) → float

Returns the velocity upper limit for this joint in radians / s.

class pydrake.multibody.tree.RevoluteJoint_[Expression]

Bases: pydrake.multibody.tree.Joint_[Expression]

This Joint allows two bodies to rotate relatively to one another around a common axis. 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 frames F and M to rotate with respect to each other about an axis â. The rotation angle’s sign is defined such that child body B rotates about axis â according to the right hand rule, with thumb aligned in the axis direction. Axis â is constant and has the same measures in both frames F and M, that is, â_F = â_M.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.multibody.tree.RevoluteJoint_[Expression], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[Expression], frame_on_child: pydrake.multibody.tree.Frame_[Expression], axis: numpy.ndarray[numpy.float64[3, 1]], damping: float = 0) -> None

Constructor to create a revolute joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, rotate relatively to one another about a common axis. See this class’s documentation for further details on the definition of these frames and rotation angle. This constructor signature creates a joint with no joint limits, i.e. the joint position, velocity and acceleration limits are the pair (-∞, ∞). 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 axis:
A vector in ℝ³ specifying the axis of revolution for this joint. Given that frame M only rotates with respect to F and their origins are coincident at all times, the measures of axis in either frame F or M are exactly the same, that is, axis_F = axis_M. In other words, axis_F (or axis_M) is the eigenvector of R_FM with eigenvalue equal to one. This vector can have any length, only the direction is used. This method aborts if axis is the zero vector.
Parameter damping:
Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e. opposing motion, with ω the angular rate for this joint (see get_angular_rate()).
Raises:RuntimeError if damping is negative.
  1. __init__(self: pydrake.multibody.tree.RevoluteJoint_[Expression], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[Expression], frame_on_child: pydrake.multibody.tree.Frame_[Expression], axis: numpy.ndarray[numpy.float64[3, 1]], pos_lower_limit: float, pos_upper_limit: float, damping: float = 0.0) -> None

Constructor to create a revolute joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, rotate relatively to one another about a common axis. See this class’s documentation for further details on the definition of these frames and rotation angle. 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 axis:
A vector in ℝ³ specifying the axis of revolution for this joint. Given that frame M only rotates with respect to F and their origins are coincident at all times, the measures of axis in either frame F or M are exactly the same, that is, axis_F = axis_M. In other words, axis_F (or axis_M) is the eigenvector of R_FM with eigenvalue equal to one. This vector can have any length, only the direction is used. This method aborts if axis is the zero vector.
Parameter pos_lower_limit:
Lower position limit, in radians, for the rotation coordinate (see get_angle()).
Parameter pos_upper_limit:
Upper position limit, in radians, for the rotation coordinate (see get_angle()).
Parameter damping:
Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e. opposing motion, with ω the angular rate for this joint (see get_angular_rate()).
Raises:RuntimeError if damping is negative.
Raises:RuntimeError if pos_lower_limit > pos_upper_limit.
acceleration_lower_limit(self: pydrake.multibody.tree.RevoluteJoint_[Expression]) → float

Returns the acceleration lower limit for this joint in radians / s².

acceleration_upper_limit(self: pydrake.multibody.tree.RevoluteJoint_[Expression]) → float

Returns the acceleration upper limit for this joint in radians / s².

damping(self: pydrake.multibody.tree.RevoluteJoint_[Expression]) → float

Returns this joint’s damping constant in N⋅m⋅s.

get_angle(self: pydrake.multibody.tree.RevoluteJoint_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.symbolic.Expression

Gets the rotation angle of this mobilizer from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The angle coordinate of this joint stored in the context.
get_angular_rate(self: pydrake.multibody.tree.RevoluteJoint_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.symbolic.Expression

Gets the rate of change, in radians per second, of this joint’s angle (see get_angle()) from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The rate of change of this joint’s angle as stored in the context.
get_default_angle(self: pydrake.multibody.tree.RevoluteJoint_[Expression]) → float

Gets the default rotation angle. Wrapper for the more general Joint::default_positions().

Returns:The default angle of this stored in default_positions_
position_lower_limit(self: pydrake.multibody.tree.RevoluteJoint_[Expression]) → float

Returns the position lower limit for this joint in radians.

position_upper_limit(self: pydrake.multibody.tree.RevoluteJoint_[Expression]) → float

Returns the position upper limit for this joint in radians.

revolute_axis(self: pydrake.multibody.tree.RevoluteJoint_[Expression]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the axis of revolution of this joint as a unit vector. Since the measures of this axis in either frame F or M are the same (see this class’s documentation for frames’s definitions) then, axis = axis_F = axis_M.

set_angle(self: pydrake.multibody.tree.RevoluteJoint_[Expression], context: pydrake.systems.framework.Context_[Expression], angle: pydrake.symbolic.Expression) → pydrake.multibody.tree.RevoluteJoint_[Expression]

Sets the context so that the generalized coordinate corresponding to the rotation angle of this joint equals angle.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter angle:
The desired angle in radians to be stored in context.
Returns:a constant reference to this joint.
set_angular_rate(self: pydrake.multibody.tree.RevoluteJoint_[Expression], context: pydrake.systems.framework.Context_[Expression], angle: pydrake.symbolic.Expression) → pydrake.multibody.tree.RevoluteJoint_[Expression]

Sets the rate of change, in radians per second, of this this joint’s angle to theta_dot. The new rate of change theta_dot gets stored in context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter theta_dot:
The desired rate of change of this joints’s angle in radians per second.
Returns:a constant reference to this joint.
set_default_angle(self: pydrake.multibody.tree.RevoluteJoint_[Expression], angle: float) → None

Sets the default_positions of this joint (in this case a single angle).

Parameter angle:
The desired default angle of the joint
set_random_angle_distribution(self: pydrake.multibody.tree.RevoluteJoint_[Expression], angle: pydrake.symbolic.Expression) → None
velocity_lower_limit(self: pydrake.multibody.tree.RevoluteJoint_[Expression]) → float

Returns the velocity lower limit for this joint in radians / s.

velocity_upper_limit(self: pydrake.multibody.tree.RevoluteJoint_[Expression]) → float

Returns the velocity upper limit for this joint in radians / s.

class pydrake.multibody.tree.RevoluteJoint_[float]

Bases: pydrake.multibody.tree.Joint_[float]

This Joint allows two bodies to rotate relatively to one another around a common axis. 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 frames F and M to rotate with respect to each other about an axis â. The rotation angle’s sign is defined such that child body B rotates about axis â according to the right hand rule, with thumb aligned in the axis direction. Axis â is constant and has the same measures in both frames F and M, that is, â_F = â_M.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.multibody.tree.RevoluteJoint_[float], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[float], frame_on_child: pydrake.multibody.tree.Frame_[float], axis: numpy.ndarray[numpy.float64[3, 1]], damping: float = 0) -> None

Constructor to create a revolute joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, rotate relatively to one another about a common axis. See this class’s documentation for further details on the definition of these frames and rotation angle. This constructor signature creates a joint with no joint limits, i.e. the joint position, velocity and acceleration limits are the pair (-∞, ∞). 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 axis:
A vector in ℝ³ specifying the axis of revolution for this joint. Given that frame M only rotates with respect to F and their origins are coincident at all times, the measures of axis in either frame F or M are exactly the same, that is, axis_F = axis_M. In other words, axis_F (or axis_M) is the eigenvector of R_FM with eigenvalue equal to one. This vector can have any length, only the direction is used. This method aborts if axis is the zero vector.
Parameter damping:
Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e. opposing motion, with ω the angular rate for this joint (see get_angular_rate()).
Raises:RuntimeError if damping is negative.
  1. __init__(self: pydrake.multibody.tree.RevoluteJoint_[float], name: str, frame_on_parent: pydrake.multibody.tree.Frame_[float], frame_on_child: pydrake.multibody.tree.Frame_[float], axis: numpy.ndarray[numpy.float64[3, 1]], pos_lower_limit: float, pos_upper_limit: float, damping: float = 0.0) -> None

Constructor to create a revolute joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, rotate relatively to one another about a common axis. See this class’s documentation for further details on the definition of these frames and rotation angle. 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 axis:
A vector in ℝ³ specifying the axis of revolution for this joint. Given that frame M only rotates with respect to F and their origins are coincident at all times, the measures of axis in either frame F or M are exactly the same, that is, axis_F = axis_M. In other words, axis_F (or axis_M) is the eigenvector of R_FM with eigenvalue equal to one. This vector can have any length, only the direction is used. This method aborts if axis is the zero vector.
Parameter pos_lower_limit:
Lower position limit, in radians, for the rotation coordinate (see get_angle()).
Parameter pos_upper_limit:
Upper position limit, in radians, for the rotation coordinate (see get_angle()).
Parameter damping:
Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e. opposing motion, with ω the angular rate for this joint (see get_angular_rate()).
Raises:RuntimeError if damping is negative.
Raises:RuntimeError if pos_lower_limit > pos_upper_limit.
acceleration_lower_limit(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Returns the acceleration lower limit for this joint in radians / s².

acceleration_upper_limit(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Returns the acceleration upper limit for this joint in radians / s².

damping(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Returns this joint’s damping constant in N⋅m⋅s.

get_angle(self: pydrake.multibody.tree.RevoluteJoint_[float], context: pydrake.systems.framework.Context_[float]) → float

Gets the rotation angle of this mobilizer from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The angle coordinate of this joint stored in the context.
get_angular_rate(self: pydrake.multibody.tree.RevoluteJoint_[float], context: pydrake.systems.framework.Context_[float]) → float

Gets the rate of change, in radians per second, of this joint’s angle (see get_angle()) from context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Returns:The rate of change of this joint’s angle as stored in the context.
get_default_angle(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Gets the default rotation angle. Wrapper for the more general Joint::default_positions().

Returns:The default angle of this stored in default_positions_
position_lower_limit(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Returns the position lower limit for this joint in radians.

position_upper_limit(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Returns the position upper limit for this joint in radians.

revolute_axis(self: pydrake.multibody.tree.RevoluteJoint_[float]) → numpy.ndarray[numpy.float64[3, 1]]

Returns the axis of revolution of this joint as a unit vector. Since the measures of this axis in either frame F or M are the same (see this class’s documentation for frames’s definitions) then, axis = axis_F = axis_M.

set_angle(self: pydrake.multibody.tree.RevoluteJoint_[float], context: pydrake.systems.framework.Context_[float], angle: float) → pydrake.multibody.tree.RevoluteJoint_[float]

Sets the context so that the generalized coordinate corresponding to the rotation angle of this joint equals angle.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter angle:
The desired angle in radians to be stored in context.
Returns:a constant reference to this joint.
set_angular_rate(self: pydrake.multibody.tree.RevoluteJoint_[float], context: pydrake.systems.framework.Context_[float], angle: float) → pydrake.multibody.tree.RevoluteJoint_[float]

Sets the rate of change, in radians per second, of this this joint’s angle to theta_dot. The new rate of change theta_dot gets stored in context.

Parameter context:
The context of the MultibodyTree this joint belongs to.
Parameter theta_dot:
The desired rate of change of this joints’s angle in radians per second.
Returns:a constant reference to this joint.
set_default_angle(self: pydrake.multibody.tree.RevoluteJoint_[float], angle: float) → None

Sets the default_positions of this joint (in this case a single angle).

Parameter angle:
The desired default angle of the joint
set_random_angle_distribution(self: pydrake.multibody.tree.RevoluteJoint_[float], angle: pydrake.symbolic.Expression) → None
velocity_lower_limit(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Returns the velocity lower limit for this joint in radians / s.

velocity_upper_limit(self: pydrake.multibody.tree.RevoluteJoint_[float]) → float

Returns the velocity upper limit for this joint in radians / s.

pydrake.multibody.tree.RevoluteSpring

alias of pydrake.multibody.tree.RevoluteSpring_[float]

template pydrake.multibody.tree.RevoluteSpring_

Instantiations: RevoluteSpring_[float], RevoluteSpring_[AutoDiffXd], RevoluteSpring_[Expression]

class RevoluteSpring_[float]

Bases: pydrake.multibody.tree.ForceElement_[float]

This ForceElement models a torsional spring attached to a RevoluteJoint and applies a torque to that joint

τ = -k⋅(θ - θ₀)

where θ₀ is the nominal joint position. Note that joint damping exists within the RevoluteJoint itself, and so is not included here.

__init__(self: pydrake.multibody.tree.RevoluteSpring_[float], joint: pydrake.multibody.tree.RevoluteJoint_[float], nominal_angle: float, stiffness: float) → None

Constructor for a spring attached to the given joint

Parameter nominal_angle:
The nominal angle of the spring θ₀, in radians, at which the spring applies no moment.
Parameter stiffness:
The stiffness k of the spring in N⋅m/rad.
Raises:RuntimeError if stiffness is negative.
joint(self: pydrake.multibody.tree.RevoluteSpring_[float]) → pydrake.multibody.tree.RevoluteJoint_[float]
nominal_angle(self: pydrake.multibody.tree.RevoluteSpring_[float])<