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 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
-
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
-
inline const kc::ks_ptr<kc::DataCache<HingeOnodeATBIMatrices>> &_atbiMatrixCache() const#
Return the ATBI matrix cache.
- Returns:
the ATBI matrix cache
-
const HingeOnodeATBIMatrices &_atbiMatrices(bool use_cache) const#
Update and return the ATBI matrices.
- Parameters:
use_cache – if true, return data cache data, else the instance member
- Returns:
the ATBI matrices
-
inline const kc::ks_ptr<kc::DataCache<HingeOnodeATBIFilterVectors>> &_atbiFilterCache() const#
Return the ATBI filter cache.
- Returns:
the ATBI filter cache
-
const HingeOnodeATBIFilterVectors &_atbiFilterVectors(bool use_cache) const#
Update and return the ATBI filter vectors.
- Parameters:
use_cache – if true, return data cache data, else the instance member
- 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
-
const HingeOnodeATBISmootherVectors &_atbiSmootherVectors(bool use_cache) const#
Update and return the ATBI smoother vectors.
- Parameters:
use_cache – if true, return data cache data, else the instance member
- Returns:
the ATBI smoother vectors
-
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
-
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, bool use_cache)#
Data cache callback to update the ATBI matrix values.
- Parameters:
use_cache – if true, use data caches, else the instance member
val – the data buffer for the computed value
-
void _computeATBIFilterVectors(HingeOnodeATBIFilterVectors &val, bool use_cache)#
Data cache callback to update the ATBI filter values.
- Parameters:
use_cache – if true, use data caches, else the instance member
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, bool use_cache) const#
Compute the ATBI based inter-body force for the hinge at the onode represented in the onode frame.
- Parameters:
use_cache – if true, use data caches, else the instance member
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::OrientedChainedFrameToFrame> _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
-
HingeOnodeATBIMatrices _atbi_matrices#
for working directly without data caches data for ATBI filter matrices - alternative to data cache buffer
-
HingeOnodeATBIFilterVectors _atbi_filter#
data for ATBI filter vectors - alternative to data cache buffer
-
HingeOnodeATBISmootherVectors _atbi_smoother#
data for ATBI smoother vectors - alternative to data cache buffer
Friends
- friend class KaranaTest::Dynamics::SOADynTesting
-
HingeOnode(std::string_view name, kc::ks_ptr<PhysicalBody> bd)#