Class CECompoundBody#

Inheritance Relationships#

Base Type#

Derived Types#

Class Documentation#

class CECompoundBody : public Karana::Dynamics::CompoundBody#

Represents a compound body.

This class is for compound bodies representing a subtree of bodies.

Subclassed by Karana::Dynamics::GearedCompoundBody, Karana::Dynamics::LoopsCompoundBody

Public Functions

CECompoundBody(std::string_view name, kc::ks_ptr<SubGraph> parent_subtree, kc::ks_ptr<SubGraph> component_bodies, size_t indep_n_u)#

CECompoundBody constructor. The constructor is not meant to be called directly. Please use the create(…) method instead to create an instance one of the classes derived from this.

Parameters:
virtual ~CECompoundBody()#

CECompoundBody destructor.

inline virtual std::string_view typeString() const noexcept override#

Returns the type string.

Returns:

The type string.

Protected Functions

virtual kc::ks_ptr<CompoundSubhinge> _createSubhinge(kc::ks_ptr<CompoundHinge> hinge) override#

Create the compound subhinge

virtual void _updateDependentQ(const km::Vec &min_Q, bool global) const = 0#

Convert the input minimal independent coords Q into the full dependent Q for all the aggregated subhinges for the compound body as appropriate and set the values. Note that the constraints are at the veolocity level and not the Q level, and in some cases Q is subject to a differerent (and perhaps no) constraints, The global flag controls whether the incoming Q values are global are local chart coordinates.

Parameters:
  • min_Q – the minimal coordinates

  • global – flag whether incoming coords are local or global

virtual km::Mat _constraintX() const = 0#

Return the X matrix that maps the min independent U to the full U (independent, dependent, constraint dofs) for the compound body

Returns:

the full constraint X matrix

virtual km::Mat _matX() const#

Return the X matrix that maps the min independent U to the dependendent U (without constraint dofs) for the compound body

Returns:

the non-constraint X matrix

virtual km::Vec _constraintXdotU(const km::Vec &U) const = 0#

Return the Xdot*U product vector where Xdot is the time derivative of the X constraint matrix

Parameters:

the – input U vector

Returns:

the Xdot*U product

Protected Attributes

std::vector<unsigned int> _indep_indices_U#

Return the costtraint X matrix pseudo inverse that maps the full U for the compound body to the min indepenent U

Return:

pseudo inverse of the constraint X matrix indices of all independent coords among the multibody level coordinates

std::vector<unsigned int> _indep_indices_Q#
std::vector<std::pair<kc::ks_ptr<PhysicalSubhinge>, size_t>> _indep_cbs_U#

List contains the physical subhinge+offset value for each of the independent indices

std::vector<std::pair<kc::ks_ptr<PhysicalSubhinge>, size_t>> _indep_cbs_Q#