Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
MotionHook Class Reference#include <MotionHook.h>
Inheritance diagram for MotionHook:
![]() Detailed DescriptionInterface for connections to remote hosts and hardware devices which should be polled with output values.
You can expect to be called every FrameTime*NumFrame milliseconds in terms of simulator time. However, keep in mind this is relative to SharedGlobals::timeScale (Config.Speed) in terms of wall-clock time, and is also subject to the simulator being paused, set to full-speed mode, or hitting a breakpoint in the debugger. See enteringRealtime() and leavingRealtime() if you want updates when the user switches simulation modes, although there's still no way to get notification if a debugger breakpoint is hit Definition at line 19 of file MotionHook.h.
Constructor & Destructor Documentation
Member Function Documentation
Called when motion process is starting.
Reimplemented in CreateDriver, DynamixelDriver, SSC32Driver, and TeRKDriver. Definition at line 28 of file MotionHook.h. Referenced by SSC32Driver::motionStarting(), DynamixelDriver::motionStarting(), and CreateDriver::motionStarting().
Called each time the motion process has polled active motion commands. When in realtime mode, this should be called every FrameTime*NumFrames (defined in the RobotInfo) milliseconds if running at full speed. See enteringRealtime() and leavingRealtime(). This default implementation checks to see which outputs have changed value since the last call and passes the summary on to motionUpdated(). lastOutputs will be updated with the new values after the call to motionUpdated(). If you need to process all the outputs on every frame, you only need to override this function. Your subclass doesn't need to call the MotionHook implementation unless you want to have lastOutputs updated for you. If you only need to process the changed outputs for each frame, override motionUpdated() instead. motionUpdated() is always called for each update, even if there aren't any changes, so you can still use that if there are some outputs which need to be updated every cycle. Reimplemented in CreateDriver, DynamixelDriver, SSC32Driver, and IPCMotionHook. Definition at line 45 of file MotionHook.h. Referenced by SSC32Driver::motionCheck(), DynamixelDriver::motionCheck(), and CreateDriver::motionCheck().
Called by motionCheck(), after comparing the new output values to lastOutputs, and before lastOutputs is updated. Override this if you only need to send commands to the hardware for values that have changed. This function is always called for each update, even though changedIndices might be empty. Reimplemented in TeRKDriver. Definition at line 69 of file MotionHook.h. Referenced by motionCheck().
Called when motion process is stopping.
Reimplemented in CreateDriver, DynamixelDriver, SSC32Driver, and TeRKDriver. Definition at line 72 of file MotionHook.h. Referenced by SSC32Driver::motionStopping(), DynamixelDriver::motionStopping(), and CreateDriver::motionStopping().
Called when the controller is going to be running in realtime mode, which is probably the normal mode you'd expect. No guarantees though! You might be in realtime mode, but a debugger breakpoint will still pause things. Definition at line 76 of file MotionHook.h.
Called when leaving realtime mode, which means you have no idea when motionCheck is going to be called in terms of wall-clock time. Argument set to true if entering full speed mode, which may mean motionCheck will be called at a high(er) frequency, or slower the computation is overwhelming the host hardware. However, if false, almost certainly indicates updates will be sparse. A non-realtime mode might be triggered if the user wants to pause the simulator/controller to debug something... No guarantees though! The debugger might catch a breakpoint and stop things, and this won't be called! Definition at line 85 of file MotionHook.h.
Called by simulator thread to indicate level of verbosity for diagnostics and reporting errors.
Definition at line 88 of file MotionHook.h.
Member Data Documentation
stores current verbosity
Definition at line 92 of file MotionHook.h. Referenced by CreateDriver::connect(), SSC32Driver::motionCheck(), DynamixelDriver::motionCheck(), and setMotionHookVerbose().
set to false following the first motionCheck, reset to true by motionStopping
Definition at line 94 of file MotionHook.h. Referenced by SSC32Driver::getData(), SSC32Driver::motionCheck(), motionCheck(), DynamixelDriver::motionCheck(), and motionStopping().
stores the last frame of the outputs, updated by motionCheck()
Definition at line 96 of file MotionHook.h. Referenced by SSC32Driver::motionCheck(), motionCheck(), and DynamixelDriver::motionCheck().
The documentation for this class was generated from the following file: |
Tekkotsu Hardware Abstraction Layer 4.0 |
Generated Thu Nov 22 01:01:22 2007 by Doxygen 1.5.4 |