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 onbodyB
. Point P is defined by its positionp_AP
as measured and expressed in the body frame A and similarly, point Q is defined by its position p_BQ as measured and expressed in body frame B. The remaining parameters define:- Parameter
free_length
: - The free length of the spring ℓ₀, in meters, at which the spring applies no forces. Since this force element is meant to model finite length springs, ℓ₀ must be strictly positive.
- Parameter
stiffness
: - The stiffness k of the spring in N/m. It must be non-negative.
- Parameter
damping
: - The damping c of the damper in N⋅s/m. It must be non-negative. Refer to this class’s documentation for further details.
Raises: RuntimeError if free_length
is negative or zero.Raises: RuntimeError if stiffness
is negative.Raises: RuntimeError if damping
is negative.- Parameter
-
bodyA
(self: pydrake.multibody.tree.LinearSpringDamper_[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,r̂ = (p_WQ - p_WP) / ℓ
is the normalized vector from P to Q, ℓ₀ is the free length of the spring and k and c are the stiffness and damping of the spring-damper, respectively. This ForceElement is meant to model finite free length springs attached between two points. In this typical arrangement springs are usually pre-loaded, meaning they apply a non-zero spring force in the static configuration of the system. Thus, neither the free length ℓ₀ nor the current length ℓ of the spring can ever be zero. The length of the spring approaching zero would incur in a non-physical configuration and therefore this element throws a RuntimeError exception in that case. Note that:- The applied force is always along the line connecting points P and
Q. - Damping always dissipates energy. - Forces on bodies A and B are equal and opposite according to Newton’s third law.
-
__init__
(self: pydrake.multibody.tree.LinearSpringDamper_[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 onbodyB
. Point P is defined by its positionp_AP
as measured and expressed in the body frame A and similarly, point Q is defined by its position p_BQ as measured and expressed in body frame B. The remaining parameters define:- Parameter
free_length
: - The free length of the spring ℓ₀, in meters, at which the spring applies no forces. Since this force element is meant to model finite length springs, ℓ₀ must be strictly positive.
- Parameter
stiffness
: - The stiffness k of the spring in N/m. It must be non-negative.
- Parameter
damping
: - The damping c of the damper in N⋅s/m. It must be non-negative. Refer to this class’s documentation for further details.
Raises: RuntimeError if free_length
is negative or zero.Raises: RuntimeError if stiffness
is negative.Raises: RuntimeError if damping
is negative.- Parameter
-
bodyA
(self: pydrake.multibody.tree.LinearSpringDamper_[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,r̂ = (p_WQ - p_WP) / ℓ
is the normalized vector from P to Q, ℓ₀ is the free length of the spring and k and c are the stiffness and damping of the spring-damper, respectively. This ForceElement is meant to model finite free length springs attached between two points. In this typical arrangement springs are usually pre-loaded, meaning they apply a non-zero spring force in the static configuration of the system. Thus, neither the free length ℓ₀ nor the current length ℓ of the spring can ever be zero. The length of the spring approaching zero would incur in a non-physical configuration and therefore this element throws a RuntimeError exception in that case. Note that:- The applied force is always along the line connecting points P and
Q. - Damping always dissipates energy. - Forces on bodies A and B are equal and opposite according to Newton’s third law.
-
__init__
(self: pydrake.multibody.tree.LinearSpringDamper_[float], bodyA: pydrake.multibody.tree.Body_[float], p_AP: numpy.ndarray[numpy.float64[3, 1]], bodyB: pydrake.multibody.tree.Body_[float], p_BQ: numpy.ndarray[numpy.float64[3, 1]], free_length: float, stiffness: float, damping: float) → None¶ Constructor for a spring-damper between a point P on
bodyA
and a point Q onbodyB
. Point P is defined by its positionp_AP
as measured and expressed in the body frame A and similarly, point Q is defined by its position p_BQ as measured and expressed in body frame B. The remaining parameters define:- Parameter
free_length
: - The free length of the spring ℓ₀, in meters, at which the spring applies no forces. Since this force element is meant to model finite length springs, ℓ₀ must be strictly positive.
- Parameter
stiffness
: - The stiffness k of the spring in N/m. It must be non-negative.
- Parameter
damping
: - The damping c of the damper in N⋅s/m. It must be non-negative. Refer to this class’s documentation for further details.
Raises: RuntimeError if free_length
is negative or zero.Raises: RuntimeError if stiffness
is negative.Raises: RuntimeError if damping
is negative.- Parameter
-
bodyA
(self: pydrake.multibody.tree.LinearSpringDamper_[float]) → pydrake.multibody.tree.Body_[float]¶
-
bodyB
(self: pydrake.multibody.tree.LinearSpringDamper_[float]) → pydrake.multibody.tree.Body_[float]¶
-
damping
(self: pydrake.multibody.tree.LinearSpringDamper_[float]) → float¶
-
free_length
(self: pydrake.multibody.tree.LinearSpringDamper_[float]) → float¶
-
p_AP
(self: pydrake.multibody.tree.LinearSpringDamper_[float]) → numpy.ndarray[numpy.float64[3, 1]]¶ The position p_AP of point P on body A as measured and expressed in body frame A.
-
p_BQ
(self: pydrake.multibody.tree.LinearSpringDamper_[float]) → numpy.ndarray[numpy.float64[3, 1]]¶ The position p_BQ of point Q on body B as measured and expressed in body frame B.
-
stiffness
(self: pydrake.multibody.tree.LinearSpringDamper_[float]) → float¶
-
class
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
¶
-
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__
(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.
-
AddInForces
(self: pydrake.multibody.tree.MultibodyForces_[float], addend: pydrake.multibody.tree.MultibodyForces_[float]) → None¶ Adds into
this
the force contribution stored inaddend
.
-
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().
-
SetZero
(self: pydrake.multibody.tree.MultibodyForces_[float]) → pydrake.multibody.tree.MultibodyForces_[float]¶ Sets
this
to store zero forces (no applied forces).
-
-
class
-
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__
(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.
-
AddInForces
(self: pydrake.multibody.tree.MultibodyForces_[AutoDiffXd], addend: pydrake.multibody.tree.MultibodyForces_[AutoDiffXd]) → None¶ Adds into
this
the force contribution stored inaddend
.
-
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().
-
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__
(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.
-
AddInForces
(self: pydrake.multibody.tree.MultibodyForces_[Expression], addend: pydrake.multibody.tree.MultibodyForces_[Expression]) → None¶ Adds into
this
the force contribution stored inaddend
.
-
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().
-
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__
(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.
-
AddInForces
(self: pydrake.multibody.tree.MultibodyForces_[float], addend: pydrake.multibody.tree.MultibodyForces_[float]) → None¶ Adds into
this
the force contribution stored inaddend
.
-
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().
-
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
¶
-
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. - Parameter
-
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 asfᵢ = -dampingᵢ⋅vᵢ, i = 1, 2
i.e. opposing motion, with vᵢ the translation rates along the i-th axis forthis
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 forthis
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 θ fromcontext
. 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 thecontext
.
- Parameter
-
get_rotation
(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float]) → float¶ Gets the angle θ of
this
joint fromcontext
.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
theta
: - The angle of
this
joint stored in thecontext
. See class documentation for details.
- Parameter
-
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 fromcontext
.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
p_FoMo_F
: - The position of
this
joint stored in thecontext
ordered as (x, y). See class documentation for details.
- Parameter
-
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 fromcontext
.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
v_FoMo_F
: - The translational velocity of
this
joint as stored in thecontext
.
- Parameter
-
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) totheta_dot
. The new rate of change gets stored incontext
.- 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.- Parameter
-
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 ofthis
joint equalsp_FoMo_F
and its angle equalstheta
.- 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.- Parameter
-
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 θ ofthis
joint equalstheta
.- 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.- Parameter
-
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 ofthis
joint equalsp_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.- Parameter
-
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 tov_FoMo_F
. The new translational velocity gets stored incontext
.- 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.- Parameter
-
-
class
-
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. - Parameter
-
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 asfᵢ = -dampingᵢ⋅vᵢ, i = 1, 2
i.e. opposing motion, with vᵢ the translation rates along the i-th axis forthis
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 forthis
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 θ fromcontext
. 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 thecontext
.
- Parameter
-
get_rotation
(self: pydrake.multibody.tree.PlanarJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.autodiffutils.AutoDiffXd¶ Gets the angle θ of
this
joint fromcontext
.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
theta
: - The angle of
this
joint stored in thecontext
. See class documentation for details.
- Parameter
-
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 fromcontext
.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
p_FoMo_F
: - The position of
this
joint stored in thecontext
ordered as (x, y). See class documentation for details.
- Parameter
-
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 fromcontext
.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
v_FoMo_F
: - The translational velocity of
this
joint as stored in thecontext
.
- Parameter
-
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) totheta_dot
. The new rate of change gets stored incontext
.- 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.- Parameter
-
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 ofthis
joint equalsp_FoMo_F
and its angle equalstheta
.- 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.- Parameter
-
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 θ ofthis
joint equalstheta
.- 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.- Parameter
-
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 ofthis
joint equalsp_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.- Parameter
-
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 tov_FoMo_F
. The new translational velocity gets stored incontext
.- 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.- Parameter
-
-
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. - Parameter
-
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 asfᵢ = -dampingᵢ⋅vᵢ, i = 1, 2
i.e. opposing motion, with vᵢ the translation rates along the i-th axis forthis
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 forthis
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 θ fromcontext
. 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 thecontext
.
- Parameter
-
get_rotation
(self: pydrake.multibody.tree.PlanarJoint_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.symbolic.Expression¶ Gets the angle θ of
this
joint fromcontext
.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
theta
: - The angle of
this
joint stored in thecontext
. See class documentation for details.
- Parameter
-
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 fromcontext
.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
p_FoMo_F
: - The position of
this
joint stored in thecontext
ordered as (x, y). See class documentation for details.
- Parameter
-
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 fromcontext
.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
v_FoMo_F
: - The translational velocity of
this
joint as stored in thecontext
.
- Parameter
-
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) totheta_dot
. The new rate of change gets stored incontext
.- 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.- Parameter
-
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 ofthis
joint equalsp_FoMo_F
and its angle equalstheta
.- 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.- Parameter
-
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 θ ofthis
joint equalstheta
.- 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.- Parameter
-
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 ofthis
joint equalsp_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.- Parameter
-
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 tov_FoMo_F
. The new translational velocity gets stored incontext
.- 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.- Parameter
-
-
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. - Parameter
-
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 asfᵢ = -dampingᵢ⋅vᵢ, i = 1, 2
i.e. opposing motion, with vᵢ the translation rates along the i-th axis forthis
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 forthis
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 θ fromcontext
. 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 thecontext
.
- Parameter
-
get_rotation
(self: pydrake.multibody.tree.PlanarJoint_[float], context: pydrake.systems.framework.Context_[float]) → float¶ Gets the angle θ of
this
joint fromcontext
.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
theta
: - The angle of
this
joint stored in thecontext
. See class documentation for details.
- Parameter
-
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 fromcontext
.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
p_FoMo_F
: - The position of
this
joint stored in thecontext
ordered as (x, y). See class documentation for details.
- Parameter
-
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 fromcontext
.- Parameter
context
: - The context of the model this joint belongs to.
- Returns
v_FoMo_F
: - The translational velocity of
this
joint as stored in thecontext
.
- Parameter
-
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) totheta_dot
. The new rate of change gets stored incontext
.- 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.- Parameter
-
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 ofthis
joint equalsp_FoMo_F
and its angle equalstheta
.- 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.- Parameter
-
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 θ ofthis
joint equalstheta
.- 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.- Parameter
-
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 ofthis
joint equalsp_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.- Parameter
-
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 tov_FoMo_F
. The new translational velocity gets stored incontext
.- 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.- Parameter
-
-
pydrake.multibody.tree.
PrismaticJoint
¶
-
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 forthis
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.
- Parameter
-
damping
(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float¶ Returns
this
joint’s damping constant in N⋅s/m.
-
get_translation
(self: pydrake.multibody.tree.PrismaticJoint_[float], context: pydrake.systems.framework.Context_[float]) → float¶ Gets the translation distance of
this
mobilizer fromcontext
.- Parameter
context
: - The context of the MultibodyTree this joint belongs to.
Returns: The translation coordinate of this
joint read fromcontext
.- Parameter
-
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()) fromcontext
.- Parameter
context
: - The context of the MultibodyTree this joint belongs to.
Returns: The rate of change of this
joint’s translation read fromcontext
.- Parameter
-
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 ofthis
joint equalstranslation
.- 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.- Parameter
-
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 totranslation_dot
. The new rate of changetranslation_dot
gets stored incontext
.- 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.- Parameter
-
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
.
-
-
class
-
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 forthis
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.
- Parameter
-
damping
(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd]) → float¶ Returns
this
joint’s damping constant in N⋅s/m.
-
get_translation
(self: pydrake.multibody.tree.PrismaticJoint_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.autodiffutils.AutoDiffXd¶ Gets the translation distance of
this
mobilizer fromcontext
.- Parameter
context
: - The context of the MultibodyTree this joint belongs to.
Returns: The translation coordinate of this
joint read fromcontext
.- Parameter
-
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()) fromcontext
.- Parameter
context
: - The context of the MultibodyTree this joint belongs to.
Returns: The rate of change of this
joint’s translation read fromcontext
.- Parameter
-
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 ofthis
joint equalstranslation
.- 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.- Parameter
-
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 totranslation_dot
. The new rate of changetranslation_dot
gets stored incontext
.- 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.- Parameter
-
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
.
-
-
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 forthis
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.
- Parameter
-
damping
(self: pydrake.multibody.tree.PrismaticJoint_[Expression]) → float¶ Returns
this
joint’s damping constant in N⋅s/m.
-
get_translation
(self: pydrake.multibody.tree.PrismaticJoint_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.symbolic.Expression¶ Gets the translation distance of
this
mobilizer fromcontext
.- Parameter
context
: - The context of the MultibodyTree this joint belongs to.
Returns: The translation coordinate of this
joint read fromcontext
.- Parameter
-
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()) fromcontext
.- Parameter
context
: - The context of the MultibodyTree this joint belongs to.
Returns: The rate of change of this
joint’s translation read fromcontext
.- Parameter
-
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 ofthis
joint equalstranslation
.- 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.- Parameter
-
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 totranslation_dot
. The new rate of changetranslation_dot
gets stored incontext
.- 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.- Parameter
-
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
.
-
-
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 forthis
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.
- Parameter
-
damping
(self: pydrake.multibody.tree.PrismaticJoint_[float]) → float¶ Returns
this
joint’s damping constant in N⋅s/m.
-
get_translation
(self: pydrake.multibody.tree.PrismaticJoint_[float], context: pydrake.systems.framework.Context_[float]) → float¶ Gets the translation distance of
this
mobilizer fromcontext
.- Parameter
context
: - The context of the MultibodyTree this joint belongs to.
Returns: The translation coordinate of this
joint read fromcontext
.- Parameter
-
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()) fromcontext
.- Parameter
context
: - The context of the MultibodyTree this joint belongs to.
Returns: The rate of change of this
joint’s translation read fromcontext
.- Parameter
-
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 ofthis
joint equalstranslation
.- 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.- Parameter
-
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 totranslation_dot
. The new rate of changetranslation_dot
gets stored incontext
.- 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.- Parameter
-
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
.
-
-
pydrake.multibody.tree.
RevoluteJoint
¶
-
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__
(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
(oraxis_M
) is the eigenvector ofR_FM
with eigenvalue equal to one. This vector can have any length, only the direction is used. This method aborts ifaxis
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 forthis
joint (see get_angular_rate()).
Raises: RuntimeError if damping is negative. - Parameter
-
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 fromcontext
.- Parameter
context
: - The context of the MultibodyTree this joint belongs to.
Returns: The angle coordinate of this
joint stored in thecontext
.- Parameter
-
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 ofthis
joint equalsangle
.- 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.- Parameter
-
set_random_angle_distribution
(self: pydrake.multibody.tree.RevoluteJoint_[float], angle: pydrake.symbolic.Expression) → None¶
-
-
class
-
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__
(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
(oraxis_M
) is the eigenvector ofR_FM
with eigenvalue equal to one. This vector can have any length, only the direction is used. This method aborts ifaxis
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 forthis
joint (see get_angular_rate()).
Raises: RuntimeError if damping is negative. - Parameter
-
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 fromcontext
.- Parameter
context
: - The context of the MultibodyTree this joint belongs to.
Returns: The angle coordinate of this
joint stored in thecontext
.- Parameter
-
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 ofthis
joint equalsangle
.- 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.- Parameter
-
set_random_angle_distribution
(self: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd], angle: pydrake.symbolic.Expression) → None¶
-
-
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__
(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
(oraxis_M
) is the eigenvector ofR_FM
with eigenvalue equal to one. This vector can have any length, only the direction is used. This method aborts ifaxis
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 forthis
joint (see get_angular_rate()).
Raises: RuntimeError if damping is negative. - Parameter
-
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 fromcontext
.- Parameter
context
: - The context of the MultibodyTree this joint belongs to.
Returns: The angle coordinate of this
joint stored in thecontext
.- Parameter
-
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 ofthis
joint equalsangle
.- 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.- Parameter
-
set_random_angle_distribution
(self: pydrake.multibody.tree.RevoluteJoint_[Expression], angle: pydrake.symbolic.Expression) → None¶
-
-
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__
(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
(oraxis_M
) is the eigenvector ofR_FM
with eigenvalue equal to one. This vector can have any length, only the direction is used. This method aborts ifaxis
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 forthis
joint (see get_angular_rate()).
Raises: RuntimeError if damping is negative. - Parameter
-
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 fromcontext
.- Parameter
context
: - The context of the MultibodyTree this joint belongs to.
Returns: The angle coordinate of this
joint stored in thecontext
.- Parameter
-
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 ofthis
joint equalsangle
.- 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.- Parameter
-
set_random_angle_distribution
(self: pydrake.multibody.tree.RevoluteJoint_[float], angle: pydrake.symbolic.Expression) → None¶
-
-
pydrake.multibody.tree.
RevoluteSpring
¶
-
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.- Parameter
-
joint
(self: pydrake.multibody.tree.RevoluteSpring_[float]) → pydrake.multibody.tree.RevoluteJoint_[float]¶
-
nominal_angle
(self: pydrake.multibody.tree.RevoluteSpring_[float]) → float¶
-
stiffness
(self: pydrake.multibody.tree.RevoluteSpring_[float]) → float¶
-
-
class
-
class
pydrake.multibody.tree.
RevoluteSpring_[AutoDiffXd]
¶ Bases:
pydrake.multibody.tree.ForceElement_[AutoDiffXd]
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_[AutoDiffXd], joint: pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd], 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.- Parameter
-
joint
(self: pydrake.multibody.tree.RevoluteSpring_[AutoDiffXd]) → pydrake.multibody.tree.RevoluteJoint_[AutoDiffXd]¶
-
nominal_angle
(self: pydrake.multibody.tree.RevoluteSpring_[AutoDiffXd]) → float¶
-
stiffness
(self: pydrake.multibody.tree.RevoluteSpring_[AutoDiffXd]) → float¶
-
-
class
pydrake.multibody.tree.
RevoluteSpring_[Expression]
¶ Bases:
pydrake.multibody.tree.ForceElement_[Expression]
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_[Expression], joint: pydrake.multibody.tree.RevoluteJoint_[Expression], 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.- Parameter
-
joint
(self: pydrake.multibody.tree.RevoluteSpring_[Expression]) → pydrake.multibody.tree.RevoluteJoint_[Expression]¶
-
nominal_angle
(self: pydrake.multibody.tree.RevoluteSpring_[Expression]) → float¶
-
stiffness
(self: pydrake.multibody.tree.RevoluteSpring_[Expression]) → float¶
-
-
class
pydrake.multibody.tree.
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.- Parameter
-
joint
(self: pydrake.multibody.tree.RevoluteSpring_[float]) → pydrake.multibody.tree.RevoluteJoint_[float]¶
-
nominal_angle
(self: pydrake.multibody.tree.RevoluteSpring_[float]) → float¶
-
stiffness
(self: pydrake.multibody.tree.RevoluteSpring_[float]) → float¶
-
-
pydrake.multibody.tree.
RigidBody
¶
-
template
pydrake.multibody.tree.
RigidBody_
¶ Instantiations:
RigidBody_[float]
,RigidBody_[AutoDiffXd]
,RigidBody_[Expression]
-
class
RigidBody_[float]
¶ Bases:
pydrake.multibody.tree.Body_[float]
The term rigid body implies that the deformations of the body under consideration are so small that they have no significant effect on the overall motions of the body and therefore deformations can be neglected. If deformations are neglected, the distance between any two points on the rigid body remains constant at all times. This invariance of the distance between two arbitrary points is often taken as the definition of a rigid body in classical treatments of multibody mechanics [Goldstein 2001]. It can be demonstrated that the unconstrained three-dimensional motions of a rigid body can be described by six coordinates and thus it is often said that a free body in space has six degrees of freedom. These degrees of freedom obey the Newton-Euler equations of motion. However, within a MultibodyTree, a RigidBody is not free in space; instead, it is assigned a limited number of degrees of freedom (0-6) with respect to its parent body in the multibody tree by its Mobilizer (also called a “tree joint” or “inboard joint”). Additional constraints on permissible motion can be added using Constraint objects to remove more degrees of freedom.
- [Goldstein 2001] H Goldstein, CP Poole, JL Safko, Classical Mechanics
- (3rd Edition), Addison-Wesley, 2001.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
default_com
(self: pydrake.multibody.tree.RigidBody_[float]) → numpy.ndarray[numpy.float64[3, 1]]¶ Returns the default value of this rigid body’s center of mass as measured and expressed in this body’s frame. This value is initially supplied at construction when specifying this body’s SpatialInertia.
- Returns
p_BoBcm_B
: - The position of this rigid body B’s center of mass
Bcm
measured from Bo (B’s frame origin) and expressed in B (body B’s frame).
- Returns
-
default_mass
(self: pydrake.multibody.tree.RigidBody_[float]) → float¶ Returns the default value of this body’s mass. This value is initially supplied at construction when specifying this body’s SpatialInertia.
Returns: This body’s default mass.
-
default_spatial_inertia
(self: pydrake.multibody.tree.RigidBody_[float]) → drake::multibody::SpatialInertia<double>¶ Gets the default value of this body B’s spatial inertia about Bo (B’s origin) and expressed in B (this body’s frame).
- Returns
M_BBo_B
: - body B’s spatial inertia about Bo, expressed in B.
- Returns
-
default_unit_inertia
(self: pydrake.multibody.tree.RigidBody_[float]) → drake::multibody::UnitInertia<double>¶ Returns the default value of this body B’s unit inertia about Bo (body B’s origin), expressed in B (this body’s frame). This value is initially supplied at construction when specifying this body’s SpatialInertia.
- Returns
G_BBo_B
: - rigid body B’s unit inertia about Bo, expressed in B.
- Returns
-
class
-
class
pydrake.multibody.tree.
RigidBody_[AutoDiffXd]
¶ Bases:
pydrake.multibody.tree.Body_[AutoDiffXd]
The term rigid body implies that the deformations of the body under consideration are so small that they have no significant effect on the overall motions of the body and therefore deformations can be neglected. If deformations are neglected, the distance between any two points on the rigid body remains constant at all times. This invariance of the distance between two arbitrary points is often taken as the definition of a rigid body in classical treatments of multibody mechanics [Goldstein 2001]. It can be demonstrated that the unconstrained three-dimensional motions of a rigid body can be described by six coordinates and thus it is often said that a free body in space has six degrees of freedom. These degrees of freedom obey the Newton-Euler equations of motion. However, within a MultibodyTree, a RigidBody is not free in space; instead, it is assigned a limited number of degrees of freedom (0-6) with respect to its parent body in the multibody tree by its Mobilizer (also called a “tree joint” or “inboard joint”). Additional constraints on permissible motion can be added using Constraint objects to remove more degrees of freedom.
- [Goldstein 2001] H Goldstein, CP Poole, JL Safko, Classical Mechanics
- (3rd Edition), Addison-Wesley, 2001.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
default_com
(self: pydrake.multibody.tree.RigidBody_[AutoDiffXd]) → numpy.ndarray[numpy.float64[3, 1]]¶ Returns the default value of this rigid body’s center of mass as measured and expressed in this body’s frame. This value is initially supplied at construction when specifying this body’s SpatialInertia.
- Returns
p_BoBcm_B
: - The position of this rigid body B’s center of mass
Bcm
measured from Bo (B’s frame origin) and expressed in B (body B’s frame).
- Returns
-
default_mass
(self: pydrake.multibody.tree.RigidBody_[AutoDiffXd]) → float¶ Returns the default value of this body’s mass. This value is initially supplied at construction when specifying this body’s SpatialInertia.
Returns: This body’s default mass.
-
default_spatial_inertia
(self: pydrake.multibody.tree.RigidBody_[AutoDiffXd]) → pydrake.multibody.tree.SpatialInertia_[float]¶ Gets the default value of this body B’s spatial inertia about Bo (B’s origin) and expressed in B (this body’s frame).
- Returns
M_BBo_B
: - body B’s spatial inertia about Bo, expressed in B.
- Returns
-
default_unit_inertia
(self: pydrake.multibody.tree.RigidBody_[AutoDiffXd]) → pydrake.multibody.tree.UnitInertia_[float]¶ Returns the default value of this body B’s unit inertia about Bo (body B’s origin), expressed in B (this body’s frame). This value is initially supplied at construction when specifying this body’s SpatialInertia.
- Returns
G_BBo_B
: - rigid body B’s unit inertia about Bo, expressed in B.
- Returns
-
class
pydrake.multibody.tree.
RigidBody_[Expression]
¶ Bases:
pydrake.multibody.tree.Body_[Expression]
The term rigid body implies that the deformations of the body under consideration are so small that they have no significant effect on the overall motions of the body and therefore deformations can be neglected. If deformations are neglected, the distance between any two points on the rigid body remains constant at all times. This invariance of the distance between two arbitrary points is often taken as the definition of a rigid body in classical treatments of multibody mechanics [Goldstein 2001]. It can be demonstrated that the unconstrained three-dimensional motions of a rigid body can be described by six coordinates and thus it is often said that a free body in space has six degrees of freedom. These degrees of freedom obey the Newton-Euler equations of motion. However, within a MultibodyTree, a RigidBody is not free in space; instead, it is assigned a limited number of degrees of freedom (0-6) with respect to its parent body in the multibody tree by its Mobilizer (also called a “tree joint” or “inboard joint”). Additional constraints on permissible motion can be added using Constraint objects to remove more degrees of freedom.
- [Goldstein 2001] H Goldstein, CP Poole, JL Safko, Classical Mechanics
- (3rd Edition), Addison-Wesley, 2001.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
default_com
(self: pydrake.multibody.tree.RigidBody_[Expression]) → numpy.ndarray[numpy.float64[3, 1]]¶ Returns the default value of this rigid body’s center of mass as measured and expressed in this body’s frame. This value is initially supplied at construction when specifying this body’s SpatialInertia.
- Returns
p_BoBcm_B
: - The position of this rigid body B’s center of mass
Bcm
measured from Bo (B’s frame origin) and expressed in B (body B’s frame).
- Returns
-
default_mass
(self: pydrake.multibody.tree.RigidBody_[Expression]) → float¶ Returns the default value of this body’s mass. This value is initially supplied at construction when specifying this body’s SpatialInertia.
Returns: This body’s default mass.
-
default_spatial_inertia
(self: pydrake.multibody.tree.RigidBody_[Expression]) → pydrake.multibody.tree.SpatialInertia_[float]¶ Gets the default value of this body B’s spatial inertia about Bo (B’s origin) and expressed in B (this body’s frame).
- Returns
M_BBo_B
: - body B’s spatial inertia about Bo, expressed in B.
- Returns
-
default_unit_inertia
(self: pydrake.multibody.tree.RigidBody_[Expression]) → pydrake.multibody.tree.UnitInertia_[float]¶ Returns the default value of this body B’s unit inertia about Bo (body B’s origin), expressed in B (this body’s frame). This value is initially supplied at construction when specifying this body’s SpatialInertia.
- Returns
G_BBo_B
: - rigid body B’s unit inertia about Bo, expressed in B.
- Returns
-
class
pydrake.multibody.tree.
RigidBody_[float]
¶ Bases:
pydrake.multibody.tree.Body_[float]
The term rigid body implies that the deformations of the body under consideration are so small that they have no significant effect on the overall motions of the body and therefore deformations can be neglected. If deformations are neglected, the distance between any two points on the rigid body remains constant at all times. This invariance of the distance between two arbitrary points is often taken as the definition of a rigid body in classical treatments of multibody mechanics [Goldstein 2001]. It can be demonstrated that the unconstrained three-dimensional motions of a rigid body can be described by six coordinates and thus it is often said that a free body in space has six degrees of freedom. These degrees of freedom obey the Newton-Euler equations of motion. However, within a MultibodyTree, a RigidBody is not free in space; instead, it is assigned a limited number of degrees of freedom (0-6) with respect to its parent body in the multibody tree by its Mobilizer (also called a “tree joint” or “inboard joint”). Additional constraints on permissible motion can be added using Constraint objects to remove more degrees of freedom.
- [Goldstein 2001] H Goldstein, CP Poole, JL Safko, Classical Mechanics
- (3rd Edition), Addison-Wesley, 2001.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
default_com
(self: pydrake.multibody.tree.RigidBody_[float]) → numpy.ndarray[numpy.float64[3, 1]]¶ Returns the default value of this rigid body’s center of mass as measured and expressed in this body’s frame. This value is initially supplied at construction when specifying this body’s SpatialInertia.
- Returns
p_BoBcm_B
: - The position of this rigid body B’s center of mass
Bcm
measured from Bo (B’s frame origin) and expressed in B (body B’s frame).
- Returns
-
default_mass
(self: pydrake.multibody.tree.RigidBody_[float]) → float¶ Returns the default value of this body’s mass. This value is initially supplied at construction when specifying this body’s SpatialInertia.
Returns: This body’s default mass.
-
default_spatial_inertia
(self: pydrake.multibody.tree.RigidBody_[float]) → drake::multibody::SpatialInertia<double>¶ Gets the default value of this body B’s spatial inertia about Bo (B’s origin) and expressed in B (this body’s frame).
- Returns
M_BBo_B
: - body B’s spatial inertia about Bo, expressed in B.
- Returns
-
default_unit_inertia
(self: pydrake.multibody.tree.RigidBody_[float]) → drake::multibody::UnitInertia<double>¶ Returns the default value of this body B’s unit inertia about Bo (body B’s origin), expressed in B (this body’s frame). This value is initially supplied at construction when specifying this body’s SpatialInertia.
- Returns
G_BBo_B
: - rigid body B’s unit inertia about Bo, expressed in B.
- Returns
-
pydrake.multibody.tree.
RotationalInertia
¶
-
template
pydrake.multibody.tree.
RotationalInertia_
¶ Instantiations:
RotationalInertia_[float]
,RotationalInertia_[AutoDiffXd]
,RotationalInertia_[Expression]
-
class
RotationalInertia_[float]
¶ This class describes the mass distribution (inertia properties) of a body or composite body about a particular point. Herein, “composite body” means one body or a collection of bodies that are welded together. In this documentation, “body” and “composite body” are used interchangeably.
A rigid body’s mass distribution is described by three quantities: the body’s mass; the body’s center of mass; and the body’s rotational inertia about a particular point. The term rotational inertia is used here and by [Jain 2010] to distinguish from a body’s spatial inertia. In this class, a 3x3 inertia matrix I represents a body’s rotational inertia about a point and expressed in a frame. More specifically,
I_BP_E
is the inertia matrix of a body B about-point P and expressed-in frame E (herein frame E’s orthogonal unit vectors Ex, Ey, Ez are denoted 𝐱̂, 𝐲̂, 𝐳̂).| Ixx Ixy Ixz | I = | Ixy Iyy Iyz | | Ixz Iyz Izz |
The moments of inertia Ixx, Iyy, Izz and products of inertia Ixy, Ixz, Iyz are defined in terms of the mass dm of a differential volume of the body. The position of dm from about-point P is xx̂ + yŷ + zẑ = [x, y, z]_E.
Ixx = ∫ (y² + z²) dm Iyy = ∫ (x² + z²) dm Izz = ∫ (x² + y²) dm Ixy = - ∫ x y dm Ixz = - ∫ x z dm Iyz = - ∫ y z dm
We use the negated convention for products of inertia, so that I serves to relate angular velocity ω and angular momentum h via
h = I ⋅ ω
. Ensure your products of inertia follow this negative sign convention.The 3x3 inertia matrix is symmetric and its diagonal elements (moments of inertia) and off-diagonal elements (products of inertia) are associated with a body (or composite body) S, an about-point P, and an expressed-in frame E (𝐱̂, 𝐲̂, 𝐳̂̂). A rotational inertia is ill-defined unless there is a body S, about-point P, and expressed-in frame E. The user of this class is responsible for tracking the body S, about-point P and expressed-in frame E (none of these are stored in this class).
Note
This class does not store the about-point nor the expressed-in frame, nor does this class help enforce consistency of the about-point or expressed-in frame. To help users of this class track the about-point and expressed-in frame, we strongly recommend the following notation.
Note
In typeset material, use the symbol \([I^{S/P}]_E\) to represent the rotational inertia (inertia matrix) of a body (or composite body) S about-point P, expressed in frame E. In code and comments, use the monogram notation
I_SP_E
(e.g., as described in multibody_spatial_inertia). If the about-point P is fixed to a body B, the point is named \(B_P\) and this appears in code/comments asBp
. Examples:I_BBp_E
is rigid body B’s rotational inertia about-point Bp expressed-in frame E; I_BBo_E is B’s rotational inertia about-pointBo
(body B’s origin) expressed-in frame E; and I_BBcm_E is B’s inertia matrix about-pointBcm
(B’s center of mass) expressed-in frame E.Note
The rotational inertia (inertia matrix) can be re-expressed in terms of a special frame whose orthogonal unit vectors are parallel to principal axes of inertia so that the inertia matrix is diagonalized with elements called principal moments of inertia.
Note
The formal definition of the inertia matrix \(I^{S/P}\) of a system S about a point P follows the definition of the inertia dyadic 𝐈 of S about P, which begins by modeling S with n particles S₁ … Sₙ (e.g., 12 grams of carbon can be modeled with n = 6.02 * 10²³ molecules/particles). The inertia dyadic 𝐈₁ of one particle S₁ about point P is defined [Kane, 1985] in terms of m₁ (mass of S₁), ᴾ𝐩ˢ¹ (position vector from P to S₁), and the unit dyadic 𝐔 which is defined by the property 𝐔 ⋅ 𝐯 = 𝐯 where 𝐯 is is any vector (this definition of 𝐔 is analogous to defining the identity matrix by the property 𝑰𝒅𝒆𝒏𝒕𝒊𝒕𝒚𝑴𝒂𝒕𝒓𝒊𝒙 * 𝒂𝒏𝒚𝑴𝒂𝒕𝒓𝒊𝒙 = 𝒂𝒏𝒚𝑴𝒂𝒕𝒓𝒊𝒙).
𝐈₁ = m₁ * [𝐔 * (ᴾ𝐩ˢ¹ ⋅ ᴾ𝐩ˢ¹) - ᴾ𝐩ˢ¹ * ᴾ𝐩ˢ¹]
Note: The vector dot-product (⋅) above produces a scalar whereas the vector multiply (*) produces a dyadic which is a 2nd-order tensor (ᴾ𝐩ˢ¹ * ᴾ𝐩ˢ¹ is similar to the matrix outer-product of a 3x1 matrix multiplied by a 1x3 matrix). An example inertia dyadic for a single particle is shown further below. The inertia dyadic 𝐈 of the entire system S is defined by summing the inertia dyadic of each particle Sᵢ about P (i = 1, … n), i.e.,
𝐈 = 𝐈₁ + 𝐈₂ + ... 𝐈ₙ
The elements of the inertia matrix \([I^{S/P}]_E\) expressed in frame E (in terms of orthogonal unit vectors 𝐱̂, 𝐲̂, 𝐳̂̂) are found by pre-dot multiplying and post-dot multiplying 𝐈 with appropriate unit vectors.
Ixx = 𝐱̂ ⋅ 𝐈 ⋅ 𝐱̂ Ixy = 𝐱̂ ⋅ 𝐈 ⋅ 𝐲̂ Ixz = 𝐱̂ ⋅ 𝐈 ⋅ 𝐳̂̂ Iyx = 𝐲̂ ⋅ 𝐈 ⋅ 𝐱̂ Iyy = 𝐲̂ ⋅ 𝐈 ⋅ 𝐲̂ Iyz = 𝐲̂ ⋅ 𝐈 ⋅ 𝐳̂̂ Izx = 𝐳̂̂ ⋅ 𝐈 ⋅ 𝐱̂ Izy = 𝐳̂̂ ⋅ 𝐈 ⋅ 𝐲̂ Izz = 𝐳̂̂ ⋅ 𝐈 ⋅ 𝐳̂̂
The inertia dyadic 𝐈ᴮ of a rigid body B about Bcm (B’s center of mass) is related to various dynamic quantities. For example, B’s angular momentum 𝐇 about Bcm in a frame N and B’s kinetic energy KE in N relate to 𝐈ᴮ by
𝐇 = 𝐈ᴮ ⋅ 𝛚 KE = 1/2 𝛚 ⋅ 𝐈ᴮ ⋅ 𝛚 + 1/2 mᴮ 𝐯 ⋅ 𝐯
where 𝛚 is B’s angular velocity in N, 𝐯 is Bcm’s translational velocity in N, and mᴮ is B’s mass. When frame N happens to be a Newtonian frame (also called an inertial frame or non-rotating/non-accelerating frame), the moment 𝐓 of all forces on B about Bcm relates to 𝐈ᴮ and 𝛂 (B’s angular acceleration in N) by Euler’s rigid body equation as
𝐓 = 𝐈ᴮ ⋅ 𝛂 + 𝛚 × 𝐈ᴮ ⋅ 𝛚
Example: For a particle Q of mass m whose position vector from a point O is written in terms of right-handed orthogonal unit vectors 𝐱̂, 𝐲̂, 𝐳̂ (below), the inertia dyadic 𝐈 of particle Q about point O is defined and calculated
𝐩 = x 𝐱̂ + y 𝐲̂ (given) 𝐈 = m * [𝐔 * (𝐩 ⋅ 𝐩) - 𝐩 * 𝐩] (definition) = m * [𝐔 * (x² + y²) - (x𝐱̂ + y𝐲̂̂) * (x𝐱̂ + y𝐲̂) = m * [(𝐱̂𝐱̂ + 𝐲̂𝐲̂ + 𝐳̂𝐳̂) * (x² + y²) - (x²𝐱̂𝐱̂ + xy𝐱̂𝐲̂̂ + xy𝐲̂̂𝐱̂ + y²𝐲̂̂𝐲̂̂)] = m * [y²𝐱̂𝐱̂ + x²𝐲̂𝐲̂ + (x² + y²)𝐳̂𝐳̂ - xy𝐱̂𝐲̂̂ - xy𝐲̂̂𝐱̂]
which means the inertia matrix for particle Q about point O for 𝐱̂, 𝐲̂, 𝐳̂ is
| m y² -m x y 0 | I = | -m x y m x² 0 | | 0 0 m (x² + y²) |
[Kane, 1985] pg. 68. “Dynamics: Theory and Applications,” McGraw-Hill Co., New York, 1985 (with D. A. Levinson). Available for free .pdf download: https://ecommons.cornell.edu/handle/1813/637
Note
Several methods in this class throw a RuntimeError for invalid rotational inertia operations in debug releases only. This provides speed in a release build while facilitating debugging in debug builds. In addition, these validity tests are only performed for scalar types for which drake::scalar_predicate<T>::is_bool is
True
. For instance, validity checks are not performed when T is symbolic::Expression.Various methods in this class require numerical (not symbolic) data types.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
CopyToFullMatrix3
(self: pydrake.multibody.tree.RotationalInertia_[float]) → numpy.ndarray[numpy.float64[3, 3]]¶ Gets a full 3x3 matrix copy of this rotational inertia. The returned copy is symmetric and includes both lower and upper parts of the matrix.
-
-
class
-
class
pydrake.multibody.tree.
RotationalInertia_[AutoDiffXd]
¶ This class describes the mass distribution (inertia properties) of a body or composite body about a particular point. Herein, “composite body” means one body or a collection of bodies that are welded together. In this documentation, “body” and “composite body” are used interchangeably.
A rigid body’s mass distribution is described by three quantities: the body’s mass; the body’s center of mass; and the body’s rotational inertia about a particular point. The term rotational inertia is used here and by [Jain 2010] to distinguish from a body’s spatial inertia. In this class, a 3x3 inertia matrix I represents a body’s rotational inertia about a point and expressed in a frame. More specifically,
I_BP_E
is the inertia matrix of a body B about-point P and expressed-in frame E (herein frame E’s orthogonal unit vectors Ex, Ey, Ez are denoted 𝐱̂, 𝐲̂, 𝐳̂).| Ixx Ixy Ixz | I = | Ixy Iyy Iyz | | Ixz Iyz Izz |
The moments of inertia Ixx, Iyy, Izz and products of inertia Ixy, Ixz, Iyz are defined in terms of the mass dm of a differential volume of the body. The position of dm from about-point P is xx̂ + yŷ + zẑ = [x, y, z]_E.
Ixx = ∫ (y² + z²) dm Iyy = ∫ (x² + z²) dm Izz = ∫ (x² + y²) dm Ixy = - ∫ x y dm Ixz = - ∫ x z dm Iyz = - ∫ y z dm
We use the negated convention for products of inertia, so that I serves to relate angular velocity ω and angular momentum h via
h = I ⋅ ω
. Ensure your products of inertia follow this negative sign convention.The 3x3 inertia matrix is symmetric and its diagonal elements (moments of inertia) and off-diagonal elements (products of inertia) are associated with a body (or composite body) S, an about-point P, and an expressed-in frame E (𝐱̂, 𝐲̂, 𝐳̂̂). A rotational inertia is ill-defined unless there is a body S, about-point P, and expressed-in frame E. The user of this class is responsible for tracking the body S, about-point P and expressed-in frame E (none of these are stored in this class).
Note
This class does not store the about-point nor the expressed-in frame, nor does this class help enforce consistency of the about-point or expressed-in frame. To help users of this class track the about-point and expressed-in frame, we strongly recommend the following notation.
Note
In typeset material, use the symbol \([I^{S/P}]_E\) to represent the rotational inertia (inertia matrix) of a body (or composite body) S about-point P, expressed in frame E. In code and comments, use the monogram notation
I_SP_E
(e.g., as described in multibody_spatial_inertia). If the about-point P is fixed to a body B, the point is named \(B_P\) and this appears in code/comments asBp
. Examples:I_BBp_E
is rigid body B’s rotational inertia about-point Bp expressed-in frame E; I_BBo_E is B’s rotational inertia about-pointBo
(body B’s origin) expressed-in frame E; and I_BBcm_E is B’s inertia matrix about-pointBcm
(B’s center of mass) expressed-in frame E.Note
The rotational inertia (inertia matrix) can be re-expressed in terms of a special frame whose orthogonal unit vectors are parallel to principal axes of inertia so that the inertia matrix is diagonalized with elements called principal moments of inertia.
Note
The formal definition of the inertia matrix \(I^{S/P}\) of a system S about a point P follows the definition of the inertia dyadic 𝐈 of S about P, which begins by modeling S with n particles S₁ … Sₙ (e.g., 12 grams of carbon can be modeled with n = 6.02 * 10²³ molecules/particles). The inertia dyadic 𝐈₁ of one particle S₁ about point P is defined [Kane, 1985] in terms of m₁ (mass of S₁), ᴾ𝐩ˢ¹ (position vector from P to S₁), and the unit dyadic 𝐔 which is defined by the property 𝐔 ⋅ 𝐯 = 𝐯 where 𝐯 is is any vector (this definition of 𝐔 is analogous to defining the identity matrix by the property 𝑰𝒅𝒆𝒏𝒕𝒊𝒕𝒚𝑴𝒂𝒕𝒓𝒊𝒙 * 𝒂𝒏𝒚𝑴𝒂𝒕𝒓𝒊𝒙 = 𝒂𝒏𝒚𝑴𝒂𝒕𝒓𝒊𝒙).
𝐈₁ = m₁ * [𝐔 * (ᴾ𝐩ˢ¹ ⋅ ᴾ𝐩ˢ¹) - ᴾ𝐩ˢ¹ * ᴾ𝐩ˢ¹]
Note: The vector dot-product (⋅) above produces a scalar whereas the vector multiply (*) produces a dyadic which is a 2nd-order tensor (ᴾ𝐩ˢ¹ * ᴾ𝐩ˢ¹ is similar to the matrix outer-product of a 3x1 matrix multiplied by a 1x3 matrix). An example inertia dyadic for a single particle is shown further below. The inertia dyadic 𝐈 of the entire system S is defined by summing the inertia dyadic of each particle Sᵢ about P (i = 1, … n), i.e.,
𝐈 = 𝐈₁ + 𝐈₂ + ... 𝐈ₙ
The elements of the inertia matrix \([I^{S/P}]_E\) expressed in frame E (in terms of orthogonal unit vectors 𝐱̂, 𝐲̂, 𝐳̂̂) are found by pre-dot multiplying and post-dot multiplying 𝐈 with appropriate unit vectors.
Ixx = 𝐱̂ ⋅ 𝐈 ⋅ 𝐱̂ Ixy = 𝐱̂ ⋅ 𝐈 ⋅ 𝐲̂ Ixz = 𝐱̂ ⋅ 𝐈 ⋅ 𝐳̂̂ Iyx = 𝐲̂ ⋅ 𝐈 ⋅ 𝐱̂ Iyy = 𝐲̂ ⋅ 𝐈 ⋅ 𝐲̂ Iyz = 𝐲̂ ⋅ 𝐈 ⋅ 𝐳̂̂ Izx = 𝐳̂̂ ⋅ 𝐈 ⋅ 𝐱̂ Izy = 𝐳̂̂ ⋅ 𝐈 ⋅ 𝐲̂ Izz = 𝐳̂̂ ⋅ 𝐈 ⋅ 𝐳̂̂
The inertia dyadic 𝐈ᴮ of a rigid body B about Bcm (B’s center of mass) is related to various dynamic quantities. For example, B’s angular momentum 𝐇 about Bcm in a frame N and B’s kinetic energy KE in N relate to 𝐈ᴮ by
𝐇 = 𝐈ᴮ ⋅ 𝛚 KE = 1/2 𝛚 ⋅ 𝐈ᴮ ⋅ 𝛚 + 1/2 mᴮ 𝐯 ⋅ 𝐯
where 𝛚 is B’s angular velocity in N, 𝐯 is Bcm’s translational velocity in N, and mᴮ is B’s mass. When frame N happens to be a Newtonian frame (also called an inertial frame or non-rotating/non-accelerating frame), the moment 𝐓 of all forces on B about Bcm relates to 𝐈ᴮ and 𝛂 (B’s angular acceleration in N) by Euler’s rigid body equation as
𝐓 = 𝐈ᴮ ⋅ 𝛂 + 𝛚 × 𝐈ᴮ ⋅ 𝛚
Example: For a particle Q of mass m whose position vector from a point O is written in terms of right-handed orthogonal unit vectors 𝐱̂, 𝐲̂, 𝐳̂ (below), the inertia dyadic 𝐈 of particle Q about point O is defined and calculated
𝐩 = x 𝐱̂ + y 𝐲̂ (given) 𝐈 = m * [𝐔 * (𝐩 ⋅ 𝐩) - 𝐩 * 𝐩] (definition) = m * [𝐔 * (x² + y²) - (x𝐱̂ + y𝐲̂̂) * (x𝐱̂ + y𝐲̂) = m * [(𝐱̂𝐱̂ + 𝐲̂𝐲̂ + 𝐳̂𝐳̂) * (x² + y²) - (x²𝐱̂𝐱̂ + xy𝐱̂𝐲̂̂ + xy𝐲̂̂𝐱̂ + y²𝐲̂̂𝐲̂̂)] = m * [y²𝐱̂𝐱̂ + x²𝐲̂𝐲̂ + (x² + y²)𝐳̂𝐳̂ - xy𝐱̂𝐲̂̂ - xy𝐲̂̂𝐱̂]
which means the inertia matrix for particle Q about point O for 𝐱̂, 𝐲̂, 𝐳̂ is
| m y² -m x y 0 | I = | -m x y m x² 0 | | 0 0 m (x² + y²) |
[Kane, 1985] pg. 68. “Dynamics: Theory and Applications,” McGraw-Hill Co., New York, 1985 (with D. A. Levinson). Available for free .pdf download: https://ecommons.cornell.edu/handle/1813/637
Note
Several methods in this class throw a RuntimeError for invalid rotational inertia operations in debug releases only. This provides speed in a release build while facilitating debugging in debug builds. In addition, these validity tests are only performed for scalar types for which drake::scalar_predicate<T>::is_bool is
True
. For instance, validity checks are not performed when T is symbolic::Expression.Various methods in this class require numerical (not symbolic) data types.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
CopyToFullMatrix3
(self: pydrake.multibody.tree.RotationalInertia_[AutoDiffXd]) → numpy.ndarray[object[3, 3]]¶ Gets a full 3x3 matrix copy of this rotational inertia. The returned copy is symmetric and includes both lower and upper parts of the matrix.
-
-
class
pydrake.multibody.tree.
RotationalInertia_[Expression]
¶ This class describes the mass distribution (inertia properties) of a body or composite body about a particular point. Herein, “composite body” means one body or a collection of bodies that are welded together. In this documentation, “body” and “composite body” are used interchangeably.
A rigid body’s mass distribution is described by three quantities: the body’s mass; the body’s center of mass; and the body’s rotational inertia about a particular point. The term rotational inertia is used here and by [Jain 2010] to distinguish from a body’s spatial inertia. In this class, a 3x3 inertia matrix I represents a body’s rotational inertia about a point and expressed in a frame. More specifically,
I_BP_E
is the inertia matrix of a body B about-point P and expressed-in frame E (herein frame E’s orthogonal unit vectors Ex, Ey, Ez are denoted 𝐱̂, 𝐲̂, 𝐳̂).| Ixx Ixy Ixz | I = | Ixy Iyy Iyz | | Ixz Iyz Izz |
The moments of inertia Ixx, Iyy, Izz and products of inertia Ixy, Ixz, Iyz are defined in terms of the mass dm of a differential volume of the body. The position of dm from about-point P is xx̂ + yŷ + zẑ = [x, y, z]_E.
Ixx = ∫ (y² + z²) dm Iyy = ∫ (x² + z²) dm Izz = ∫ (x² + y²) dm Ixy = - ∫ x y dm Ixz = - ∫ x z dm Iyz = - ∫ y z dm
We use the negated convention for products of inertia, so that I serves to relate angular velocity ω and angular momentum h via
h = I ⋅ ω
. Ensure your products of inertia follow this negative sign convention.The 3x3 inertia matrix is symmetric and its diagonal elements (moments of inertia) and off-diagonal elements (products of inertia) are associated with a body (or composite body) S, an about-point P, and an expressed-in frame E (𝐱̂, 𝐲̂, 𝐳̂̂). A rotational inertia is ill-defined unless there is a body S, about-point P, and expressed-in frame E. The user of this class is responsible for tracking the body S, about-point P and expressed-in frame E (none of these are stored in this class).
Note
This class does not store the about-point nor the expressed-in frame, nor does this class help enforce consistency of the about-point or expressed-in frame. To help users of this class track the about-point and expressed-in frame, we strongly recommend the following notation.
Note
In typeset material, use the symbol \([I^{S/P}]_E\) to represent the rotational inertia (inertia matrix) of a body (or composite body) S about-point P, expressed in frame E. In code and comments, use the monogram notation
I_SP_E
(e.g., as described in multibody_spatial_inertia). If the about-point P is fixed to a body B, the point is named \(B_P\) and this appears in code/comments asBp
. Examples:I_BBp_E
is rigid body B’s rotational inertia about-point Bp expressed-in frame E; I_BBo_E is B’s rotational inertia about-pointBo
(body B’s origin) expressed-in frame E; and I_BBcm_E is B’s inertia matrix about-pointBcm
(B’s center of mass) expressed-in frame E.Note
The rotational inertia (inertia matrix) can be re-expressed in terms of a special frame whose orthogonal unit vectors are parallel to principal axes of inertia so that the inertia matrix is diagonalized with elements called principal moments of inertia.
Note
The formal definition of the inertia matrix \(I^{S/P}\) of a system S about a point P follows the definition of the inertia dyadic 𝐈 of S about P, which begins by modeling S with n particles S₁ … Sₙ (e.g., 12 grams of carbon can be modeled with n = 6.02 * 10²³ molecules/particles). The inertia dyadic 𝐈₁ of one particle S₁ about point P is defined [Kane, 1985] in terms of m₁ (mass of S₁), ᴾ𝐩ˢ¹ (position vector from P to S₁), and the unit dyadic 𝐔 which is defined by the property 𝐔 ⋅ 𝐯 = 𝐯 where 𝐯 is is any vector (this definition of 𝐔 is analogous to defining the identity matrix by the property 𝑰𝒅𝒆𝒏𝒕𝒊𝒕𝒚𝑴𝒂𝒕𝒓𝒊𝒙 * 𝒂𝒏𝒚𝑴𝒂𝒕𝒓𝒊𝒙 = 𝒂𝒏𝒚𝑴𝒂𝒕𝒓𝒊𝒙).
𝐈₁ = m₁ * [𝐔 * (ᴾ𝐩ˢ¹ ⋅ ᴾ𝐩ˢ¹) - ᴾ𝐩ˢ¹ * ᴾ𝐩ˢ¹]
Note: The vector dot-product (⋅) above produces a scalar whereas the vector multiply (*) produces a dyadic which is a 2nd-order tensor (ᴾ𝐩ˢ¹ * ᴾ𝐩ˢ¹ is similar to the matrix outer-product of a 3x1 matrix multiplied by a 1x3 matrix). An example inertia dyadic for a single particle is shown further below. The inertia dyadic 𝐈 of the entire system S is defined by summing the inertia dyadic of each particle Sᵢ about P (i = 1, … n), i.e.,
𝐈 = 𝐈₁ + 𝐈₂ + ... 𝐈ₙ
The elements of the inertia matrix \([I^{S/P}]_E\) expressed in frame E (in terms of orthogonal unit vectors 𝐱̂, 𝐲̂, 𝐳̂̂) are found by pre-dot multiplying and post-dot multiplying 𝐈 with appropriate unit vectors.
Ixx = 𝐱̂ ⋅ 𝐈 ⋅ 𝐱̂ Ixy = 𝐱̂ ⋅ 𝐈 ⋅ 𝐲̂ Ixz = 𝐱̂ ⋅ 𝐈 ⋅ 𝐳̂̂ Iyx = 𝐲̂ ⋅ 𝐈 ⋅ 𝐱̂ Iyy = 𝐲̂ ⋅ 𝐈 ⋅ 𝐲̂ Iyz = 𝐲̂ ⋅ 𝐈 ⋅ 𝐳̂̂ Izx = 𝐳̂̂ ⋅ 𝐈 ⋅ 𝐱̂ Izy = 𝐳̂̂ ⋅ 𝐈 ⋅ 𝐲̂ Izz = 𝐳̂̂ ⋅ 𝐈 ⋅ 𝐳̂̂
The inertia dyadic 𝐈ᴮ of a rigid body B about Bcm (B’s center of mass) is related to various dynamic quantities. For example, B’s angular momentum 𝐇 about Bcm in a frame N and B’s kinetic energy KE in N relate to 𝐈ᴮ by
𝐇 = 𝐈ᴮ ⋅ 𝛚 KE = 1/2 𝛚 ⋅ 𝐈ᴮ ⋅ 𝛚 + 1/2 mᴮ 𝐯 ⋅ 𝐯
where 𝛚 is B’s angular velocity in N, 𝐯 is Bcm’s translational velocity in N, and mᴮ is B’s mass. When frame N happens to be a Newtonian frame (also called an inertial frame or non-rotating/non-accelerating frame), the moment 𝐓 of all forces on B about Bcm relates to 𝐈ᴮ and 𝛂 (B’s angular acceleration in N) by Euler’s rigid body equation as
𝐓 = 𝐈ᴮ ⋅ 𝛂 + 𝛚 × 𝐈ᴮ ⋅ 𝛚
Example: For a particle Q of mass m whose position vector from a point O is written in terms of right-handed orthogonal unit vectors 𝐱̂, 𝐲̂, 𝐳̂ (below), the inertia dyadic 𝐈 of particle Q about point O is defined and calculated
𝐩 = x 𝐱̂ + y 𝐲̂ (given) 𝐈 = m * [𝐔 * (𝐩 ⋅ 𝐩) - 𝐩 * 𝐩] (definition) = m * [𝐔 * (x² + y²) - (x𝐱̂ + y𝐲̂̂) * (x𝐱̂ + y𝐲̂) = m * [(𝐱̂𝐱̂ + 𝐲̂𝐲̂ + 𝐳̂𝐳̂) * (x² + y²) - (x²𝐱̂𝐱̂ + xy𝐱̂𝐲̂̂ + xy𝐲̂̂𝐱̂ + y²𝐲̂̂𝐲̂̂)] = m * [y²𝐱̂𝐱̂ + x²𝐲̂𝐲̂ + (x² + y²)𝐳̂𝐳̂ - xy𝐱̂𝐲̂̂ - xy𝐲̂̂𝐱̂]
which means the inertia matrix for particle Q about point O for 𝐱̂, 𝐲̂, 𝐳̂ is
| m y² -m x y 0 | I = | -m x y m x² 0 | | 0 0 m (x² + y²) |
[Kane, 1985] pg. 68. “Dynamics: Theory and Applications,” McGraw-Hill Co., New York, 1985 (with D. A. Levinson). Available for free .pdf download: https://ecommons.cornell.edu/handle/1813/637
Note
Several methods in this class throw a RuntimeError for invalid rotational inertia operations in debug releases only. This provides speed in a release build while facilitating debugging in debug builds. In addition, these validity tests are only performed for scalar types for which drake::scalar_predicate<T>::is_bool is
True
. For instance, validity checks are not performed when T is symbolic::Expression.Various methods in this class require numerical (not symbolic) data types.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
CopyToFullMatrix3
(self: pydrake.multibody.tree.RotationalInertia_[Expression]) → numpy.ndarray[object[3, 3]]¶ Gets a full 3x3 matrix copy of this rotational inertia. The returned copy is symmetric and includes both lower and upper parts of the matrix.
-
-
class
pydrake.multibody.tree.
RotationalInertia_[float]
¶ This class describes the mass distribution (inertia properties) of a body or composite body about a particular point. Herein, “composite body” means one body or a collection of bodies that are welded together. In this documentation, “body” and “composite body” are used interchangeably.
A rigid body’s mass distribution is described by three quantities: the body’s mass; the body’s center of mass; and the body’s rotational inertia about a particular point. The term rotational inertia is used here and by [Jain 2010] to distinguish from a body’s spatial inertia. In this class, a 3x3 inertia matrix I represents a body’s rotational inertia about a point and expressed in a frame. More specifically,
I_BP_E
is the inertia matrix of a body B about-point P and expressed-in frame E (herein frame E’s orthogonal unit vectors Ex, Ey, Ez are denoted 𝐱̂, 𝐲̂, 𝐳̂).| Ixx Ixy Ixz | I = | Ixy Iyy Iyz | | Ixz Iyz Izz |
The moments of inertia Ixx, Iyy, Izz and products of inertia Ixy, Ixz, Iyz are defined in terms of the mass dm of a differential volume of the body. The position of dm from about-point P is xx̂ + yŷ + zẑ = [x, y, z]_E.
Ixx = ∫ (y² + z²) dm Iyy = ∫ (x² + z²) dm Izz = ∫ (x² + y²) dm Ixy = - ∫ x y dm Ixz = - ∫ x z dm Iyz = - ∫ y z dm
We use the negated convention for products of inertia, so that I serves to relate angular velocity ω and angular momentum h via
h = I ⋅ ω
. Ensure your products of inertia follow this negative sign convention.The 3x3 inertia matrix is symmetric and its diagonal elements (moments of inertia) and off-diagonal elements (products of inertia) are associated with a body (or composite body) S, an about-point P, and an expressed-in frame E (𝐱̂, 𝐲̂, 𝐳̂̂). A rotational inertia is ill-defined unless there is a body S, about-point P, and expressed-in frame E. The user of this class is responsible for tracking the body S, about-point P and expressed-in frame E (none of these are stored in this class).
Note
This class does not store the about-point nor the expressed-in frame, nor does this class help enforce consistency of the about-point or expressed-in frame. To help users of this class track the about-point and expressed-in frame, we strongly recommend the following notation.
Note
In typeset material, use the symbol \([I^{S/P}]_E\) to represent the rotational inertia (inertia matrix) of a body (or composite body) S about-point P, expressed in frame E. In code and comments, use the monogram notation
I_SP_E
(e.g., as described in multibody_spatial_inertia). If the about-point P is fixed to a body B, the point is named \(B_P\) and this appears in code/comments asBp
. Examples:I_BBp_E
is rigid body B’s rotational inertia about-point Bp expressed-in frame E; I_BBo_E is B’s rotational inertia about-pointBo
(body B’s origin) expressed-in frame E; and I_BBcm_E is B’s inertia matrix about-pointBcm
(B’s center of mass) expressed-in frame E.Note
The rotational inertia (inertia matrix) can be re-expressed in terms of a special frame whose orthogonal unit vectors are parallel to principal axes of inertia so that the inertia matrix is diagonalized with elements called principal moments of inertia.
Note
The formal definition of the inertia matrix \(I^{S/P}\) of a system S about a point P follows the definition of the inertia dyadic 𝐈 of S about P, which begins by modeling S with n particles S₁ … Sₙ (e.g., 12 grams of carbon can be modeled with n = 6.02 * 10²³ molecules/particles). The inertia dyadic 𝐈₁ of one particle S₁ about point P is defined [Kane, 1985] in terms of m₁ (mass of S₁), ᴾ𝐩ˢ¹ (position vector from P to S₁), and the unit dyadic 𝐔 which is defined by the property 𝐔 ⋅ 𝐯 = 𝐯 where 𝐯 is is any vector (this definition of 𝐔 is analogous to defining the identity matrix by the property 𝑰𝒅𝒆𝒏𝒕𝒊𝒕𝒚𝑴𝒂𝒕𝒓𝒊𝒙 * 𝒂𝒏𝒚𝑴𝒂𝒕𝒓𝒊𝒙 = 𝒂𝒏𝒚𝑴𝒂𝒕𝒓𝒊𝒙).
𝐈₁ = m₁ * [𝐔 * (ᴾ𝐩ˢ¹ ⋅ ᴾ𝐩ˢ¹) - ᴾ𝐩ˢ¹ * ᴾ𝐩ˢ¹]
Note: The vector dot-product (⋅) above produces a scalar whereas the vector multiply (*) produces a dyadic which is a 2nd-order tensor (ᴾ𝐩ˢ¹ * ᴾ𝐩ˢ¹ is similar to the matrix outer-product of a 3x1 matrix multiplied by a 1x3 matrix). An example inertia dyadic for a single particle is shown further below. The inertia dyadic 𝐈 of the entire system S is defined by summing the inertia dyadic of each particle Sᵢ about P (i = 1, … n), i.e.,
𝐈 = 𝐈₁ + 𝐈₂ + ... 𝐈ₙ
The elements of the inertia matrix \([I^{S/P}]_E\) expressed in frame E (in terms of orthogonal unit vectors 𝐱̂, 𝐲̂, 𝐳̂̂) are found by pre-dot multiplying and post-dot multiplying 𝐈 with appropriate unit vectors.
Ixx = 𝐱̂ ⋅ 𝐈 ⋅ 𝐱̂ Ixy = 𝐱̂ ⋅ 𝐈 ⋅ 𝐲̂ Ixz = 𝐱̂ ⋅ 𝐈 ⋅ 𝐳̂̂ Iyx = 𝐲̂ ⋅ 𝐈 ⋅ 𝐱̂ Iyy = 𝐲̂ ⋅ 𝐈 ⋅ 𝐲̂ Iyz = 𝐲̂ ⋅ 𝐈 ⋅ 𝐳̂̂ Izx = 𝐳̂̂ ⋅ 𝐈 ⋅ 𝐱̂ Izy = 𝐳̂̂ ⋅ 𝐈 ⋅ 𝐲̂ Izz = 𝐳̂̂ ⋅ 𝐈 ⋅ 𝐳̂̂
The inertia dyadic 𝐈ᴮ of a rigid body B about Bcm (B’s center of mass) is related to various dynamic quantities. For example, B’s angular momentum 𝐇 about Bcm in a frame N and B’s kinetic energy KE in N relate to 𝐈ᴮ by
𝐇 = 𝐈ᴮ ⋅ 𝛚 KE = 1/2 𝛚 ⋅ 𝐈ᴮ ⋅ 𝛚 + 1/2 mᴮ 𝐯 ⋅ 𝐯
where 𝛚 is B’s angular velocity in N, 𝐯 is Bcm’s translational velocity in N, and mᴮ is B’s mass. When frame N happens to be a Newtonian frame (also called an inertial frame or non-rotating/non-accelerating frame), the moment 𝐓 of all forces on B about Bcm relates to 𝐈ᴮ and 𝛂 (B’s angular acceleration in N) by Euler’s rigid body equation as
𝐓 = 𝐈ᴮ ⋅ 𝛂 + 𝛚 × 𝐈ᴮ ⋅ 𝛚
Example: For a particle Q of mass m whose position vector from a point O is written in terms of right-handed orthogonal unit vectors 𝐱̂, 𝐲̂, 𝐳̂ (below), the inertia dyadic 𝐈 of particle Q about point O is defined and calculated
𝐩 = x 𝐱̂ + y 𝐲̂ (given) 𝐈 = m * [𝐔 * (𝐩 ⋅ 𝐩) - 𝐩 * 𝐩] (definition) = m * [𝐔 * (x² + y²) - (x𝐱̂ + y𝐲̂̂) * (x𝐱̂ + y𝐲̂) = m * [(𝐱̂𝐱̂ + 𝐲̂𝐲̂ + 𝐳̂𝐳̂) * (x² + y²) - (x²𝐱̂𝐱̂ + xy𝐱̂𝐲̂̂ + xy𝐲̂̂𝐱̂ + y²𝐲̂̂𝐲̂̂)] = m * [y²𝐱̂𝐱̂ + x²𝐲̂𝐲̂ + (x² + y²)𝐳̂𝐳̂ - xy𝐱̂𝐲̂̂ - xy𝐲̂̂𝐱̂]
which means the inertia matrix for particle Q about point O for 𝐱̂, 𝐲̂, 𝐳̂ is
| m y² -m x y 0 | I = | -m x y m x² 0 | | 0 0 m (x² + y²) |
[Kane, 1985] pg. 68. “Dynamics: Theory and Applications,” McGraw-Hill Co., New York, 1985 (with D. A. Levinson). Available for free .pdf download: https://ecommons.cornell.edu/handle/1813/637
Note
Several methods in this class throw a RuntimeError for invalid rotational inertia operations in debug releases only. This provides speed in a release build while facilitating debugging in debug builds. In addition, these validity tests are only performed for scalar types for which drake::scalar_predicate<T>::is_bool is
True
. For instance, validity checks are not performed when T is symbolic::Expression.Various methods in this class require numerical (not symbolic) data types.
-
__init__