OpenSim::CustomActuator Class Reference

This is an abstract subclass of Actuator which allows you to define new Actuator types by overriding methods, rather than having to create a new SimTK::Force subclass. More...

#include <CustomActuator.h>

Inheritance diagram for OpenSim::CustomActuator:
OpenSim::Actuator OpenSim::Force OpenSim::ModelComponent OpenSim::Object OpenSim::CoordinateActuator OpenSim::LinearActuator OpenSim::Muscle OpenSim::PointActuator OpenSim::TorqueActuator OpenSim::PassiveJointTorque OpenSim::ContDerivMuscle OpenSim::Delp1990Muscle OpenSim::Schutte1993Muscle OpenSim::Thelen2003Muscle

List of all members.

Public Member Functions

 CustomActuator ()
 CustomActuator (const CustomActuator &aActuator)
 Copy constructor.
 OPENSIM_DECLARE_DERIVED (CustomActuator, Actuator)
void createSystem (SimTK::MultibodySystem &system) const
 Create a SimTK::Force which implements this CustomForce.

Protected Member Functions

virtual void computeForce (const SimTK::State &state) const =0
 Subclasses must implement this method to compute the forces that should be applied to bodies and generalized speeds.
virtual double computePotentialEnergy (const SimTK::State &state) const
 Subclasses may optionally override this method to compute a contribution to the potential energy of the system.
void applyForce (const OpenSim::Body &aBody, const SimTK::Vec3 &aForce) const
 Apply a force to a particular body.
void applyForceToPoint (const OpenSim::Body &aBody, const SimTK::Vec3 &aPoint, const SimTK::Vec3 &aForce) const
 Apply a force to a particular body.
void applyTorque (const OpenSim::Body &aBody, const SimTK::Vec3 &aTorque) const
 Apply a torque to a particular body.
void applyGeneralizedForce (const Coordinate &aCoord, double aForce) const
 Apply a force to a generalized speed.
void computeForce (const SimbodyEngine &engine, const SimTK::State &state, SimTK::Vector_< SimTK::SpatialVec > &bodyForces, SimTK::Vector &mobilityForces) const
 This is invoked by ForceAdapter to perform the force computation.

Friends

class ForceAdapter

Detailed Description

This is an abstract subclass of Actuator which allows you to define new Actuator types by overriding methods, rather than having to create a new SimTK::Force subclass.


Constructor & Destructor Documentation

CustomActuator::CustomActuator (  ) 
CustomActuator::CustomActuator ( const CustomActuator aAct  ) 

Copy constructor.

Parameters:
aActuator Actuator to copy.

Member Function Documentation

void OpenSim::CustomActuator::applyForce ( const OpenSim::Body aBody,
const SimTK::Vec3 &  aForce 
) const [protected]

Apply a force to a particular body.

This method applies only a force, not a torque, which is equivalent to applying the force at the body's center of mass.

This method may only be called from inside computeForce(). Invoking it at any other time will produce an exception.

Parameters:
aBody the body to apply the force to
aForce the force to apply, specified in the inertial frame
void OpenSim::CustomActuator::applyForceToPoint ( const OpenSim::Body aBody,
const SimTK::Vec3 &  aPoint,
const SimTK::Vec3 &  aForce 
) const [protected]

Apply a force to a particular body.

Based on what point the force is applied at, this method automatically determines the torque produced by the force and applies that as well.

This method may only be called from inside computeForce(). Invoking it at any other time will produce an exception.

Parameters:
aBody the body to apply the force to
aPoint the point at which to apply the force, specifieid in the inertial frame
aForce the force to apply, specified in the body's frame
void CustomActuator::applyGeneralizedForce ( const Coordinate aCoord,
double  aForce 
) const [protected]

Apply a force to a generalized speed.

This method may only be called from inside computeForce(). Invoking it at any other time will produce an exception.

Parameters:
aCoord the generalized speed to apply the force to
aForce the force to apply
void OpenSim::CustomActuator::applyTorque ( const OpenSim::Body aBody,
const SimTK::Vec3 &  aTorque 
) const [protected]

Apply a torque to a particular body.

This method may only be called from inside computeForce(). Invoking it at any other time will produce an exception.

Parameters:
aBody the body to apply the force to
aTorque the torque to apply, specified in the inertial frame
void CustomActuator::computeForce ( const SimbodyEngine engine,
const SimTK::State &  state,
SimTK::Vector_< SimTK::SpatialVec > &  bodyForces,
SimTK::Vector &  mobilityForces 
) const [protected]

This is invoked by ForceAdapter to perform the force computation.

virtual void OpenSim::CustomActuator::computeForce ( const SimTK::State &  state  )  const [protected, pure virtual]

Subclasses must implement this method to compute the forces that should be applied to bodies and generalized speeds.

Implemented in OpenSim::CoordinateActuator, OpenSim::LinearActuator, OpenSim::PointActuator, OpenSim::TorqueActuator, and OpenSim::Muscle.

double CustomActuator::computePotentialEnergy ( const SimTK::State &  state  )  const [protected, virtual]

Subclasses may optionally override this method to compute a contribution to the potential energy of the system.

The default implementation returns 0, which is appropriate for forces that do not contribute to potential energy.

void CustomActuator::createSystem ( SimTK::MultibodySystem &  system  )  const [virtual]

Create a SimTK::Force which implements this CustomForce.

Reimplemented from OpenSim::ModelComponent.

Reimplemented in OpenSim::CoordinateActuator.

OpenSim::CustomActuator::OPENSIM_DECLARE_DERIVED ( CustomActuator  ,
Actuator   
)

Friends And Related Function Documentation

friend class ForceAdapter [friend]

The documentation for this class was generated from the following files:

Generated on Wed Dec 16 15:03:45 2009 for OpenSim by  doxygen 1.6.1