Class Physical1DofSubhinge#

Nested Relationships#

Nested Types#

Inheritance Relationships#

Base Type#

Derived Types#

Class Documentation#

class Physical1DofSubhinge : public Karana::Dynamics::PhysicalSubhinge_T<1, 1>#

Base class for 1 degree of freedom physical subhinges.

See Subhinges section for more information on physical subhinges.

Subclassed by Karana::Dynamics::LinearSubhinge, Karana::Dynamics::PinSubhinge, Karana::Dynamics::ScrewSubhinge

Public Functions

Physical1DofSubhinge(kc::ks_ptr<kf::Frame> oframe, kc::ks_ptr<kf::Frame> pframe, std::string_view name, kc::ks_ptr<FramePairHinge> hge)#

Constructs a Physical1DofSubhinge.

Parameters:
  • oframe – the oframe frame

  • pframe – the pframe frame

  • name – the name for the subhinge

  • hge – the parent hinge

inline ~Physical1DofSubhinge()#
virtual void setUnitAxis(const km::Vec3 &axis)#

Set the unit axis for the pin hinge.

Parameters:

axis – The unit axis for the pin hinge.

inline const km::Vec3 &getUnitAxis() const#

Get the unit axis for the pin hinge.

Returns:

The unit axis for the pin hinge.

void setJointLimits(const Karana::Math::Vec &limits)#

Set the lower/upper pair of joint limit values for the 1 dof subhinge.

Parameters:

limits – the lower and upper limit values

inline km::Vec getJointLimits() const#

Return the lower/upper pair of joint limit values for the 1 dof subhinge.

Returns:

array with the lower and upper joint limit values

void setGearRatio(double gear_ratio)#

Set the gear ratio for the 1 dof subhinge.

Parameters:

gear_ratio – the gear ratio

inline double getGearRatio() const#

Return the gear ratio for the 1 dof subhinge.

Returns:

the gear ratio value

virtual bool isReady() const override#

Checks is the params for the object have been initialized.

Returns:

True if the params have set up.

Protected Functions

virtual kc::ks_ptr<PhysicalSubhinge::PhysicalSubhingeParams> _getParams() const override#

Get params for the subhinge.

Returns:

the params

virtual void _setParams(const PhysicalSubhinge::PhysicalSubhingeParams &params) override#

Apply the params from the twin subhinge to this subhinge.

Parameters:

params – the input parameters

Protected Attributes

km::Vec _joint_limits = km::Vec(2)#

joint limits for the subhinge, initialized by default to NaNs

double _gear_ratio = km::notReadyNaN#

gear ratio for the pin subhinge, initialized by default to a NaN

km::Vec3 _unit_axis = {0, 0, 0}#

axis of rotation in pframe

struct PhysicalSubhingeParams : public Karana::Dynamics::PhysicalSubhinge::PhysicalSubhingeParams#

Specialization of param class for this subhinge type.

Subclassed by Karana::Dynamics::ScrewSubhinge::PhysicalSubhingeParams

Public Functions

PhysicalSubhingeParams() = default#
inline PhysicalSubhingeParams &operator=(const PhysicalSubhinge::PhysicalSubhingeParams *p)#

Assignment operator.

Parameters:

p – the other params

Returns:

the updated params

Public Members

km::Vec3 unit_axis#

the subhinge unit axis