Class SubhingeBase#

Inheritance Relationships#

Base Type#

Derived Types#

Class Documentation#

class SubhingeBase : public Karana::Dynamics::CoordBase#

Represents the abstract base class for articulation subhinges.

This class is the base class for subhinges from which physical and compound subhinge classes are derived. See Subhinges for more discussion about subhinges.

Subclassed by Karana::Dynamics::CompoundSubhinge, Karana::Dynamics::PhysicalSubhinge

Public Types

enum class SUBHINGE_TYPE#

The available subhinge types.

Values:

enumerator LOCKED#

0 dof locked subhinge

enumerator PIN#

1 dof rotation about an axis subhinge

enumerator LINEAR#

1 dof translation along an axis subhinge

enumerator LINEAR3#

3 dof general translational subhinge

enumerator SPHERICAL#

3 dof rotational subhinge (Karana::Math::RotationVector for Q)

enumerator SPHERICAL_QUAT#

3 dof rotational subhinge (Karana::Math::UnitQuaternion for Q)

enumerator SCREW#

1 dof rotation and translation about and along an axis subhinge

enumerator COMPOUND#

subhinge for a compound body

Public Functions

virtual ~SubhingeBase()#

SubhingeBase destructor.

virtual const std::string &typeString() const noexcept = 0#

Returns the type string of the object.

Returns:

The type string.

virtual SubhingeBase::SUBHINGE_TYPE subhingeType() const = 0#

Helper method to return the subhinge type.

Returns:

the subhinge type

inline virtual void setPrescribed(bool flag)#

Set the prescribed flag for the subhinge.

Parameters:

flag – the enable/disable flag

inline bool getPrescribed() const#

Return the prescribed flag for the subhinge.

Returns:

the prescribed mode status

inline const kc::ks_ptr<HingeBase> &parentHinge() const#

Return the parent hinge for the subhinge.

Returns:

the PhysicalHinge parent hinge

virtual km::Mat jacobian(const kf::Frame &target, bool oriented = true) const = 0#

Return the analytical 6xnU Jacobian matrix for the subhinge to the target frame. The left side of the Jacobian is in the target frame. This method assumes that the target frame is outboard of the subhinge’s pframe.

Parameters:
  • target – the target frame whose Jacobian is computed

  • oriented – if true, the polarity of the subhinge is assumed to be aligned with the path to the target frame

Returns:

the Jacobian matrix

Public Static Functions

static std::string subhingeTypeString(SubhingeBase::SUBHINGE_TYPE shtype)#

Helper method to return the string name for a SUBHINGE_TYPE subhinge type.

Returns:

the subhinge type as a string

Protected Functions

SubhingeBase(const std::string &nm, kc::id_t id, kc::ks_ptr<HingeBase>)#

Return matrix to map coord velocites to physical velocities.

The product of this matrix with the generalized veloicites vector (U) evaluates to the full relative velocity contribution from this object.

For subhinges, this is a (6*nbodies)xNU size matrix where NU is number of generalized velocity coordinates for the subhinge. For a physical subhinge, this matrix is 6xNU and uses oframe representation. The product with U returns the relative spatial velocity across the subhinge referenced in the oframe.

For a compound body, this matrix is (6*nbodies)xNU in size where NU is the overall number of generalized velocity coordinates for the aggregated body subhinges. This matrix is the Jacobian from the embedded physical body subhinges to the embedded body relative spatial velocity contribution from them.

For a flex body, this is 6xNU, where NU is the number of modal coordinates. It returns the modal matrix for the pnode (?)

See Generalized Q, U etc coordinates section for more on Q, U etc generalized coordinates.

Constructs a SubhingeBase.

Returns:

coordinate map matrix

Protected Attributes

kc::ks_ptr<HingeBase> _parent_hinge = nullptr#
bool _prescribed = false#