Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

IPCMotionHook Class Reference

description of IPCMotionHook More...

#include <IPCMotionHook.h>

Inheritance diagram for IPCMotionHook:

Detailed Description

description of IPCMotionHook

Definition at line 12 of file IPCMotionHook.h.

List of all members.

Public Member Functions

 IPCMotionHook (MessageQueueBase &q, MessageQueueBase &pidq)
virtual ~IPCMotionHook ()
virtual bool isConnected ()
 Should return true if the MotionHook is successfully connected to physical hardware.
virtual void motionCheck (const float outputs[][NumOutputs])
 Called each time the motion process has polled active motion commands.
virtual void updatePIDs (const std::vector< PIDUpdate > &pids)
 Called when PID values change.

Protected Types

typedef std::list< RCRegion * > msgbuf_t
 type of collection of shared data regions

Protected Member Functions

RCRegiongetRegion ()

Protected Attributes

MessageQueueBasemq
MessageQueueBasepidmq
msgbuf_t regions
 for efficiency, reuse old buffers -- oldest at front, most recently used at back

Static Protected Attributes

static unsigned int count = 0
 count of created regions

Member Typedef Documentation

typedef std::list<RCRegion* > msgbuf_t [protected]

type of collection of shared data regions

Definition at line 28 of file IPCMotionHook.h.


Constructor & Destructor Documentation

Definition at line 14 of file IPCMotionHook.h.

~IPCMotionHook (  )  [virtual]

Definition at line 9 of file IPCMotionHook.cc.


Member Function Documentation

RCRegion * getRegion (  )  [protected]

Definition at line 30 of file IPCMotionHook.cc.

Referenced by motionCheck().

virtual bool isConnected (  )  [virtual]

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.

Implements MotionHook.

Definition at line 17 of file IPCMotionHook.h.

void motionCheck ( const float  outputs[][NumOutputs]  )  [virtual]

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 from MotionHook.

Definition at line 14 of file IPCMotionHook.cc.

void updatePIDs ( const std::vector< PIDUpdate > &  pids  )  [virtual]

Called when PID values change.

Reimplemented from MotionHook.

Definition at line 21 of file IPCMotionHook.cc.

Referenced by MotionExecThread::poll().


Member Data Documentation

unsigned int count = 0 [static, protected]

count of created regions

Definition at line 26 of file IPCMotionHook.h.

Referenced by getRegion(), and updatePIDs().

MessageQueueBase& mq [protected]

Definition at line 23 of file IPCMotionHook.h.

Referenced by motionCheck().

MessageQueueBase& pidmq [protected]

Definition at line 24 of file IPCMotionHook.h.

Referenced by updatePIDs().

msgbuf_t regions [protected]

for efficiency, reuse old buffers -- oldest at front, most recently used at back

Definition at line 29 of file IPCMotionHook.h.

Referenced by getRegion(), motionCheck(), and ~IPCMotionHook().


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

Tekkotsu Hardware Abstraction Layer 5.1CVS
Generated Mon May 9 05:01:41 2016 by Doxygen 1.6.3