Go to the documentation of this file. 1 #ifndef SimTK_SIMBODY_MOTION_H_
2 #define SimTK_SIMBODY_MOTION_H_
36 class SimbodyMatterSubsystem;
44 #ifndef SimTK_SIMBODY_DEFINING_MOTION
45 extern template class PIMPLHandle<Motion, MotionImpl, true>;
213 Method& udotMethod)
const;
225 class PolynomialImpl;
401 "Motion::Custom::Implementation::clone()",
402 "Concrete Implementation did not supply a clone() method, "
403 "but a copy operation was attempted.");
449 (
const State& s,
int nq,
Real* qdot)
const;
464 (
const State& s,
int nq,
Real* qdotdot)
const;
494 (
const State& s,
int nu,
Real* udot)
const;
511 (
const State& s,
int nu,
Real* udot)
const;
535 #endif // SimTK_SIMBODY_MOTION_H_
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:280
Steady()
Default constructor creates an empty handle than can be assigned to reference any Motion::Steady obje...
Definition: Motion.h:294
Motion()
Default constructor creates an empty Motion handle that can be assigned to reference any kind of Moti...
Definition: Motion.h:141
virtual void realizeDynamics(const State &state) const
Definition: Motion.h:526
void disable(State &state) const
Disable this Motion, effectively removing it from the mobilizer to which it belongs and allowing the ...
#define SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS(DERIVED, DERIVED_IMPL, PARENT)
Definition: PrivateImplementation.h:343
bool isDisabled(const State &state) const
Test whether this Motion is currently disabled in the supplied State.
This class can be used to define new motions.
Definition: Motion.h:362
virtual void calcPrescribedVelocityDot(const State &s, int nu, Real *udot) const
Calculate the time derivative of the prescribed velocity.
Prescribe position, velocity, or acceleration motion as a sinusoidal function of time,...
Definition: Motion.h:240
virtual Implementation * clone() const
Override this if you want your Motion objects to be copyable.
Definition: Motion.h:399
Level getLevel(const State &) const
Get the highest level being driven by this Motion.
const Implementation & getImplementation() const
@ Prescribed
motion is function of time and state; <level is derivative
Definition: Motion.h:130
virtual void calcPrescribedAcceleration(const State &s, int nu, Real *udot) const
This operator is called during the MatterSubsystem's realize(Dynamics) computation.
This is a System that represents the dynamics of a particle moving along a smooth surface.
Definition: Assembler.h:37
A Motion object belongs to a particular MobilizedBody and prescribes how the associated motion is to ...
Definition: Motion.h:107
virtual Motion::Level getLevel(const State &) const =0
A Motion prescribes either position, velocity, or acceleration.
Custom(MobilizedBody &mobod, Implementation *implementation)
Create a Custom Motion.
Steady & setOneDefaultRate(MobilizerUIndex, Real u)
Change the default rate this Motion will prescribe for one mobility, unless overridden in a particula...
virtual void calcPrescribedPositionDot(const State &s, int nq, Real *qdot) const
Calculate the time derivative of the prescribed positions.
void setOneRate(State &state, MobilizerUIndex ux, Real u) const
Change the rate this Motion will prescribe for one mobility when used with the given State.
virtual void realizeAcceleration(const State &state) const
Definition: Motion.h:527
virtual Motion::Method getLevelMethod(const State &) const
Override this if the method is not Motion::Prescribed.
Definition: Motion.h:419
Sinusoid()
Default constructor creates an empty handle that can be assigned to reference any Motion::Sinusoid ob...
Definition: Motion.h:264
This non-holonomic Motion object imposes a constant rate on all mobilities.
Definition: Motion.h:277
virtual void calcPrescribedPositionDotDot(const State &s, int nq, Real *qdotdot) const
Calculate the 2nd time derivative of the prescribed positions.
virtual void realizePosition(const State &state) const
Definition: Motion.h:524
virtual void realizeVelocity(const State &state) const
Definition: Motion.h:525
void calcAllMethods(const State &s, Method &qMethod, Method &uMethod, Method &udotMethod) const
(Advanced) This implements the above table.
virtual void realizeTopology(State &state) const
Definition: Motion.h:520
Custom()
Default constructor creates an empty handle that can be assigned to reference any Motion::Custom obje...
Definition: Motion.h:376
#define SimTK_ERRCHK_ALWAYS(cond, whereChecked, msg)
Definition: ExceptionMacros.h:281
Level
What is the highest level of motion that is driven? Lower levels are also driven; higher levels are d...
Definition: Motion.h:112
Steady(MobilizedBody &mobod, const Vec< N > &u)
Create a Motion::Steady with different velocities for each mobility specified.
Implementation & updImplementation()
Motion(MotionImpl *r)
For internal use: construct a new Motion handle referencing a particular implementation object.
Definition: Motion.h:231
bool isDisabledByDefault() const
Test whether this Motion is disabled by default in which case it must be explicitly enabled before it...
A MobilizedBody is Simbody's fundamental body-and-joint object used to parameterize a system's motion...
Definition: MobilizedBody.h:169
const MobilizedBody & getMobilizedBody() const
Get the MobilizedBody to which this Motion belongs.
#define SimTK_SIMBODY_EXPORT
Definition: Simbody/include/simbody/internal/common.h:68
void enable(State &state) const
Enable this Motion, without necessarily satisfying it.
Method getLevelMethod(const State &) const
Get the method being used to control the indicated Level.
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:606
Method
There are several ways to specify the motion at this Level, and the selected method also determines l...
Definition: Motion.h:126
virtual void calcPrescribedVelocity(const State &s, int nu, Real *u) const
This operator is called during the MatterSubsystem's realize(Position) computation.
static const char * nameOfMethod(Method)
Returns a human-readable name corresponding to the given Method; useful for debugging.
virtual void realizeModel(State &state) const
Definition: Motion.h:521
This is the abstract base class for Custom Motion implementations.
Definition: Motion.h:392
Real getOneRate(const State &state, MobilizerUIndex ux) const
Get the rate setting for one mobility.
virtual ~Implementation()
Destructor is virtual; be sure to provide one in you concrete class if there is anything to destruct.
Definition: Motion.h:396
void setRate(State &state, Real u) const
Change the rate to be prescribed by this Motion when used with the given State.
virtual void calcPrescribedPosition(const State &s, int nq, Real *q) const
This operator is called during the MatterSubsystem's realize(Time) computation.
Sinusoid(MobilizedBody &mobod, Motion::Level level, Real amplitude, Real rate, Real phase)
Create a sinusoidal prescribed motion applied at position, velocity, or acceleration level.
virtual void realizeTime(const State &state) const
Definition: Motion.h:523
virtual void realizeReport(const State &state) const
Definition: Motion.h:528
Steady & setDefaultRates(const Vec< N > &u)
Change the default rates this Motion will prescribe, supplying separate rates for each mobility as a ...
static const char * nameOfLevel(Level)
Returns a human-readable name corresponding to the given Level; useful for debugging.
Steady(MobilizedBody &mobod, Real u)
Create a Motion::Steady where all mobilities have the same velocity.
Real getOneDefaultRate(MobilizerUIndex ux) const
Get the default rate setting for one mobility.
virtual void realizeInstance(const State &state) const
Definition: Motion.h:522
Steady & setDefaultRate(Real u)
Change the default rate this Motion will prescribe unless overridden in a particular State.
void setDisabledByDefault(bool shouldBeDisabled)
Specify that a Motion is to be inactive by default.