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

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 std::string_view typeString() const noexcept = 0#

Returns the type string of the object.

Returns:

The type string.

virtual SubhingeBase::SubhingeType 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) 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::SubhingeType shtype)#

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

Parameters:

shtype – the subhinge type

Returns:

the subhinge type as a string

Protected Functions

SubhingeBase(std::string_view nm, kc::id_t id, kc::ks_ptr<HingeBase> hge)#

Constructs a SubhingeBase.

Parameters:
  • nm – the name for the subhinge

  • id – the id for the subhinge

  • hge – the parent hinge

Protected Attributes

kc::ks_ptr<HingeBase> _parent_hinge = nullptr#

the parent hinge

bool _prescribed = false#

flag indicating whether the subhinge is prescribed