Simbody  3.7
SimTK::Motion::Custom::Implementation Class Referenceabstract

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

Public Member Functions

virtual ~Implementation ()
 Destructor is virtual; be sure to provide one in you concrete class if there is anything to destruct. More...
 
virtual Implementationclone () const
 Override this if you want your Motion objects to be copyable. More...
 
virtual Motion::Level getLevel (const State &) const =0
 A Motion prescribes either position, velocity, or acceleration. More...
 
virtual Motion::Method getLevelMethod (const State &) const
 Override this if the method is not Motion::Prescribed. More...
 
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. More...
 
virtual void calcPrescribedPositionDot (const State &s, int nq, Real *qdot) const
 Calculate the time derivative of the prescribed positions. More...
 
virtual void calcPrescribedPositionDotDot (const State &s, int nq, Real *qdotdot) const
 Calculate the 2nd time derivative of the prescribed positions. More...
 
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. More...
 
virtual void calcPrescribedVelocityDot (const State &s, int nu, Real *udot) const
 Calculate the time derivative of the prescribed velocity. More...
 
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. More...
 
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.

See also
SimTK::Motion::Custom

Constructor & Destructor Documentation

◆ ~Implementation()

virtual SimTK::Motion::Custom::Implementation::~Implementation ( )
inlinevirtual

Destructor is virtual; be sure to provide one in you concrete class if there is anything to destruct.

Member Function Documentation

◆ clone()

virtual Implementation* SimTK::Motion::Custom::Implementation::clone ( ) const
inlinevirtual

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

◆ getLevel()

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 "free", "fast", or "slow", respectively.

◆ getLevelMethod()

virtual Motion::Method SimTK::Motion::Custom::Implementation::getLevelMethod ( const State ) const
inlinevirtual

Override this if the method is not Motion::Prescribed.

◆ calcPrescribedPosition()

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.

◆ calcPrescribedPositionDot()

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.

◆ calcPrescribedPositionDotDot()

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.

◆ calcPrescribedVelocity()

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.

◆ calcPrescribedVelocityDot()

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.

◆ calcPrescribedAcceleration()

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.

◆ realizeTopology()

virtual void SimTK::Motion::Custom::Implementation::realizeTopology ( State state) const
inlinevirtual

◆ realizeModel()

virtual void SimTK::Motion::Custom::Implementation::realizeModel ( State state) const
inlinevirtual

◆ realizeInstance()

virtual void SimTK::Motion::Custom::Implementation::realizeInstance ( const State state) const
inlinevirtual

◆ realizeTime()

virtual void SimTK::Motion::Custom::Implementation::realizeTime ( const State state) const
inlinevirtual

◆ realizePosition()

virtual void SimTK::Motion::Custom::Implementation::realizePosition ( const State state) const
inlinevirtual

◆ realizeVelocity()

virtual void SimTK::Motion::Custom::Implementation::realizeVelocity ( const State state) const
inlinevirtual

◆ realizeDynamics()

virtual void SimTK::Motion::Custom::Implementation::realizeDynamics ( const State state) const
inlinevirtual

◆ realizeAcceleration()

virtual void SimTK::Motion::Custom::Implementation::realizeAcceleration ( const State state) const
inlinevirtual

◆ realizeReport()

virtual void SimTK::Motion::Custom::Implementation::realizeReport ( const State state) const
inlinevirtual

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