Template Class PhysicalSubhinge_T#

Nested Relationships#

Nested Types#

Inheritance Relationships#

Base Type#

Class Documentation#

template<int NQ, int NU>
class PhysicalSubhinge_T : public Karana::Dynamics::PhysicalSubhinge#

Represents the template class for fixed-size physical subhinges.

See Subhinges section for more information on physical subhinges.

Public Functions

virtual ~PhysicalSubhinge_T()#

Destrutor.

virtual km::Mat getATBIMatPsi() const override#

Get the ATBI matrix psi value.

Returns:

The ATBI matrix psi value.

virtual km::Mat getATBID() const override#
virtual km::Mat getATBIDinv() const override#
virtual km::Mat getATBIG() const override#

The ATBI G matrix at the pframe. For a subhinge, pframe is the regular subhinge pframe, and for a flex body it is the body frame. This is different from _atbi_mats.G.

virtual km::Mat getATBITauper() const override#

The ATBI tauper matrix at the pframe. For a subhinge, pframe is the regular subhinge pframe, and for a flex body it is the body frame. This is different from _atbi_mats.tauper.

virtual km::Mat pframeCoordMapMatrix() const override#

The coord map matrix with the lhs in the pframe. 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 (6,nU) size matrix, while for a flex body its size is (nU+6, nU).

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

Set the Udot acceleration coordinates.

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

Parameters:

val – Array of values.

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

Set the T generalized forces.

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

Parameters:

val – Array of values.

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

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

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

Return the time derivative of the Jacobian matrix for the target Karana::Frame::Frame.

For this coordinates provider, return the 6xnU Jacobian matrix time derivative for the target Karana::Frame::Frame. If oriented is false, the return value is negated.

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

See also

jacobian()

Parameters:
  • Frame – the target frame

  • bool – the orientation of the coordinates provider

Returns:

the Jacobian matrix time derivative

inline virtual const km::Mat atbiCoordMapMatrix() const override#

Return the coordinate map matrix to be used for ATBI computations.

Returns:

coordinate map matrix

inline virtual const km::Mat oframeCoordMapMatrix() const override#

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 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 const std::string &typeString() const noexcept override#

Returns the type string of LockingBase.

Returns:

The type string.

virtual std::string dumpString(const std::string &prefix, const kc::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.

inline void dump(const std::string &prefix = "", const kc::Base::dumpOptions *options = nullptr) const#

Protected Types

using body_6_NU_Mat = std::conditional_t<NU == 1, Eigen::Vector<double, 6>, Eigen::Matrix<double, 6, NU, Eigen::RowMajor>>#

Type for a matrix that is 6 x NU. Becomes a vector if NU is 1.

Protected Functions

PhysicalSubhinge_T(kc::ks_ptr<kf::Frame> oframe, kc::ks_ptr<kf::Frame> pframe, const std::string &name, kc::ks_ptr<FramePairHinge> hge, size_t nQ, size_t nU)#
virtual km::Mat66 _computeATBIMatrices(const km::Mat66 &P) override#
virtual km::SpatialVector _computeATBIFilterVectors(const km::SpatialVector &z) override#
virtual km::SpatialVector _computeATBISmootherVectors(const km::SpatialVector &alpha) override#
virtual km::Mat66 _computeUpsilonMatrices(const km::Mat66 &UpsilonPlus_oframe) override#

Propagate the UpsilonPlus from the oframe to the pframe

void _computeATBICoordMapMatrix(body_6_NU_Mat &val) const#

Callback to compute the pframe representation of the joint map matrix is used for ATBI computations

inline const body_6_NU_Mat &_atbiCoordMapMatrix() const#
inline const body_6_NU_Mat &_oframeCoordMapMatrix() const#
virtual void _computeInvDynGenForce(const km::SpatialVector &pnode_invdyn_f) override#

Compute the subhinge’s generalized force value for inverse dynamics

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 &val) 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 &val) override#

Compute the spatial acceleration between the oframe and pframe.

This the relSpAccel data cache callback.

Returns:

The computed spatial acceleration.

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

Get/set params for a subhinge.

virtual void _fillCoordParams(PhysicalSubhingeParams &params) const override#
virtual void _setParams(const PhysicalSubhingeParams &params) override#

apply the params from the twin subhinge to this subhinge

virtual void _setReversedParams(const PhysicalSubhingeParams &params) override#

apply the params from the original subhinge to the reversed version of this subhinge

Protected Attributes

kc::ks_ptr<kc::DataCache<body_6_NU_Mat>> _atbi_coord_map_matrix_cache = nullptr#

the 6xNU pframe joint map matrix.

kc::ks_ptr<kc::DataCache<body_6_NU_Mat>> _oframe_coord_map_matrix_cache = nullptr#

the 6xNU oframe joint map matrix data cache

struct ATBIFilterVectors : public Karana::Dynamics::CoordBase::ATBIFilterVectors#

Overall struct for ATBI dynamics filter vector quantities for an articulation subhinge which includes the fixed and subhinge dof size matrices.

Public Functions

inline void resize(size_t nU)#

Public Members

km::SpatialVector z#

the z ATBI spatial vector for the subhinge on the pframe side of the subhinge and represented in pframe

km::SpatialVector zplus#

the zplus vector after crossing the subhinge about and expressed in the subhinge’s oframe.

km::Vec epsilon#

Residual hinge force (nU)

eps = T - H * (zR + PR*a)

km::Vec nu#

Residual hinge acceleration (nU)

nu = Dinv * eps

struct ATBIMatrices : public Karana::Dynamics::CoordBase::ATBIMatrices#

Overall struct for ATBI dynamics matrix quantities for an articulation subhinge which includes the fixed and subhinge dof size matrices.

Public Members

km::Mat66 P#

The 6x6 PR articulated body inertia for the subhinge on the pframe/outboard side of the subhinge. The value is about and expressed in the pframe frame for the subhinge.

km::Mat66 Pplus#

the Pplus matrix after crossing the deformation dofs, about and expressed in the oframe frame for the subhinge.

Eigen::Matrix<double, NU, 6, Eigen::RowMajor> HP#

HP = H*P (nU x body_nU)

For a subhinge the lhs is in the pframe, while it in the pnode deformed translational frame for a flex body.

Eigen::Matrix<double, NU, NU, Eigen::RowMajor> D#

D = H*P*HT (nU x nU)

Eigen::Matrix<double, NU, NU, Eigen::RowMajor> Dinv#

Dinv = inverse(D) (nU x nU)

body_6_NU_Mat G#

G = P*H*Dinv (body_nU x nU)

For a subhinge the lhs is in the pframe, while it in the pnode deformed translational frame for a flex body.

km::Mat66 tauper#

tauper = I - GH (body_nU x body_nU)

For a subhinge the lhs is in the pframe, while it in the pnode deformed translational frame for a flex body.

km::Mat66 psi#

psi = phi * tauper (body_nU x body_nU)

For a subhinge, the left is in the oframe, right in the pframe. For a flex body, the lefts is in the pnode frame and the right in the body frame.