Simbody
Public Member Functions

SimTK::Motion::Custom::Implementation Class Reference

This is the abstract base class for Custom Motion implementations. More...

#include <Motion.h>

List of all members.

Public Member Functions

virtual ~Implementation ()
 Destructor is virtual.
virtual Implementationclone () const
 Override this if you want your Motion objects to be copyable.
virtual Motion::Level getLevel (const State &) const =0
 A Motion prescribes either position, velocity, or acceleration.
virtual Motion::Method getLevelMethod (const State &) const
Position (Holonomic) prescribed motion virtuals

These must be defined if the motion method is "Prescribed" and the motion level is "Position".

In that case q=q(t), qdot, and qdotdot are all required. Note that Simbody passes in the number of q's being prescribed; make sure you are seeing what you expect.

virtual void calcPrescribedPosition (const State &s, int nq, Real *q) const
 This operator is called during the MatterSubsystem's realize(Time) computation.
virtual void calcPrescribedPositionDot (const State &s, int nq, Real *qdot) const
 Calculate the time derivative of the prescribed positions.
virtual void calcPrescribedPositionDotDot (const State &s, int nq, Real *qdotdot) const
 Calculate the 2nd time derivative of the prescribed positions.
Velocity (Nonholonomic) prescribed motion virtuals

These must be defined if the motion method is "Prescribed" and the motion level is "Velocity".

In that case u=u(t,q), and udot are both required. Note that Simbody passes in the number of u's being prescribed; make sure you are seeing what you expect.

virtual void calcPrescribedVelocity (const State &s, int nu, Real *u) const
 This operator is called during the MatterSubsystem's realize(Position) computation.
virtual void calcPrescribedVelocityDot (const State &s, int nu, Real *udot) const
 Calculate the time derivative of the prescribed velocity.
Acceleration-only prescribed motion virtual

This must be defined if the motion method is "Prescribed" and the motion level is "Acceleration".

In that case udot=udot(t,q,u) is required. Note that Simbody passes in the number of u's (same as number of udots) being prescribed; make sure you are seeing what you expect.

virtual void calcPrescribedAcceleration (const State &s, int nu, Real *udot) const
 This operator is called during the MatterSubsystem's realize(Dynamics) computation.
Optional realize() virtual methods

The following methods may optionally be overridden to do specialized realization for a Motion.

These are called during the corresponding realization stage of the containing MatterSubsystem.

virtual void realizeTopology (State &state) const
virtual void realizeModel (State &state) const
virtual void realizeInstance (const State &state) const
virtual void realizeTime (const State &state) const
virtual void realizePosition (const State &state) const
virtual void realizeVelocity (const State &state) const
virtual void realizeDynamics (const State &state) const
virtual void realizeAcceleration (const State &state) const
virtual void realizeReport (const State &state) const

Detailed Description

This is the abstract base class for Custom Motion implementations.


Constructor & Destructor Documentation

virtual SimTK::Motion::Custom::Implementation::~Implementation ( ) [inline, virtual]

Destructor is virtual.


Member Function Documentation

virtual Implementation* SimTK::Motion::Custom::Implementation::clone ( ) const [inline, virtual]

Override this if you want your Motion objects to be copyable.

virtual Motion::Level SimTK::Motion::Custom::Implementation::getLevel ( const State ) const [pure virtual]

A Motion prescribes either position, velocity, or acceleration.

When velocity is prescribed, acceleration must also be prescribed as the time derivative of the velocity. And, when position is prescribed, velocity must also be prescribed as the time derivative of the position (and acceleration as above). Thus acceleration is always prescribed. Anything not prescribed will be determined by numerical integration, by relaxation, or by discrete changes driven by events, depending on whether the associated mobilizer is "regular", "fast", or "slow", respectively.

virtual Motion::Method SimTK::Motion::Custom::Implementation::getLevelMethod ( const State ) const [inline, virtual]
virtual void SimTK::Motion::Custom::Implementation::calcPrescribedPosition ( const State s,
int  nq,
Real *  q 
) const [virtual]

This operator is called during the MatterSubsystem's realize(Time) computation.

This Motion's own realizeTime() method will already have been called. The result must depend only on time and earlier-stage state variables.

virtual void SimTK::Motion::Custom::Implementation::calcPrescribedPositionDot ( const State s,
int  nq,
Real *  qdot 
) const [virtual]

Calculate the time derivative of the prescribed positions.

The qdots calculated here must be the exact time derivatives of the q's returned by calcPrescribedPosition(). So the calculation must be limited to the same dependencies, plus the current value of this mobilizer's q's (or the cross-mobilizer transform X_FM because that depends only on those q's). Note that we are return qdots, not u's; they are not always the same. Simbody knows how to map from qdots to u's when necessary.

This operator is called during the MatterSubsystem's realize(Position) computation. This Motion's own realizePosition() method will already have been called.

virtual void SimTK::Motion::Custom::Implementation::calcPrescribedPositionDotDot ( const State s,
int  nq,
Real *  qdotdot 
) const [virtual]

Calculate the 2nd time derivative of the prescribed positions.

The qdotdots calculated here must be the exact time derivatives of the qdots returned by calcPrescribedPositionDot(). So the calculation must be limited to the same dependencies, plus the current value of this mobilizer's qdots (or the cross-mobilizer velocity V_FM because that depends only on those qdots). Note that we are return qdotdots, not udots; they are not always the same. Simbody knows how to map from qdotdots to udots when necessary.

This operator is called during the MatterSubsystem's realize(Dynamics) computation. This Motion's own realizeDynamics() method will already have been called.

virtual void SimTK::Motion::Custom::Implementation::calcPrescribedVelocity ( const State s,
int  nu,
Real *  u 
) const [virtual]

This operator is called during the MatterSubsystem's realize(Position) computation.

The result must depend only on time and positions (of any body or mobilizer), or earlier-stage state variables; it must not depend on any velocities. This Motion's own realizePosition() method will already have been called. This will not be called if the u's are known to be zero.

virtual void SimTK::Motion::Custom::Implementation::calcPrescribedVelocityDot ( const State s,
int  nu,
Real *  udot 
) const [virtual]

Calculate the time derivative of the prescribed velocity.

The udots calculated here must be the exact time derivatives of the u's returned by calcPrescribedVelocity(). So the calculation must be limited to the same dependencies, plus the current value of this mobilizer's u's (or the cross-mobilizer velocity V_FM because that depends only on those u's).

This operator is called during the MatterSubsystem's realize(Dynamics) computation. This Motion's own realizeDynamics() method will already have been called. This will not be called if the udots are known to be zero.

virtual void SimTK::Motion::Custom::Implementation::calcPrescribedAcceleration ( const State s,
int  nu,
Real *  udot 
) const [virtual]

This operator is called during the MatterSubsystem's realize(Dynamics) computation.

The result can depend on time, any positions, and any velocities but must not depend on accelerations or reaction forces. This Motion's own realizeDynamics() method will already have been called. This will not be called if the udots are known to be zero.

virtual void SimTK::Motion::Custom::Implementation::realizeTopology ( State state) const [inline, virtual]
virtual void SimTK::Motion::Custom::Implementation::realizeModel ( State state) const [inline, virtual]
virtual void SimTK::Motion::Custom::Implementation::realizeInstance ( const State state) const [inline, virtual]
virtual void SimTK::Motion::Custom::Implementation::realizeTime ( const State state) const [inline, virtual]
virtual void SimTK::Motion::Custom::Implementation::realizePosition ( const State state) const [inline, virtual]
virtual void SimTK::Motion::Custom::Implementation::realizeVelocity ( const State state) const [inline, virtual]
virtual void SimTK::Motion::Custom::Implementation::realizeDynamics ( const State state) const [inline, virtual]
virtual void SimTK::Motion::Custom::Implementation::realizeAcceleration ( const State state) const [inline, virtual]
virtual void SimTK::Motion::Custom::Implementation::realizeReport ( const State state) const [inline, virtual]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines