Class CELoopKinematicsPlanar4Bar#
Defined in File CELoopKinematics.h
Inheritance Relationships#
Base Type#
public Karana::Dynamics::CELoopKinematicsBase(Class CELoopKinematicsBase)
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_sg – SubGraph 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_sg – SubGraph with bodies being embedded
- Returns:
a CELoopKinematicsPlanar4Bar instance
Protected Types
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
-
CELoopKinematicsPlanar4Bar(std::string_view name, kc::ks_ptr<SubGraph> bodies_sg)#