Simbody
|
A Motion object belongs to a particular mobilizer and specifies how the associated motion is to be calculated. More...
#include <Motion.h>
Classes | |
class | Custom |
This class can be used to define new motions. More... | |
class | Sinusoid |
Prescribe position, velocity, or acceleration motion as a sinusoidal function of time, m(t) = a * sin( w*t + p ). More... | |
class | Steady |
This non-holonomic Motion object imposes a constant rate on all mobilities. More... | |
Public Types | |
enum | Level { Acceleration = 0, Velocity = 1, Position = 2 } |
What is the highest level of motion that is driven? Lower levels are also driven; higher levels are determined by integration. More... | |
enum | Method { Zero = 0, Discrete = 1, Prescribed = 2, Free = 3, Fast = 4 } |
There are several ways to specify the motion at this Level, and the selected method also determines lower-level motions. More... | |
Public Member Functions | |
Motion () | |
Motion (MotionImpl *r) | |
const MobilizedBody & | getMobilizedBody () const |
Get the MobilizedBody to which this Motion belongs. | |
Level | getLevel (const State &) const |
Method | getLevelMethod (const State &) const |
void | calcAllMethods (const State &s, Method &qMethod, Method &uMethod, Method &udotMethod) const |
Static Public Member Functions | |
static const char * | nameOfLevel (Level) |
Returns a human-readable name corresponding to the given Level; useful for debugging. | |
static const char * | nameOfMethod (Method) |
Returns a human-readable name corresponding to the given Method; useful for debugging. |
A Motion object belongs to a particular mobilizer and specifies how the associated motion is to be calculated.
There are two independent aspects: (1) at what level is the motion driven (low to high: acceleration, velocity, or position), and (2) how is the motion at that level specified. Levels lower than the driven level are also driven; higher levels are free and determined by integration. This table shows the possibilities:
Level How driven Acceleration Velocity Position ----- ---------- ------------ ---------- ---------- Acc Zero 0 discrete free " Discrete discrete free " " Prescribed a(t,q,u) " " " Free from forces " " Vel Zero 0 0 discrete " Discrete 0 discrete free " Prescribed dv/dt v(t,q) " " Fast 0 relax(v) " Pos Zero 0 0 0 (ref.) " Discrete 0 0 discrete " Prescribed d2p/dt2 dp/dt p(t) " Fast 0 0 relax(p)
There are two duplicates in the above table: specifying acceleration as Zero is the same as specifying velocity as Discrete and specifying velocity as Zero is the same as specifying position as Discrete.
For mobilizers with more than one mobility, the associated Motion controls all the mobilities and moreover they are all driven at the same level and by the same method. TODO?: provide Motion::Composite for building up a Motion from individual axis specifications.
Motion is a PIMPL-style abstract base class, with concrete classes defined for each kind of Motion. There is a set of built-in Motions and a generic "Custom" Motion (an abstract base class) from which advanced users may derive their own Motion objects.
enum SimTK::Motion::Level |
There are several ways to specify the motion at this Level, and the selected method also determines lower-level motions.
Free is only permitted when Level==Acceleration, and Fast is not allowed for that Level.
SimTK::Motion::Motion | ( | ) | [inline] |
SimTK::Motion::Motion | ( | MotionImpl * | r | ) | [inline, explicit] |
static const char* SimTK::Motion::nameOfLevel | ( | Level | ) | [static] |
Returns a human-readable name corresponding to the given Level; useful for debugging.
If the Level is unrecognized the method will return some text to that effect rather than crashing.
static const char* SimTK::Motion::nameOfMethod | ( | Method | ) | [static] |
Returns a human-readable name corresponding to the given Method; useful for debugging.
If the Method is unrecognized the method will return some text to that effect rather than crashing.
const MobilizedBody& SimTK::Motion::getMobilizedBody | ( | ) | const |
Get the MobilizedBody to which this Motion belongs.
void SimTK::Motion::calcAllMethods | ( | const State & | s, |
Method & | qMethod, | ||
Method & | uMethod, | ||
Method & | udotMethod | ||
) | const [inline] |