Class SphericalQuatSubhinge#

Inheritance Relationships#

Base Type#

Class Documentation#

class SphericalQuatSubhinge : public Karana::Dynamics::PhysicalSubhinge_T<4, 3>#

Represents a 3 dof rotational subhinge using unit quaternion for generalized coords.

See Subhinges section for more information on physical subhinges.

Public Functions

virtual ~SphericalQuatSubhinge()#

SphericalQuatSubhinge destructor.

inline virtual const std::string &typeString() const noexcept override#

Returns the type string of the SubTree.

Returns:

The type string.

virtual SubhingeBase::SUBHINGE_TYPE subhingeType() const override#

Helper method to return the subhinge type.

Returns:

the subhinge type

SphericalQuatSubhinge(kc::ks_ptr<kf::Frame> oframe, kc::ks_ptr<kf::Frame> pframe, const std::string &name, kc::ks_ptr<FramePairHinge> hge)#

Constructs a SphericalQuatSubhinge_T.

virtual void setU(const Eigen::Ref<const km::Vec> &val) override#

Set the U velocity coordinates.

See Generalized Q, U etc coordinates section for discussion on Q, U etc coordinates.

Parameters:

val – Array of values.

virtual void setQ(const Eigen::Ref<const km::Vec> &val) override#

Check whether parameters have been set.

Set the Q coordinates.

See Generalized Q, U etc coordinates section for discussion on Q, U etc coordinates.

Returns:

True if the parameters have been set. Get/set methods for buffers for the generalized coordinates for this coordinate provider.

Parameters:

val – Array of values.

virtual const km::Vec &getQdot() const override#

Return the Qdot rate coordinates.

See Generalized Q, U etc coordinates section for discussion on Q, U etc coordinates.

Returns:

Array of values.

virtual bool sanitizeCoords() override#

Method to recenter or otherwise sanitize the subhinge’s coordinates.

Some subhinge may have coordinates that need to be “sanitized” from time to time. An example if that of spherical subhinges, where the orientation coordinate representation may require recentering of the local charts when the values are nearing singularity. This method can specialized for subhinges that have this need. The return value should be true if any such sanitizatoin was done to modify the coordinate values.

Returns:

true, is any sanitization was needed and carried out

inline virtual bool requiresCoordSanitization() const override#

Return true if the subhinge has coordinate sanitization needs.

This method can be used to identify the subset of subhinges that have coordinate sanitization needs, so that sanitizeCoords() can be called for them when needed.

Returns:

true if the subhinge has coordinate sanitization needs.

virtual std::string dumpString(const std::string &prefix, const Karana::Core::Base::dumpOptions *options) const override#

Return a formatted string containing information about this object.

Parameters:
  • prefix – String prefix to use for formatting.

  • options – Dump options (if null, defaults will be used).

Returns:

A string representation of the object.

Protected Functions

virtual void _computeTransform(km::HomTran&) override#

Compute the transformation between the oframe and pframe.

This the relTransform data cache callback.

Returns:

The computed homogeneous transformation.

virtual void _computeVelocity(km::SpatialVector&) override#

Compute the spatial velocity between the oframe and pframe.

This the relSpVel data cache callback.

Returns:

The computed spatial velocity.

virtual void _computeAccel(km::SpatialVector&) override#

Compute the spatial acceleration between the oframe and pframe.

This the relSpAccel data cache callback.

Returns:

The computed spatial acceleration.

void _computeQdot(km::Vec&) const#
virtual km::Mat poseGradient(const kf::Frame2Frame &f2f, bool oriented) const override#

Return the pose gradient matrix for a Karana::Frame::Frame2Frame.

Return the 6xnU gradient matrix for the pose of a Karana::Frame::Frame2Frame’s pframe wrt to its oframe with respect to the generalized coordinates Q using analytical methods. The relative orientation is expressed using RotationVectors for a minimal coordinates representation. Though closely related to the Jacobian, the gradient matrix is a coordinate space mapping, while the Jacobian is a velocity space mapping. The gradient matrix is handy for inverse kinematics computations. If oriented is false, the returned value is negated first.

See The frames layer section for more information on frames, and Jacobians section for more on Jacobians.

Parameters:
  • f2f – the Frame2Frame defining the relative from/to frames

  • oriented – the orientation of the coordinates provider

Returns:

the gradient matrix

km::Mat _genvel2qdotMap() const#
km::Mat _qdot2genvelMap() const#
virtual kc::ks_ptr<PhysicalSubhingeParams> _getParams() const override#

Get/set params for a subhinge.