Class PhysicalHinge#
Defined in File PhysicalHinge.h
Inheritance Relationships#
Base Type#
public Karana::Dynamics::FramePairHinge(Class FramePairHinge)
Class Documentation#
-
class PhysicalHinge : public Karana::Dynamics::FramePairHinge#
Represents the class for physical articulation hinges.
This class is the container for physical subhinges that define articulation for physical bodies. See Connecting bodies via hinges section for more information on physical hinges.
Public Functions
-
virtual ~PhysicalHinge()#
Hinge destructor.
-
PhysicalHinge(PhysicalBody &parent, PhysicalBody &child, std::string_view name, HingeBase::HingeType htype, const std::vector<SubhingeBase::SubhingeType> &subhinge_types = std::vector<SubhingeBase::SubhingeType>())#
Hinge Constructor.
- Parameters:
parent – The parent body
child – The child body
name – The string name for the hinge
htype – The hinge type
subhinge_types – The list of subhinge types for a custom hinge type
-
inline virtual std::string_view typeString() const noexcept override#
Returns the type string of the HingeBase.
- Returns:
The type string.
-
const kc::ks_ptr<HingePnode> &pnode() const#
Return the pnode for the hinge See.
Connecting bodies via hinges section for more information on onodes and pnodes.
- Returns:
the HingePnode instance
-
const kc::ks_ptr<HingeOnode> &onode() const#
Return the onode for the hinge See.
Connecting bodies via hinges section for more information on onodes and pnodes.
- Returns:
the HingeOnode instance
-
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.
Public Static Functions
-
static const kc::ks_ptr<PhysicalHinge> create(PhysicalBody &parent, PhysicalBody &child, HingeBase::HingeType htype, const std::vector<SubhingeBase::SubhingeType> &subhinge_types = std::vector<SubhingeBase::SubhingeType>())#
Factory method to create a PhysicalHinge instance.
- Parameters:
parent – The parent body
child – The child body
htype – The hinge type
subhinge_types – The list of subhinge types for a custom hinge type
- Returns:
A new PhysicalHinge instance
Protected Functions
-
void _discard(kc::ks_ptr<Base> &base) override#
Discard the PhysicalHinge.
- Parameters:
base – - Pointer to the PhysicalHinge.
-
void _setupATBIDataCaches()#
Helper method to set up the ATBI data caches.
-
void _teardownATBIDataCaches()#
Helper method to tear down the ATBI data caches.
-
void _setupInvDynDataCaches()#
Helper method to set up the inverse dynamics data cache.
-
void _teardownInvDynDataCaches()#
Helper method to tear down the inverse dynamics data cache.
-
void _oneTimeTeardown()#
Helper method to tear down the hinge.
-
virtual void _changeActionT() override#
Carry out side effect of the the generalized force changing for the subhinge.
An example side effect is to mark the ATBI filter data cache for the hinge onode as not healthy for a physical hinge.
-
km::SpatialVector _acorPrime(const km::Vec &x_dot_u) const#
Compute the overall Coriolis accel term for all of the subhinges about and in the pnode frame.
This is needed for compound bodies ATBI filter step. The XdotU vector is non-null (i.e. non-zero size) only for constraint-embedding compound bodies - where the XdotU term is a contribution from the configuration dependency of the independent to dependent coordinates
- Parameters:
x_dot_u – the Xdot*U input values for the subhinges
- Returns:
the a’ Coriolis acceleration vector
-
virtual ~PhysicalHinge()#