Class PhysicalSubhinge#

Nested Relationships#

Nested Types#

Inheritance Relationships#

Base Types#

Derived Types#

Class Documentation#

class PhysicalSubhinge : public Karana::Frame::EdgeFrameToFrame, public Karana::Dynamics::SubhingeBase#

Represents the abstract base class for physical articulation subhinges.

This class is the base class for subhinges from which physical subhinge classes are derived. See Subhinges section for more information on physical subhinges.

Subclassed by Karana::Dynamics::PhysicalSubhinge_T< 3, 3 >, Karana::Dynamics::PhysicalSubhinge_T< 0, 0 >, Karana::Dynamics::PhysicalSubhinge_T< 1, 1 >, Karana::Dynamics::PhysicalSubhinge_T< 4, 3 >, Karana::Dynamics::PhysicalSubhinge_T< NQ, NU >

Public Functions

virtual ~PhysicalSubhinge()#

PhysicalSubhinge destructor.

inline virtual std::string_view typeString() const noexcept override#

Returns the type string of Base.

Returns:

The type string.

inline virtual std::string_view name() const override#

Return the object’s name.

Returns:

The object’s string name.

inline virtual const kc::id_t &id() const override#

Return the object’s id.

Returns:

The object’s id.

virtual kc::ks_ptr<kf::FrameToFrame> f2f() const override#

Return the frame to frame for the CoordBase.

The returned f2f helps locate the CoordBase in the frames tree. Its transform etc data does not however represent the relative transformation changes from the changes to this object’s coordinates.

Returns:

Return the oframe Frame instance

virtual const km::Mat oframeCoordMapMatrix() const = 0#

Return matrix to map coord velocities to physical velocities.

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

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

For a CompoundSubhinge, 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 PhysicalModalBody body, the size is 6xNU, where NU is the number of modal coordinates. It returns the modal matrix for the pnode.

Returns:

coordinate map matrix

inline virtual bool sanitizeCoords()#

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 sanitization was done to modify the coordinate values.

Returns:

true, is any sanitization was needed and carried out

inline virtual bool requiresCoordSanitization() const#

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.

inline virtual void resetChart()#

Reset any sanitization related chart offsets etc that may have been applied.

virtual void setPrescribed(bool flag) override#

Set/unset the prescribed flag for the subhinge.

Parameters:

flag – the prescribed state to set

inline size_t getIndex() const#

Return the slot index for the subhinge in the parent hinge’s list of subhinges.

Returns:

the subhinge index

Protected Functions

inline virtual void _enableCoordChart(bool)#

Enable/disable the use of local charts for the subhinge. Typically charts should be enabled when doing time domain simulations, but disabled when doing configuration kinematics, and linearization operations.

virtual km::Mat _oframe2pframePsi() const override#

Return the oframe to pframe Psi() matrix for this CoordBase.

For

  • a flex body this is a 6x(nU+6) psi matrix, the lhs is at the pnode, and the rhs at the body frame.

  • For a subhinge this is a 6x6 psi matrix, the lhs/rhs are the subhinge’s oframe and pframe pair.

  • a compound subhinge this is the 6x(nbodies*(6+nU)) psi matrix, the lhs is at the physical parent, and the rhs at the embedded bodies.

Returns:

the Psi() matrix

virtual km::Mat _oframe2pframePhi() const override#

Return the oframe to pframe Phi() matrix for this CoordBase.

For

  • a flex body this is a 6x(nU+6) phi matrix, the lhs is at the pnode, and the rhs at the body frame.

  • a subhinge this is a 6x6 phi matrix, the lhs/rhs are the subhinge’s oframe and pframe pair.

  • a compound subhinge this is the 6x(nbodies*(6+nU)) E_Phi_G matrix, the lhs is at the physical parent, and the rhs at the embedded bodies.

Returns:

the Phi() matrix

virtual km::Mat _pframe2otherPhi(const kf::Frame &other) const override#

Return the pframe to other frame Phi() matrix for this CoordBase.

For

  • a flex body this is a (nU+6)x6 phi matrix - the lhs is at the body frame, and the rhs at the other frame.

  • a subhinge this is a 6x6 matrix - the lhs is the pframe, and the rhs at the other frame.

  • a compound subhinge this is the (nbodies*(6+nU))x6 matrix, the lhs is at the embedded body frames, and the rhs at the other frame.

Parameters:

other – the other to frame

Returns:

the Phi() matrix

kc::ks_ptr<PhysicalSubhinge> _getUpstreamSubhinge() const#

Return the previous inboard subhinge to this one.

Returns:

the upstream subhinge

virtual km::Mat getUpsilonMatrix() override#

The Upsilon at the pframe (after crossing the ATBI dofs). For a subhinge, pframe is the regular subhinge pframe, and for a flex body it is the body frame. For a subhinge, this is a nU size square matrix, while for a flex body it is a (nU+6) size square matrix.

Returns:

The ATBI Upsilon matrix value for this subhinge.

virtual kc::ks_ptr<PhysicalSubhingeParams> _getParams() const = 0#

Get params for the subhinge.

Returns:

the params

virtual void _fillCoordParams(PhysicalSubhingeParams &params) const = 0#

Set the coordinate params for the subhinge.

Parameters:

params – the input params

virtual void _setParams(const PhysicalSubhingeParams &params) = 0#

Set params for the subhinge.

Parameters:

params – the params

virtual void _setReversedParams(const PhysicalSubhingeParams &params) = 0#

Set params from a reversed version of this subhinge.

Parameters:

params – the params

virtual km::Mat66 _computeATBIMatrices(const km::Mat66 &P) = 0#

Data cache callback to compute ATBI matrices.

Parameters:

P – the input ATBI P matrix

Returns:

the updated ATBI P matrix

virtual km::SpatialVector _computeATBIFilterVectors(const km::SpatialVector &z) = 0#

Data cache callback to compute ATBI filter vectors.

Parameters:

z – the input ATBI filter z vector

Returns:

the updated ATBI filter z vector

virtual km::SpatialVector _computeATBISmootherVectors(const km::SpatialVector &alpha) = 0#

Data cache callback to compute ATBI smoother vectors.

Parameters:

alpha – the input spatial acceleration

Returns:

the output spatial acceleration

virtual km::Mat66 _computeUpsilonMatrices(const km::Mat66 &upsilon_plus_oframe) = 0#

Propagate the UpsilonPlus from the oframe to the pframe.

Parameters:

upsilon_plus_oframe – the input Upsilon matrix

Returns:

the updated Upsilon matrix

virtual void _computeInvDynGenForce(const km::SpatialVector &pnode_invdyn_f) = 0#

Data cache callback to compute the subhinge’s generalized force value for inverse dynamics.

Parameters:

pnode_invdyn_f – the input spatial force

km::SpatialVector _coriolisAccel() const#

Return the Coriolis acceleration “a” that factors into the recursive acceleration propagation across the subhinge.

This assumes that we are combining the oframe observed acceleration at the oframe with oframe observed subhinge relative spatial accel to compute the pframe observed pframe acceleration.

Returns:

the Coriolis spatial acceleration vector

PhysicalSubhinge(kc::ks_ptr<kf::Frame> oframe, kc::ks_ptr<kf::Frame> pframe, std::string_view name, kc::ks_ptr<FramePairHinge> hge)#

Constructs a PhysicalSubhinge.

Parameters:
  • oframe – the oframe frame

  • pframe – the pframe frame

  • name – the subhinge name

  • hge – the parent hinge

Protected Attributes

kc::ks_ptr<kf::OrientedChainedFrameToFrame> _oframe2pnode_f2f = nullptr#

the f2f from this subhinge’s oframe to the child body’s pnode

kc::ks_ptr<kf::OrientedChainedFrameToFrame> _newtonian2oframe_f2f = nullptr#

the frame to frame from the newtonian frame to the oframe

kc::ks_ptr<kf::OrientedChainedFrameToFrame> _newtonian2pframe_f2f = nullptr#

the frame to frame from the newtonian frame to the pframe

km::Mat66 _pframe_Upsilon#

the Upsilon value at the subhinge in the pframe

size_t _index = std::numeric_limits<std::size_t>::max()#

the slot index of the subhinge in the parent hinge’s subhinge list

struct PhysicalSubhingeParams#

Base class for physical subhinges that is specialized for each subhinge type. This is handy for creating new subhinges with matching params from existing subhinges (e.g., when introducing cut-joints).

Subclassed by Karana::Dynamics::Physical1DofSubhinge::PhysicalSubhingeParams, Karana::Dynamics::SphericalSubhinge::PhysicalSubhingeParams

Public Functions

PhysicalSubhingeParams() = default#
inline PhysicalSubhingeParams(const PhysicalSubhinge::PhysicalSubhingeParams &p)#

Copy constructor.

Parameters:

p – the other params

inline PhysicalSubhingeParams &operator=(const PhysicalSubhinge::PhysicalSubhingeParams &p)#

Assignment operator.

Parameters:

p – the other params

Returns:

the updated params

Public Members

km::Vec Q#

The Q generalized coordinates.

km::Vec U#

The U generalized velocity coordinates

km::Vec Udot#

The Udot generalized acceleration coordinates.

km::Vec T#

The T generalized force values.

bool prescribed = false#

The prescribed motion setting.