LMasterRSlave Class Reference

#include <LMasterRSlave.h>

List of all members.

Public Member Functions

 LMasterRSlave ()
virtual ~LMasterRSlave ()
virtual OStatus DoInit (const OSystemEvent &event)
virtual OStatus DoStart (const OSystemEvent &event)
virtual OStatus DoStop (const OSystemEvent &event)
virtual OStatus DoDestroy (const OSystemEvent &event)
void ReadyEffector (const OReadyEvent &event)
void NotifySensor (const ONotifyEvent &event)

Public Attributes

OSubject * subject [numOfSubject]
OObserver * observer [numOfObserver]

Private Member Functions

void OpenPrimitives ()
void NewCommandVectorData ()
void SetJointGain ()
MovingResult AdjustDiffJointValue ()
MovingResult MoveToBroadBase ()
MovingResult MoveToSleeping ()
MovingResult MasterSlave ()
RCRegion * FindFreeRegion ()
void SetJointValue (RCRegion *rgn, int idx, double start, double end)
void InitSensorIndex (OSensorFrameVectorData *sensorVecData)
void Sensor2Command (OSensorFrameVectorData *sensorVec, int sensorIdx, OCommandVectorData *commandVec, int commandIndex, OPrimitiveID id)

Private Attributes

LMasterRSlaveState lmasterRSlaveState
OPrimitiveID jointID [NUM_JOINTS]
RCRegion * region [NUM_COMMAND_VECTOR]
bool initSensorIndex
int sensorIndex [NUM_JOINTS]
RCRegion * latestSensorRegion

Static Private Attributes

const size_t NUM_JOINTS = 15
const size_t NUM_COMMAND_VECTOR = 2
const word TILT_PGAIN = 0x000a
const word TILT_IGAIN = 0x0008
const word TILT_DGAIN = 0x000c
const word PAN_PGAIN = 0x000d
const word PAN_IGAIN = 0x0008
const word PAN_DGAIN = 0x000b
const word ROLL_PGAIN = 0x000a
const word ROLL_IGAIN = 0x0008
const word ROLL_DGAIN = 0x000c
const word J1_PGAIN = 0x0016
const word J1_IGAIN = 0x0004
const word J1_DGAIN = 0x0008
const word J2_PGAIN = 0x0014
const word J2_IGAIN = 0x0004
const word J2_DGAIN = 0x0006
const word J3_PGAIN = 0x0023
const word J3_IGAIN = 0x0004
const word J3_DGAIN = 0x0005
const word PSHIFT = 0x000e
const word ISHIFT = 0x0002
const word DSHIFT = 0x000f
const int BROADBASE_MAX_COUNTER = 48
const int SLEEPING_MAX_COUNTER = 48


Constructor & Destructor Documentation

LMasterRSlave::LMasterRSlave  ) 
 

Definition at line 19 of file LMasterRSlave.cc.

References jointID, LMRS_IDLE, region, and sensorIndex.

virtual LMasterRSlave::~LMasterRSlave  )  [inline, virtual]
 

Definition at line 120 of file LMasterRSlave.h.


Member Function Documentation

MovingResult LMasterRSlave::AdjustDiffJointValue  )  [private]
 

Definition at line 238 of file LMasterRSlave.cc.

References GetJointValue(), jointID, region, SetJointValue(), and subject.

Referenced by DoStart(), and ReadyEffector().

OStatus LMasterRSlave::DoDestroy const OSystemEvent &  event  )  [virtual]
 

Definition at line 75 of file LMasterRSlave.cc.

OStatus LMasterRSlave::DoInit const OSystemEvent &  event  )  [virtual]
 

Definition at line 28 of file LMasterRSlave.cc.

References NewCommandVectorData(), and OpenPrimitives().

OStatus LMasterRSlave::DoStart const OSystemEvent &  event  )  [virtual]
 

Definition at line 44 of file LMasterRSlave.cc.

References AdjustDiffJointValue(), lmasterRSlaveState, and subject.

OStatus LMasterRSlave::DoStop const OSystemEvent &  event  )  [virtual]
 

Definition at line 62 of file LMasterRSlave.cc.

References lmasterRSlaveState.

RCRegion * LMasterRSlave::FindFreeRegion  )  [private]
 

Definition at line 380 of file LMasterRSlave.cc.

References region.

Referenced by MasterSlave(), MoveToBroadBase(), and MoveToSleeping().

void LMasterRSlave::InitSensorIndex OSensorFrameVectorData *  sensorVecData  )  [private]
 

Definition at line 408 of file LMasterRSlave.cc.

References jointID, and sensorIndex.

Referenced by NotifySensor().

MovingResult LMasterRSlave::MasterSlave  )  [private]
 

Definition at line 330 of file LMasterRSlave.cc.

References FindFreeRegion(), jointID, latestSensorRegion, LFLEG_J1, LFLEG_J2, LFLEG_J3, LRLEG_J1, LRLEG_J2, LRLEG_J3, RFLEG_J1, RFLEG_J2, RFLEG_J3, RRLEG_J1, RRLEG_J2, RRLEG_J3, Sensor2Command(), sensorIndex, and subject.

Referenced by ReadyEffector().

MovingResult LMasterRSlave::MoveToBroadBase  )  [private]
 

Definition at line 257 of file LMasterRSlave.cc.

References BROADBASE_ANGLE, FindFreeRegion(), GetJointValue(), jointID, MOVING_FINISH, SetJointValue(), and subject.

Referenced by ReadyEffector().

MovingResult LMasterRSlave::MoveToSleeping  )  [private]
 

Definition at line 299 of file LMasterRSlave.cc.

References BROADBASE_ANGLE, FindFreeRegion(), MOVING_FINISH, SetJointValue(), SLEEPING_ANGLE, and subject.

Referenced by ReadyEffector().

void LMasterRSlave::NewCommandVectorData  )  [private]
 

Definition at line 164 of file LMasterRSlave.cc.

References jointID, NUM_JOINTS, and region.

Referenced by DoInit().

void LMasterRSlave::NotifySensor const ONotifyEvent &  event  ) 
 

Definition at line 129 of file LMasterRSlave.cc.

References InitSensorIndex(), initSensorIndex, latestSensorRegion, lmasterRSlaveState, and observer.

void LMasterRSlave::OpenPrimitives  )  [private]
 

Definition at line 151 of file LMasterRSlave.cc.

References jointID.

Referenced by DoInit().

void LMasterRSlave::ReadyEffector const OReadyEvent &  event  ) 
 

Definition at line 82 of file LMasterRSlave.cc.

References AdjustDiffJointValue(), lmasterRSlaveState, MasterSlave(), MoveToBroadBase(), MoveToSleeping(), MovingResult, and SetJointGain().

void LMasterRSlave::Sensor2Command OSensorFrameVectorData *  sensorVec,
int  sensorIdx,
OCommandVectorData *  commandVec,
int  commandIndex,
OPrimitiveID  id
[private]
 

Definition at line 423 of file LMasterRSlave.cc.

Referenced by MasterSlave().

void LMasterRSlave::SetJointGain  )  [private]
 

Definition at line 196 of file LMasterRSlave.cc.

References DSHIFT, HEAD_PAN, HEAD_ROLL, HEAD_TILT, ISHIFT, J1_DGAIN, J1_IGAIN, J1_PGAIN, J2_DGAIN, J2_IGAIN, J2_PGAIN, J3_DGAIN, J3_IGAIN, J3_PGAIN, jointID, PAN_DGAIN, PAN_IGAIN, PAN_PGAIN, PSHIFT, ROLL_DGAIN, ROLL_IGAIN, ROLL_PGAIN, TILT_DGAIN, TILT_IGAIN, and TILT_PGAIN.

Referenced by ReadyEffector().

void LMasterRSlave::SetJointValue RCRegion *  rgn,
int  idx,
double  start,
double  end
[private]
 

Definition at line 390 of file LMasterRSlave.cc.

References jointID.

Referenced by AdjustDiffJointValue(), MoveToBroadBase(), and MoveToSleeping().


Member Data Documentation

const int LMasterRSlave::BROADBASE_MAX_COUNTER = 48 [static, private]
 

Definition at line 180 of file LMasterRSlave.h.

const word LMasterRSlave::DSHIFT = 0x000f [static, private]
 

Definition at line 178 of file LMasterRSlave.h.

Referenced by SetJointGain().

bool LMasterRSlave::initSensorIndex [private]
 

Definition at line 188 of file LMasterRSlave.h.

Referenced by NotifySensor().

const word LMasterRSlave::ISHIFT = 0x0002 [static, private]
 

Definition at line 177 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::J1_DGAIN = 0x0008 [static, private]
 

Definition at line 166 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::J1_IGAIN = 0x0004 [static, private]
 

Definition at line 165 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::J1_PGAIN = 0x0016 [static, private]
 

Definition at line 164 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::J2_DGAIN = 0x0006 [static, private]
 

Definition at line 170 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::J2_IGAIN = 0x0004 [static, private]
 

Definition at line 169 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::J2_PGAIN = 0x0014 [static, private]
 

Definition at line 168 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::J3_DGAIN = 0x0005 [static, private]
 

Definition at line 174 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::J3_IGAIN = 0x0004 [static, private]
 

Definition at line 173 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::J3_PGAIN = 0x0023 [static, private]
 

Definition at line 172 of file LMasterRSlave.h.

Referenced by SetJointGain().

OPrimitiveID LMasterRSlave::jointID[NUM_JOINTS] [private]
 

Definition at line 185 of file LMasterRSlave.h.

Referenced by AdjustDiffJointValue(), InitSensorIndex(), LMasterRSlave(), MasterSlave(), MoveToBroadBase(), NewCommandVectorData(), OpenPrimitives(), SetJointGain(), and SetJointValue().

RCRegion* LMasterRSlave::latestSensorRegion [private]
 

Definition at line 190 of file LMasterRSlave.h.

Referenced by MasterSlave(), and NotifySensor().

LMasterRSlaveState LMasterRSlave::lmasterRSlaveState [private]
 

Definition at line 183 of file LMasterRSlave.h.

Referenced by DoStart(), DoStop(), NotifySensor(), and ReadyEffector().

const size_t LMasterRSlave::NUM_COMMAND_VECTOR = 2 [static, private]
 

Definition at line 150 of file LMasterRSlave.h.

const size_t LMasterRSlave::NUM_JOINTS = 15 [static, private]
 

Definition at line 149 of file LMasterRSlave.h.

Referenced by NewCommandVectorData().

OObserver* LMasterRSlave::observer[numOfObserver]
 

Definition at line 123 of file LMasterRSlave.h.

Referenced by NotifySensor().

const word LMasterRSlave::PAN_DGAIN = 0x000b [static, private]
 

Definition at line 158 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::PAN_IGAIN = 0x0008 [static, private]
 

Definition at line 157 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::PAN_PGAIN = 0x000d [static, private]
 

Definition at line 156 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::PSHIFT = 0x000e [static, private]
 

Definition at line 176 of file LMasterRSlave.h.

Referenced by SetJointGain().

RCRegion* LMasterRSlave::region[NUM_COMMAND_VECTOR] [private]
 

Definition at line 186 of file LMasterRSlave.h.

Referenced by AdjustDiffJointValue(), FindFreeRegion(), LMasterRSlave(), and NewCommandVectorData().

const word LMasterRSlave::ROLL_DGAIN = 0x000c [static, private]
 

Definition at line 162 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::ROLL_IGAIN = 0x0008 [static, private]
 

Definition at line 161 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::ROLL_PGAIN = 0x000a [static, private]
 

Definition at line 160 of file LMasterRSlave.h.

Referenced by SetJointGain().

int LMasterRSlave::sensorIndex[NUM_JOINTS] [private]
 

Definition at line 189 of file LMasterRSlave.h.

Referenced by InitSensorIndex(), LMasterRSlave(), and MasterSlave().

const int LMasterRSlave::SLEEPING_MAX_COUNTER = 48 [static, private]
 

Definition at line 181 of file LMasterRSlave.h.

OSubject* LMasterRSlave::subject[numOfSubject]
 

Definition at line 122 of file LMasterRSlave.h.

Referenced by AdjustDiffJointValue(), DoStart(), MasterSlave(), MoveToBroadBase(), and MoveToSleeping().

const word LMasterRSlave::TILT_DGAIN = 0x000c [static, private]
 

Definition at line 154 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::TILT_IGAIN = 0x0008 [static, private]
 

Definition at line 153 of file LMasterRSlave.h.

Referenced by SetJointGain().

const word LMasterRSlave::TILT_PGAIN = 0x000a [static, private]
 

Definition at line 152 of file LMasterRSlave.h.

Referenced by SetJointGain().


The documentation for this class was generated from the following files:
Generated on Sun Dec 2 23:04:33 2007 for openSDK by  doxygen 1.3.9.1