|Tekkotsu Homepage||Demos||Overview||Downloads||Dev. Resources||Reference||Credits|
MotionHook Class Reference
Interface for connections to remote hosts and hardware devices which should be polled with output values. More...
Inheritance diagram for MotionHook:
Interface 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.
Constructor & Destructor Documentation
Member Function Documentation
Called when the controller is going to be running in realtime mode, which is probably the normal mode you'd expect.
You might be in realtime mode, but a debugger breakpoint will still pause things, or thread scheduling could hiccup, so try to be robust.
Should return true if the MotionHook is successfully connected to physical hardware.
If relevant, this will only be called after motionStarting() has been called in order to initialize a connection.
This is used mainly to cancel out of the WaitForSensors if all MotionHooks return false. If you are still in the process of connecting or unsure of status, be optimistic and return true. This function will be polled at a coarse rate while blocked on sensors in case of timeouts on the part of the MotionHook render it moot.
Referenced by Simulator::run().
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. May be called multiple times if changing between full-speed mode and paused
A non-realtime mode might be triggered if the user wants to pause the simulator/controller to step through something... No guarantees though! The debugger might catch a breakpoint and stop things, and this won't be called!
Called each time the motion process has polled active motion commands.
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.
Referenced by Simulator::updateMotion().
Called when motion process is starting.
Called when motion process is stopping.
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.
Referenced by motionCheck().
Member Data Documentation
The documentation for this class was generated from the following file:
Tekkotsu Hardware Abstraction Layer 5.1CVS
||Generated Mon May 9 05:01:41 2016 by Doxygen 1.6.3|