Class LoopConstraintConVel#
Defined in File LoopConstraintBase.h
Inheritance Relationships#
Base Type#
public Karana::Dynamics::LoopConstraintBase(Class LoopConstraintBase)
Class Documentation#
-
class LoopConstraintConVel : public Karana::Dynamics::LoopConstraintBase#
Class for constant velocity loop constraints.
Thie constraint requires that a component of the relative angular/linear velocity of a pair of body constraint nodes projected onto a unit axis be equal. This constraint only applies at the velocity and acceleration levels, and not the positional level.
See the Convel loop-constraints section for more discussion on convel loop constraints.
Public Functions
-
LoopConstraintConVel(kc::ks_ptr<Multibody> &mb, kc::ks_ptr<kf::FrameToFrame> constraint_f2f, std::string_view name)#
Constructor.
- Parameters:
mb – The Multibody instance
constraint_f2f – the Karana::Frame::FrameToFrame defining the constrained Frame pair
name – the name for the loop constraint instance
-
inline virtual std::string_view typeString() const noexcept override#
Returns the type string of Base.
- Returns:
The type string.
-
inline virtual bool constrainsQ() const override#
convel constraints only impact velocities
-
virtual size_t nResiduals() const override#
Return the size of residuals for the constraint.
- Returns:
the residuals size for the constraint
-
virtual km::Vec poseError() const override#
Return the 6 size pose residual term for the constraint.
Used for computing the pose configuration kinematics
- Returns:
The pose eror
-
void setInput(double vel, double accel)#
Set the velocity and acceleration inputs for the convel constraint.
The input is used to set the difference between the source and target component velocity and acceleration component values.
- Parameters:
vel – The input velocity
accel – The input accel
-
void setUnitAxis(const km::Vec &axis, bool is_rotational)#
Set the unit axis long which the convel constraint applies.
- Parameters:
axis – The unit axis vector in the source node frame
is_rotational – If true, the constraint is assumed to on relative angular velocity, else translational
-
const km::Vec3 &getUnitAxis() const#
Get the unit axis to which the convel constraint applies.
- Returns:
The unit axis vector in the source node frame
-
bool isRotational() const#
Get whether the constraint is on relative angular velocity.
- Returns:
If the constraint is angular, else linear
-
virtual bool isFinalized() const override#
Checks is the params for the object have been initialized.
- Returns:
True if the params have set up.
-
virtual km::Vec velError() const override#
Return the current constraint spatial velocity error.
- Returns:
the spatial velocity error as a 6-vector
-
virtual km::Vec accelError() const override#
Return the current constraint spatial acceleration error.
- Returns:
the acceleration error
Public Static Functions
-
static const kc::ks_ptr<LoopConstraintConVel> create(kc::ks_ptr<Multibody> &mb, kc::ks_ptr<kf::FrameToFrame> constraint_f_to_f, std::string_view name)#
Factory method for creating a LoopConstraintConVel instance.
- Parameters:
mb – The Multibody instance
constraint_f_to_f – the Karana::Frame::FrameToFrame defining the constrained Frame pair
name – the name for the loop constraint instance
- Returns:
a LoopConstraintHinge instance
Protected Functions
-
virtual void _computeQMats(QMats &val) override#
-
virtual km::Vec _accelResidual() const override#
Return the (6-nU) size accel residual term for the constraint.
Used for computing the lambda (Lagrnage multiplier) terms for the TA dynamics correction step
- Returns:
The acceleraton residual eror
-
LoopConstraintConVel(kc::ks_ptr<Multibody> &mb, kc::ks_ptr<kf::FrameToFrame> constraint_f2f, std::string_view name)#