Class LoopsCompoundBody#

Inheritance Relationships#

Base Type#

Class Documentation#

class LoopsCompoundBody : public Karana::Dynamics::CECompoundBody#

Constraint embedding class for a bodies with loop constraints.

This class is embedding loop constraint for a SubGraph of bodies.

Public Functions

virtual ~LoopsCompoundBody()#

Destructor.

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

Returns the type string.

Returns:

The type string.

LoopsCompoundBody(std::string_view name, kc::ks_ptr<SubGraph> parent_subtree, kc::ks_ptr<SubGraph> bodies_tree, const std::vector<unsigned int> &indep_indices_U, const std::vector<unsigned int> &indep_indices_Q = {})#

Constructs a LoopsCompoundBody with list of independent bodies.

Parameters:
  • name – instance name

  • parent_subtree – the parent SubGraph this the body will belong to

  • component_bodiesSubGraph with bodies being embedded

  • indep_indices_U – the list of independent U coordinate indices

  • indep_indices_Q – the list of independent Q coordinate indices

LoopsCompoundBody(std::string_view name, kc::ks_ptr<SubGraph> parent_subtree, kc::ks_ptr<SubGraph> bodies_tree, const std::vector<kc::ks_ptr<PhysicalBody>> &indep_bodies)#

Constructs a LoopsCompoundBody with list of independent coord indices.

Parameters:
  • name – instance name

  • parent_subtree – the parent SubGraph this the body will belong to

  • component_bodiesSubGraph with bodies being embedded

  • indep_bodies – the bodies whose coordinates should be independent

Public Static Functions

static kc::ks_ptr<LoopsCompoundBody> create(std::string_view name, kc::ks_ptr<SubGraph> parent_subtree, kc::ks_ptr<SubGraph> component_bodies, const std::vector<kc::ks_ptr<PhysicalBody>> &indep_bodies)#

Constructs a LoopsCompoundBody with list of independent bodies.

Parameters:
  • name – instance name

  • parent_subtree – the parent SubGraph this the body will belong to

  • component_bodiesSubGraph with bodies being embedded

  • indep_bodies – the bodies whose coordinates should be independent

Returns:

a LoopsCompoundBody instance

static kc::ks_ptr<LoopsCompoundBody> create(std::string_view name, kc::ks_ptr<SubGraph> parent_subtree, kc::ks_ptr<SubGraph> component_bodies, const std::vector<unsigned int> &indep_indices_U, const std::vector<unsigned int> &indep_indices_Q = {})#

Constructs a LoopsCompoundBody with list of independent coord indices.

The option of specifying independent coordinates at the indices level gives finer-grain control than the other create() method. Also, this method allows specifying different values for the independent Q and U coordinates. The U coordinates are used if the Q list is empty.

Parameters:
  • name – instance name

  • parent_subtree – the parent SubGraph this the body will belong to

  • component_bodiesSubGraph with bodies being embedded

  • indep_indices_U – the list of independent U coordinate indices

  • indep_indices_Q – the list of independent Q coordinate indices

Returns:

a LoopsCompoundBody instance

Protected Functions

virtual void _updateDependentQ(const km::Vec &min_q, bool global) const override#

Convert the input minimal coords Q into the full dependent Q for all the aggregated subhinges for the compound body

virtual void _computeConstraintX(km::Mat &val) const override#

Return the X matrix that maps the min independent U to the full dependent U for the compound body

virtual void _computeXdotU(km::Vec &val) const override#
void _discard(kc::ks_ptr<Base> &base) override#

Return the X matrix pseudo inverse that maps the full dependent U for the compound body to the min independent U

Protected Attributes

kc::ks_ptr<ConstraintKinematicsSolver> _cks = nullptr#

the CK solver used to solve for the dependent coordinates

std::vector<unsigned int> _rows_Y#
std::vector<unsigned int> _rows_Ydot#
std::vector<unsigned int> _dep_indices_U#

indices of all dependent coords among the _bodies_tree coordinates