Class CELoopKinematicsPlanar4Bar#

Inheritance Relationships#

Base Type#

Class Documentation#

class CELoopKinematicsPlanar4Bar : public Karana::Dynamics::CELoopKinematicsBase#

The analytical kinematics solver for a planar 4-bar system.

This analytical solver for a planar 4-bar linkage requires that the subgraph’s bodies be a serial chain of length 3. The cut-join loop constraint is between the third body and the first body’s parent body. All the hinges involved should be REVOLUTE with parallel rotational axes. The independent coordinate is the first body’s coordinate.

Public Functions

CELoopKinematicsPlanar4Bar(std::string_view name, kc::ks_ptr<SubGraph> bodies_sg)#

Constructor.

Constructor

Parameters:
  • name – instance name

  • bodies_sgSubGraph with the embedded bodies

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

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 velocity level and not the Q level, and in some cases Q is subject to a different (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 to indicate whether incoming coords are local or global.

virtual void computeConstraintX(km::Mat &X) const override#

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

Parameters:

X – The matrix to fill with the X matrix.

virtual void computeXdotU(km::Vec &XdotU) const override#

Return Xdot*U product of the time derivative of X constraint matrix with the U generalized velocities.

Parameters:

XdotU – the vector to fill with the compute value

Public Static Functions

static Karana::Core::ks_ptr<CELoopKinematicsPlanar4Bar> create(std::string_view name, kc::ks_ptr<SubGraph> bodies_sg)#

Constructs a CELoopKinematicsPlanar4Bar instance.

Parameters:
  • name – instance name

  • bodies_sgSubGraph with bodies being embedded

Returns:

a CELoopKinematicsPlanar4Bar instance

Protected Types

enum class AssemblyMode#

enum for the open and crossed 4-bar configurations

Values:

enumerator OPEN#
enumerator CROSSED#

Protected Functions

Eigen::Vector2d _fourbarSolveQ(double theta, AssemblyMode mode = AssemblyMode::OPEN, double eps_geom = 1e-12) const#

Helper method to solver 4-bar configuration kinematics.

Parameters:
  • theta – the independent coordinate

  • mode – the open or crossed configuration solution being requested

  • eps_geom – tolerance used for checking solution Q solution existence

Returns:

the psi and phi (M_PI minus the second and third Q values )

void _fourbarX(const km::Vec &Q, km::Vec &X, double eps_det = 1e-12) const#

Helper method to solve for the X vector.

Parameters:
  • Q – the full Q coordinates

  • X – the vector to populate with the computed values

  • eps_det – tolerance to check for singular configuration

void _fourbarXdotU(const km::Vec &Q, const km::Vec &U, km::Vec &XdotU, double eps_det = 1e-12) const#

Helper method to compute Xdot*U.

Parameters:
  • Q – the full Q coordinates

  • U – the full U velocity coordinates

  • XdotU – the vector to populate with the computed values

  • eps_det – tolerance to check for singular configuration

virtual void _discard(Karana::Core::ks_ptr<Karana::Core::Base> &base) override#

Discard the the object. Derived classes should implement this with the logic required to discard themselves if applicable.

Parameters:

base – - A pointer to the object to discard.

Protected Attributes

double _a#

first link length

double _b#

second link length

double _c#

third link length

double _d#

fourth link length