Simbody  3.7
SimTK::Motion::Sinusoid Class Reference

Prescribe position, velocity, or acceleration motion as a sinusoidal function of time, m(t) = a * sin( w*t + p ). More...

+ Inheritance diagram for SimTK::Motion::Sinusoid:

Public Member Functions

 Sinusoid (MobilizedBody &mobod, Motion::Level level, Real amplitude, Real rate, Real phase)
 Create a sinusoidal prescribed motion applied at position, velocity, or acceleration level. More...
 
 Sinusoid ()
 Default constructor creates an empty handle that can be assigned to reference any Motion::Sinusoid object. More...
 
- Public Member Functions inherited from SimTK::Motion
 Motion ()
 Default constructor creates an empty Motion handle that can be assigned to reference any kind of Motion object. More...
 
Level getLevel (const State &) const
 Get the highest level being driven by this Motion. More...
 
Method getLevelMethod (const State &) const
 Get the method being used to control the indicated Level. More...
 
void disable (State &state) const
 Disable this Motion, effectively removing it from the mobilizer to which it belongs and allowing the mobilizer to move freely (unless locked). More...
 
void enable (State &state) const
 Enable this Motion, without necessarily satisfying it. More...
 
bool isDisabled (const State &state) const
 Test whether this Motion is currently disabled in the supplied State. More...
 
void setDisabledByDefault (bool shouldBeDisabled)
 Specify that a Motion is to be inactive by default. More...
 
bool isDisabledByDefault () const
 Test whether this Motion is disabled by default in which case it must be explicitly enabled before it will take effect. More...
 
const MobilizedBodygetMobilizedBody () const
 Get the MobilizedBody to which this Motion belongs. More...
 
void calcAllMethods (const State &s, Method &qMethod, Method &uMethod, Method &udotMethod) const
 (Advanced) This implements the above table. More...
 
- Public Member Functions inherited from SimTK::PIMPLHandle< Motion, MotionImpl, true >
bool isEmptyHandle () const
 Returns true if this handle is empty, that is, does not refer to any implementation object. More...
 
bool isOwnerHandle () const
 Returns true if this handle is the owner of the implementation object to which it refers. More...
 
bool isSameHandle (const Motion &other) const
 Determine whether the supplied handle is the same object as "this" PIMPLHandle. More...
 
void disown (Motion &newOwner)
 Give up ownership of the implementation to an empty handle. More...
 
PIMPLHandlereferenceAssign (const Motion &source)
 "Copy" assignment but with shallow (pointer) semantics. More...
 
PIMPLHandlecopyAssign (const Motion &source)
 This is real copy assignment, with ordinary C++ object ("value") semantics. More...
 
void clearHandle ()
 Make this an empty handle, deleting the implementation object if this handle is the owner of it. More...
 
const MotionImpl & getImpl () const
 Get a const reference to the implementation associated with this Handle. More...
 
MotionImpl & updImpl ()
 Get a writable reference to the implementation associated with this Handle. More...
 
int getImplHandleCount () const
 Return the number of handles the implementation believes are referencing it. More...
 

Additional Inherited Members

- Public Types inherited from SimTK::Motion
enum  Level {
  NoLevel = -1,
  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 {
  NoMethod = -1,
  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 Types inherited from SimTK::PIMPLHandle< Motion, MotionImpl, true >
typedef PIMPLHandle< Motion, MotionImpl, PTR > HandleBase
 
typedef HandleBase ParentHandle
 
- Static Public Member Functions inherited from SimTK::Motion
static const char * nameOfLevel (Level)
 Returns a human-readable name corresponding to the given Level; useful for debugging. More...
 
static const char * nameOfMethod (Method)
 Returns a human-readable name corresponding to the given Method; useful for debugging. More...
 
- Protected Member Functions inherited from SimTK::Motion
 Motion (MotionImpl *r)
 For internal use: construct a new Motion handle referencing a particular implementation object. More...
 
- Protected Member Functions inherited from SimTK::PIMPLHandle< Motion, MotionImpl, true >
 PIMPLHandle ()
 The default constructor makes this an empty handle. More...
 
 PIMPLHandle (MotionImpl *p)
 This provides consruction of a handle referencing an existing implementation object. More...
 
 PIMPLHandle (const PIMPLHandle &source)
 The copy constructor makes either a deep (value) or shallow (reference) copy of the supplied source PIMPL object, based on whether this is a "pointer semantics" (PTR=true) or "object (value) semantics" (PTR=false, default) class. More...
 
 ~PIMPLHandle ()
 Note that the destructor is non-virtual. More...
 
PIMPLHandleoperator= (const PIMPLHandle &source)
 Copy assignment makes the current handle either a deep (value) or shallow (reference) copy of the supplied source PIMPL object, based on whether this is a "pointer sematics" (PTR=true) or "object (value) semantics" (PTR=false, default) class. More...
 
void setImpl (MotionImpl *p)
 Set the implementation for this empty handle. More...
 
bool hasSameImplementation (const Motion &other) const
 Determine whether the supplied handle is a reference to the same implementation object as is referenced by "this" PIMPLHandle. More...
 

Detailed Description

Prescribe position, velocity, or acceleration motion as a sinusoidal function of time, m(t) = a * sin( w*t + p ).

Constructor & Destructor Documentation

◆ Sinusoid() [1/2]

SimTK::Motion::Sinusoid::Sinusoid ( MobilizedBody mobod,
Motion::Level  level,
Real  amplitude,
Real  rate,
Real  phase 
)

Create a sinusoidal prescribed motion applied at position, velocity, or acceleration level.

Parameters
[in,out]mobodThe MobilizedBody to which this Motion should be added.
[in]levelThe Motion level that is being prescribed: Motion::Position, Motion::Velocity, or Motion::Acceleration.
[in]amplitudeScaling factor mapping the -1..1 sin() result to your desired units; output values will range between -amplitude and +amplitude.
[in]rateAngular rate in radians/unit time; e.g. if time is in seconds then rate=2*Pi would be 1 Hz (1 rotation per second).
[in]phasePhase angle in radians.

◆ Sinusoid() [2/2]

Default constructor creates an empty handle that can be assigned to reference any Motion::Sinusoid object.


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