Template Class PhysicalSubhinge_T#
Defined in File PhysicalSubhinge.h
Nested Relationships#
Nested Types#
Inheritance Relationships#
Base Type#
public Karana::Dynamics::PhysicalSubhinge(Class PhysicalSubhinge)
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()#
Destructor.
-
virtual km::Mat getATBIMatPsi() const override#
Get the ATBI matrix psi value.
- Returns:
The ATBI matrix psi value.
-
virtual km::Mat getATBID() const override#
Get the ATBI D matrix value.
- Returns:
The ATBI D matrix value for this subhinge.
-
virtual km::Mat getATBIDinv() const override#
Get the ATBI D inverse matrix value.
- Returns:
The ATBI D inverse matrix value for this subhinge.
-
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.
- Returns:
The ATBI G matrix value for this subhinge.
-
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.
- Returns:
The ATBI tauper matrix value for this subhinge.
-
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).
- Returns:
The pframe referenced subhinge coordinate map matrix value for this subhinge.
-
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) 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) 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 Coordinate Frames section for more information on frames, and Jacobians section for more on Jacobians.
See also
- Parameters:
target – Frame the target frame
oriented – 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 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
-
virtual std::string dumpString(std::string_view 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.
-
void dump(std::string_view prefix = "", const DumpOptions *options = nullptr) const#
Print dumpString on std::cout.
- Parameters:
prefix – A string to use as prefix for each output line
options – Struct with options to tailor the output
Protected Types
Protected Functions
-
PhysicalSubhinge_T(kc::ks_ptr<kf::Frame> oframe, kc::ks_ptr<kf::Frame> pframe, std::string_view name, kc::ks_ptr<FramePairHinge> hge, size_t n_q, size_t n_u)#
Constructor.
- Parameters:
oframe – the oframe frame
pframe – the pframe frame
name – the subhinge name
hge – the parent hinge
n_q – the number of Q coordinates
n_u – the number of U coordinates
-
virtual km::Mat66 _computeATBIMatrices(const km::Mat66 &P) override#
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) override#
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) override#
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) override#
Propagate the UpsilonPlus from the oframe to the pframe.
- Parameters:
upsilon_plus_oframe – the input Upsilon matrix
- Returns:
the updated Upsilon matrix
-
void _computeATBICoordMapMatrix(body_6_NU_Mat &val) const#
Data cache callback to compute the pframe representation of the joint map matrix.
- Parameters:
val – the data buffer for the computed value
-
inline const body_6_NU_Mat &_atbiCoordMapMatrix() const#
Helper method to compute the joint map matrix is used for ATBI computations.
- Returns:
the coord map matrix
-
inline const body_6_NU_Mat &_oframeCoordMapMatrix() const#
Helper method to compute the joint map matrix represented in the oframe.
- Returns:
the coord map matrix
-
virtual void _computeInvDynGenForce(const km::SpatialVector &pnode_invdyn_f) override#
Data cache callback to compute the subhinge’s generalized force value for inverse dynamics.
- Parameters:
pnode_invdyn_f – the input spatial force
-
virtual void _computeTransform(km::HomTran&) override#
Compute the transformation between the oframe and pframe.
This the relTransform data cache callback.
- Parameters:
T – The buffer to place the computed homogeneous transformation in.
-
virtual void _computeVelocity(km::SpatialVector &val) override#
Compute the spatial velocity between the oframe and pframe.
This the relSpVel data cache callback.
- Parameters:
V – The buffer to put the computed spatial velocity in.
-
virtual void _computeAccel(km::SpatialVector &val) override#
Compute the spatial acceleration between the oframe and pframe.
This the relSpAccel data cache callback.
- Parameters:
a – The buffer to put the computed spatial acceleration in.
-
virtual kc::ks_ptr<PhysicalSubhingeParams> _getParams() const override = 0#
Get params for the subhinge.
- Returns:
the params
-
virtual void _fillCoordParams(PhysicalSubhingeParams ¶ms) const override#
Set the coordinate params for the subhinge.
- Parameters:
params – the input params
-
virtual void _setParams(const PhysicalSubhingeParams ¶ms) override#
Apply the params from the twin subhinge to this subhinge.
- Parameters:
params – the input parameters
-
virtual void _setReversedParams(const PhysicalSubhingeParams ¶ms) override#
Apply the params from the original subhinge to the reversed version of this subhinge.
- Parameters:
params – the input parameters
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 n_u)#
Resize the ATBI vectors.
- Parameters:
n_u – the number of U generalized velocity coordinates
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
-
inline void resize(size_t n_u)#
-
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.
-
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.
-
km::Mat66 P#
-
virtual ~PhysicalSubhinge_T()#