Class HingeOnode#
Defined in File HingeNode.h
Inheritance Relationships#
Base Type#
public Karana::Dynamics::HingeNode(Class HingeNode)
Class Documentation#
-
class HingeOnode : public Karana::Dynamics::HingeNode#
Represents the hinge onode class.
See Connecting bodies via hinges section for more discussion of hinge, onodes and pnodes.
This class is for onodes for physical hinges
Public Functions
-
HingeOnode(std::string_view name, kc::ks_ptr<PhysicalBody> bd)#
HingeOnode constructor.
- Parameters:
name – the onode name
bd – the parent body
-
virtual ~HingeOnode()#
HingeOnode destructor.
-
virtual std::string dumpString(std::string_view prefix, const Karana::Core::Base::DumpOptions *options) const override#
Return information about the object.
- Parameters:
prefix – A string to use as prefix for each output line
options – Struct with options to tailor the output
- Returns:
String with the information about the object.
-
virtual bool isReady() const override#
Checks is the params for the object have been initialized.
- Returns:
True if the params have set up.
-
inline const kc::ks_ptr<kc::DataCache<HingeOnodeATBIMatrices>> &atbiMatrixCache() const#
Return the ATBI matrix cache.
- Returns:
the ATBI matrix cache
-
inline const HingeOnodeATBIMatrices &atbiMatrices() const#
Update and return the ATBI matrices.
- Returns:
the ATBI matrices
-
inline const kc::ks_ptr<kc::DataCache<HingeOnodeATBIFilterVectors>> &atbiFilterCache() const#
Return the ATBI filter cache.
- Returns:
the ATBI filter cache
-
inline const HingeOnodeATBIFilterVectors &atbiFilterVectors() const#
Update and return the ATBI filter vectors.
- Returns:
the ATBI filter vectors
-
inline const kc::ks_ptr<kc::DataCache<HingeOnodeATBISmootherVectors>> atbiSmootherCache() const#
Return the ATBI smoother cache.
- Returns:
the ATBI smoother cache
-
inline const HingeOnodeATBISmootherVectors &atbiSmootherVectors() const#
Update and return the ATBI smoother vectors.
- Returns:
the ATBI smoother vectors
-
inline const km::SpatialVector &getInterBodyForceTreeFwdDyn() const#
Return the inter-body spatial force at the hinge.
While the spatial force is at the onode, and in the onode frame, its sign is that for the version applying on the outboard (the pnode) body. This values should be negated to get the equal and opposite spatial force on the onode’s body.
- Returns:
the inter-body spatial force
-
inline const kc::ks_ptr<kc::DataCache<HingeOnodeUpsilonMatrices>> &upsilonMatrixCache() const#
Return the OSCM Upsilon matrix cache.
- Returns:
the OSCM Upsilon matrix cache
-
inline const HingeOnodeUpsilonMatrices &upsilonMatrices() const#
Update and return the OSCM Upsilon matrices.
- Returns:
the OSCM Upsilon matrices
-
inline const kc::ks_ptr<kc::DataCache<HingeOnodeInvDynVectors>> inverseDynamicsCache() const#
Return the inverse dynamics cache.
- Returns:
the inverse dynamics cache
-
inline const HingeOnodeInvDynVectors &inverseDynamicsVectors() const#
Update and return the inverse dynamics vectors.
- Returns:
the inverse dynamics vectors
-
km::SpatialVector getInterBodyForceTAFwdDyn()#
Return the interbody force at the onode for Tree Augmented (TA) dynamics with constraints.
This method returns the interbody force at the onode when doing TA dynamics for the system in the presence of loop constraints. This is only meant to be used for regular hinges (not cut-joint hinges)
- Returns:
the inter-body spatial force
Protected Functions
-
void _saveExtraATBIVariables()#
Helper method in TA dynamics with loop constraints to save the zrplus and alpha_plus values from the “free” dynamics solution for possible use in interbody force computations where we need to combine these values with those from the correction step.
-
void _computeInvDynForces(HingeOnodeInvDynVectors &val)#
Data cache callback to update the overall inverse dynamics forces.
- Parameters:
val – the data buffer for the computed value
-
void _computeATBIMatrices(HingeOnodeATBIMatrices &val)#
Data cache callback to update the ATBI matrix values.
- Parameters:
val – the data buffer for the computed value
-
void _computeATBIFilterVectors(HingeOnodeATBIFilterVectors &val)#
Data cache callback to update the ATBI filter values.
- Parameters:
val – the data buffer for the computed value
-
void _computeATBISmootherVectors(HingeOnodeATBISmootherVectors &val, bool is_root_onode)#
Data cache callback to update the ATBI smoother values.
- Parameters:
val – the data buffer for the computed value
is_root_onode – if true, this onode is on the virtual root body
-
virtual void _computeUpsilonMatrices(HingeOnodeUpsilonMatrices &val, bool is_root_onode)#
Data cache callback to update the OSI Upsilon values.
- Parameters:
val – the data buffer for the computed value
is_root_onode – if true, this onode is on the virtual root body
-
void _computeInterBodyForceTreeFwdDyn(km::SpatialVector &val) const#
Compute the ATBI based inter-body force for the hinge at the onode represented in the onode frame.
- Parameters:
val – the data buffer for the computed value
-
void _oneTimeSetupDataCaches()#
Helper method to set up the onode’s data caches.
-
void _oneTimeTeardownDataCaches()#
Helper method to tear down the onode’s data caches.
-
void _oneTimeSetupDataCacheGatherCallbacks()#
Sets up the onode’s gather cache callbacks to depend on the child pnode’s gather data caches.
-
void _oneTimeTeardownDataCacheGatherCallbacks()#
Tears down the onode’s gather cache callbacks dependency on the child pnode’s gather data caches.
-
void _oneTimeTeardown()#
Helper method to tear down the onode.
-
void _setupDataCachesWithParentPnode()#
Called to set up a pnode’s gather data cache dependency on a onode whenever a new pnode or a new onode is created, i.e. whenever there is a new pnode/onode pairing.
-
void _teardownDataCachesWithParentPnode()#
Called to unset a pnode’s gather data cache dependency on a onode whenever a new pnode or a new onode is created, i.e. whenever there is a new pnode/onode pairing.
Protected Attributes
-
kc::ks_ptr<kf::OrientedChainedFrameToFrame> _pnode2onode_f2f = nullptr#
the oriented f2f from this onode’s parent body’s pnode to the onode
-
kc::ks_ptr<kf::FrameToFrame> _body2onode_f2f = nullptr#
the oriented f2f from this onode’s parent body’s frame to the onode
-
HingeOnodeATBIDataCaches _atbi_data_caches#
the ATBI data caches
-
kc::ks_ptr<kc::DataCache<HingeOnodeInvDynVectors>> _invdyn_data_cache = nullptr#
the inverse dynamics data cache
-
HingeOnode(std::string_view name, kc::ks_ptr<PhysicalBody> bd)#