Class ComputedTorque#
Defined in File ComputedTorque.h
Inheritance Relationships#
Base Type#
public Karana::Models::KModel< ComputedTorque >(Template Class KModel)
Class Documentation#
-
class ComputedTorque : public Karana::Models::KModel<ComputedTorque>#
Limits the generalized force that can be applied to a subhinge.
Public Functions
-
ComputedTorque(std::string_view name, const kc::ks_ptr<kd::StatePropagator> &sp, const kc::ks_ptr<kd::SubTree> &st, const SetAccelFn &set_accels_fn)#
Constructor.
The user-supplied set_accels_fn should set the accelerations on the provided SubGraph. Then, the model uses Algorithms.evalComputedTorque to calculate the corresponding torques and apply them to the SubTree.
- Parameters:
name – The name of the model.
sp – The StatePropagator to register this model with.
st – The SubTree to apply the torques to.
set_accels_fn – The function that sets the accelerations for the computed torque to compute torques for.
-
void preDeriv(const km::Ktime &t, const km::Vec &x)#
Calculate and apply the torques.
- Parameters:
t – Current time. This is passed to the user-supplied set_accels_fn.
x – Current state. This is passed to the user-supplied set_accels_fn.
-
~ComputedTorque()#
Destructor for ComputedTorque.
Public Static Functions
-
static kc::ks_ptr<ComputedTorque> create(std::string_view name, const kc::ks_ptr<kd::StatePropagator> &sp, const kc::ks_ptr<kd::SubTree> &st, const SetAccelFn &set_accels_fn)#
Constructor.
The user-supplied set_accels_fn should set the accelerations on the provided SubGraph. Then, the model uses Algorithms.evalComputedTorque to calculate the corresponding torques and apply them to the SubTree.
- Parameters:
name – The name of the model.
sp – The StatePropagator to register this model with.
st – The SubTree to apply the torques to.
set_accels_fn – The function that sets the accelerations for the computed torque to compute torques for.
- Returns:
A ks_ptr to the newly created instance of the ComputedTorque model.
-
ComputedTorque(std::string_view name, const kc::ks_ptr<kd::StatePropagator> &sp, const kc::ks_ptr<kd::SubTree> &st, const SetAccelFn &set_accels_fn)#