In file /home/blah/darwin2k/src/dyno/mechanism/dyno.h:an object that gets called periodically during simulation.
Inheritance:
Public Fields
-
dynoTimerCallback cb
- a user-specified callback
-
void* userData
- user-specified callback data
-
int alwaysUpdate
- indicates that the timer should always be called after a simulation time step.
-
double dt
- the desired time between steps.
-
double nextTime
- the next time the timer's doAction method will be called
Public Methods
-
typedef int (*dynoTimerCallback)(void* userData, dynoTimer* tm, double t, timerAction &action)
- a type for the optional user callback supplied to the constructor
-
dynoTimer(dynoTimerCallback CB, double Dt, void* UserData)
- constructor
-
virtual int doAction(double currentTime, timerAction &action)
- this method is called by the dynamicSystem at the time specified by nextTime, to within the dynamicSystem's timer resolution (determined by dynamicSystem::ticksPerSecond).
-
virtual int reschedule(double newDt = -1)
- reschedules the timer to go at ds->currentTime()+dt.
Public Members
-
enum timerAction
- actions to be taken after the current timer update
- CONTINUE - schedule the next update in 'dt' seconds
- PAUSE - deactive the timer, but don't remove it from the system
- DELETE - remove the timer from the system and delete it
Public Fields
-
dynamicSystem* ds
-
int active
-
int stateSize
Public Methods
-
inline virtual int getState(double* state)
-
inline virtual int setState(const double* state)
-
inline virtual int reset(void)
Public Fields
-
static int staticClassID
-
int objectID
-
int verboseLevel
Public Methods
-
virtual const char* className(void) const
-
virtual synObject* copy(void) const
-
virtual int isOfType(int typeNum, int derivedOk)
-
static int setStaticClassID(void)
-
virtual int classID(void) const
Documentation
an object that gets called periodically during simulation. The dynoTimer
allows periodic events to be triggered, such as updating a controller's
torque commands.
A dynamicSystem must be supplied to the constructor, and the dynoTimer
will be automatically deleted by the dynamicSystem when the dynamicSystem
is deleted. To enforce this, the destructor is a protected method, so
dynoTimers cannot be created except by the new operator.
- enum timerAction
- actions to be taken after the current timer update
- CONTINUE - schedule the next update in 'dt' seconds
- PAUSE - deactive the timer, but don't remove it from the system
- DELETE - remove the timer from the system and delete it
- typedef int (*dynoTimerCallback)(void* userData, dynoTimer* tm, double t, timerAction &action)
- a type for the optional user callback supplied to the constructor
- dynoTimerCallback cb
- a user-specified callback
- void* userData
- user-specified callback data
- int alwaysUpdate
- indicates that the timer should always be called after a simulation
time step. nextTime is used as an upper limit on the amount of time
between calls
- double dt
- the desired time between steps. subclasses or callbacks can
change the value of dt, and doAction will compute the next
time at which the timer will be called.
- double nextTime
- the next time the timer's doAction method will be called
- dynoTimer(dynoTimerCallback CB, double Dt, void* UserData)
- constructor
- virtual int doAction(double currentTime, timerAction &action)
- this method is called by the dynamicSystem at the time specified
by nextTime, to within the dynamicSystem's timer resolution
(determined by dynamicSystem::ticksPerSecond).
The current simulation time is passed in currentTime. If the
timer wishes to be paused or deleted, it can set 'action' to
dynoTimer::PAUSE or dynoTimer::DETELE. Otherwise, doAction
will compute nextTime as currentTime+dt. When 'action' is
set to dynoTimer::DELETE, the timer will be deleted by the
dynamicSystem
- virtual int reschedule(double newDt = -1)
- reschedules the timer to go at ds->currentTime()+dt. If
newDt is greater than zero, than dt is first set to newDt.
- This class has no child classes.
- Friends:
- dynamicSystem
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.