Drake
QuaternionBallJoint Class Reference

Defines a 3 dof tree joint (mobilizer) that uses a unit quaternion as the generalized orientation coordinates. More...

#include <drake/multibody/joints/quaternion_ball_joint.h>

Inheritance diagram for QuaternionBallJoint:
[legend]
Collaboration diagram for QuaternionBallJoint:
[legend]

## Public Member Functions

QuaternionBallJoint (const std::string &name, const Eigen::Isometry3d &transform_to_parent_body)

virtual ~QuaternionBallJoint ()

template<typename DerivedQ >
Eigen::Transform< typename DerivedQ::Scalar, 3, Eigen::Isometry > jointTransform (const Eigen::MatrixBase< DerivedQ > &q) const
Returns the transform X_PB(q) where P is the parent body and B the child body connected by this joint. More...

template<typename DerivedQ , typename DerivedMS >
void motionSubspace (const Eigen::MatrixBase< DerivedQ > &q, Eigen::MatrixBase< DerivedMS > &motion_subspace, typename drake::math::Gradient< DerivedMS, Eigen::Dynamic >::type *dmotion_subspace=nullptr) const

template<typename DerivedQ , typename DerivedV >
void motionSubspaceDotTimesV (const Eigen::MatrixBase< DerivedQ > &q, const Eigen::MatrixBase< DerivedV > &v, Eigen::Matrix< typename DerivedQ::Scalar, 6, 1 > &motion_subspace_dot_times_v, typename drake::math::Gradient< Eigen::Matrix< typename DerivedQ::Scalar, 6, 1 >, Eigen::Dynamic >::type *dmotion_subspace_dot_times_vdq=nullptr, typename drake::math::Gradient< Eigen::Matrix< typename DerivedQ::Scalar, 6, 1 >, Eigen::Dynamic >::type *dmotion_subspace_dot_times_vdv=nullptr) const

template<typename DerivedQ >
void qdot2v (const Eigen::MatrixBase< DerivedQ > &q, Eigen::Matrix< typename DerivedQ::Scalar, Eigen::Dynamic, Eigen::Dynamic, 0, DrakeJoint::MAX_NUM_VELOCITIES, DrakeJoint::MAX_NUM_POSITIONS > &qdot_to_v, Eigen::Matrix< typename DerivedQ::Scalar, Eigen::Dynamic, Eigen::Dynamic > *dqdot_to_v) const
For the QuaternionBallJoint, computes the matrix N⁺(q)∊ℝ³ˣ⁴ that maps generalized coordinate time derivatives qdot to generalized velocities v, with v=N⁺ qdot. More...

template<typename DerivedQ >
void v2qdot (const Eigen::MatrixBase< DerivedQ > &q, Eigen::Matrix< typename DerivedQ::Scalar, Eigen::Dynamic, Eigen::Dynamic, 0, DrakeJoint::MAX_NUM_POSITIONS, DrakeJoint::MAX_NUM_VELOCITIES > &v_to_qdot, Eigen::Matrix< typename DerivedQ::Scalar, Eigen::Dynamic, Eigen::Dynamic > *dv_to_qdot) const
For the QuaternionBallJoint, computes the matrix N(q)∊ℝ⁴ˣ³ that maps generalized velocities v to generalized coordinate time derivatives qdot, with qdot=N v. More...

template<typename DerivedV >
Eigen::Matrix< typename DerivedV::Scalar, Eigen::Dynamic, 1 > frictionTorque (const Eigen::MatrixBase< DerivedV > &v) const

template<typename DerivedQ >
Eigen::Matrix< typename DerivedQ::Scalar, Eigen::Dynamic, 1 > SpringTorque (const Eigen::MatrixBase< DerivedQ > &q) const

bool is_floating () const override

bool isFloating () const override

std::string get_position_name (int index) const override

std::string get_velocity_name (int index) const override

Eigen::VectorXd zeroConfiguration () const override

Eigen::VectorXd randomConfiguration (std::default_random_engine &generator) const override

std::string getPositionName (int index) const override

std::string getVelocityName (int index) const override

## Protected Member Functions

std::unique_ptr< DrakeJointDoClone () const final

void DoInitializeClone (DrakeJoint *) const final

## Detailed Description

Defines a 3 dof tree joint (mobilizer) that uses a unit quaternion as the generalized orientation coordinates.

### Generalized coordinates (configuration variables)

There are 4 generalized coordinates q, organized as a quaternion. A tree joint connects an inboard (parent) body P to an outboard (child) body B. In those terms this joint's generalized coordinates are:

         ------------- T
q = |    q_PB     |
-------------  4×1
qw qx qy qz


where q_PB is the quaternion that is equivalent to the rotation matrix R_PB. The second line shows the 4 generalized coordinate scalars in order. Note that qw is the scalar part of the quaternion while [qx qy qz] is the vector part. See Spatial Pose and Transform for more information about this notation.

The time derivatives qdot of the generalized coordinates, not to be confused with the generalized velocity variables v, are:

         ------------- T
qdot = |   qdot_PB   |
-------------  4×1


where qdot_PB = d/dt q_PB is the time derivative of the quaternion.

### Generalized velocity

There are 3 generalized velocity variables v, organized as follows:

         --------- T
v = | ω_PB_B  |
--------- 3×1


where ω_PB_B is B's angular velocity in P, expressed in B.

Note that The time derivatives of the generalized velocities are:

         --------- T
vdot = | α_PB_B  |
--------- 3×1


where α_PB_B is B's angular acceleration in P, expressed in B.

## Constructor & Destructor Documentation

 QuaternionBallJoint ( const std::string & name, const Eigen::Isometry3d & transform_to_parent_body )
inline
 virtual ~QuaternionBallJoint ( )
inlinevirtual

## Member Function Documentation

 std::unique_ptr< DrakeJoint > DoClone ( ) const
finalprotected

Here is the caller graph for this function:

 void DoInitializeClone ( DrakeJoint * ) const
inlinefinalprotected
 Eigen::Matrix frictionTorque ( const Eigen::MatrixBase< DerivedV > & v ) const
inline

Here is the call graph for this function:

 std::string get_position_name ( int index ) const
override

Here is the caller graph for this function:

 std::string get_velocity_name ( int index ) const
override

Here is the caller graph for this function:

 std::string getPositionName ( int index ) const
override

Here is the call graph for this function:

Here is the caller graph for this function:

 std::string getVelocityName ( int index ) const
override

Here is the call graph for this function:

Here is the caller graph for this function:

 bool is_floating ( ) const
inlineoverride

Here is the caller graph for this function:

 bool isFloating ( ) const
inlineoverride

Here is the call graph for this function:

 Eigen::Transform jointTransform ( const Eigen::MatrixBase< DerivedQ > & q ) const
inline

Returns the transform X_PB(q) where P is the parent body and B the child body connected by this joint.

Here is the call graph for this function:

 void motionSubspace ( const Eigen::MatrixBase< DerivedQ > & q, Eigen::MatrixBase< DerivedMS > & motion_subspace, typename drake::math::Gradient< DerivedMS, Eigen::Dynamic >::type * dmotion_subspace = nullptr ) const
inline

Here is the call graph for this function:

 void motionSubspaceDotTimesV ( const Eigen::MatrixBase< DerivedQ > & q, const Eigen::MatrixBase< DerivedV > & v, Eigen::Matrix< typename DerivedQ::Scalar, 6, 1 > & motion_subspace_dot_times_v, typename drake::math::Gradient< Eigen::Matrix< typename DerivedQ::Scalar, 6, 1 >, Eigen::Dynamic >::type * dmotion_subspace_dot_times_vdq = nullptr, typename drake::math::Gradient< Eigen::Matrix< typename DerivedQ::Scalar, 6, 1 >, Eigen::Dynamic >::type * dmotion_subspace_dot_times_vdv = nullptr ) const
inline

Here is the call graph for this function:

 void qdot2v ( const Eigen::MatrixBase< DerivedQ > & q, Eigen::Matrix< typename DerivedQ::Scalar, Eigen::Dynamic, Eigen::Dynamic, 0, DrakeJoint::MAX_NUM_VELOCITIES, DrakeJoint::MAX_NUM_POSITIONS > & qdot_to_v, Eigen::Matrix< typename DerivedQ::Scalar, Eigen::Dynamic, Eigen::Dynamic > * dqdot_to_v ) const
inline

For the QuaternionBallJoint, computes the matrix N⁺(q)∊ℝ³ˣ⁴ that maps generalized coordinate time derivatives qdot to generalized velocities v, with v=N⁺ qdot.

The name signifies that N⁺=pinv(N) where N(q) is the matrix that maps v to qdot with qdot=N v and pinv() is the pseudoinverse (in this case the left pseudoinverse).

See the class description for precise definitions of the generalized coordinates and velocities. Because the velocities are not the time derivatives of the coordinates, rotations and translations are reversed, and different expressed-in frames are employed, N⁺ has the following elaborate structure:

       -----------
N⁺ = | Nq⁺_PB_B  |
----------- 3×4


where Nq_PB_B is the matrix that maps angular velocity ω_PB_B to quaternion time derivative qdot_PB such that qdot_PB=Nq_PB_B*ω_PB_B, and Nq⁺_PB_B is the left pseudoinverse of Nq_PB_B.

Parameters
 [in] q The 4-element generalized configuration variable. See the class documentation for details. See warning below regarding the effect if the contained quaternion is not normalized. [out] qdot_to_v The matrix N⁺. dqdot_to_v Unused, must be nullptr on entry.
Warning
Let s be the norm of the quaternion in q. If s ≠ 1, then we will calculate s*Nq⁺_PB_B so the resulting angular velocity vector will be scaled by s as well. This method neither performs a normalization check nor normalizes the quaternion orientation parameters. Implications for integration techniques must be carefully considered.
 VectorXd randomConfiguration ( std::default_random_engine & generator ) const
override

Here is the call graph for this function:

Here is the caller graph for this function:

 Eigen::Matrix SpringTorque ( const Eigen::MatrixBase< DerivedQ > & q ) const
inline

Here is the call graph for this function:

 void v2qdot ( const Eigen::MatrixBase< DerivedQ > & q, Eigen::Matrix< typename DerivedQ::Scalar, Eigen::Dynamic, Eigen::Dynamic, 0, DrakeJoint::MAX_NUM_POSITIONS, DrakeJoint::MAX_NUM_VELOCITIES > & v_to_qdot, Eigen::Matrix< typename DerivedQ::Scalar, Eigen::Dynamic, Eigen::Dynamic > * dv_to_qdot ) const
inline

For the QuaternionBallJoint, computes the matrix N(q)∊ℝ⁴ˣ³ that maps generalized velocities v to generalized coordinate time derivatives qdot, with qdot=N v.

See the class description for precise definitions of the generalized coordinates and velocities. Because the velocities are not the time derivatives of the coordinates, rotations and translations are reversed, and different expressed-in frames are employed, N has the following elaborate structure:

       -------
N = |Nq_PB_B|
------- 4×3


where Nq_PB_B is the matrix that maps angular velocity ω_PB_B to quaternion time derivative qdot_PB such that qdot_PB=Nq_PB_B*ω_PB_B.

Parameters
 [in] q The 4-element generalized configuration variable. See the class documentation for details. See warning below regarding the effect if the contained quaternion is not normalized. [out] v_to_qdot The matrix N. dv_to_qdot Unused, must be nullptr on entry.
Warning
Let s be the norm of the quaternion in q. If s ≠ 1, then we will calculate s*Nq_PB_B so the resulting quaternion derivative will be scaled by s as well. This method neither performs a normalization check nor normalizes the quaternion orientation parameters. Implications for integration techniques must be carefully considered.
 VectorXd zeroConfiguration ( ) const
override

Here is the caller graph for this function:

The documentation for this class was generated from the following files:
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7045660614967346, "perplexity": 25747.320925260883}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-34/segments/1534221214691.99/warc/CC-MAIN-20180819031801-20180819051801-00653.warc.gz"}