PIDControl7 Class Reference

#include <PIDControl7.h>

List of all members.

Public Member Functions

 PIDControl7 ()
virtual ~PIDControl7 ()
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 ()
RCRegion * FindFreeRegion ()
void SetJointValue (RCRegion *rgn, int idx, double start, double end)
void SetJointValueForStepInput (RCRegion *rgn, int idx, double val)
void InitSensorIndex (OSensorFrameVectorData *sensorVecData)
void DisableJointGainOfAllLegs ()
void InputParameter ()
MovingResult StepInput ()
void SaveLogData ()
bool YesNo (const char *prompt)
int InputKey (const char *prompt)

Private Attributes

PIDControl7State pidControl7State
PIDControl7Info pidControl7Info
OPrimitiveID jointID [NUM_JOINTS]
RCRegion * region [NUM_COMMAND_VECTOR]
OJointValue * logData
bool initSensorIndex
int sensorIndex [NUM_JOINTS]

Static Private Attributes

const size_t NUM_COMMAND_VECTOR = 2
const word TILT1_PGAIN = 0x000a
const word TILT1_IGAIN = 0x0004
const word TILT1_DGAIN = 0x0002
const word PAN_PGAIN = 0x0008
const word PAN_IGAIN = 0x0002
const word PAN_DGAIN = 0x0004
const word TILT2_PGAIN = 0x000a
const word TILT2_IGAIN = 0x0008
const word TILT2_DGAIN = 0x000c
const word J1_PGAIN = 0x0010
const word J1_IGAIN = 0x0004
const word J1_DGAIN = 0x0001
const word J2_PGAIN = 0x000a
const word J2_IGAIN = 0x0004
const word J2_DGAIN = 0x0001
const word J3_PGAIN = 0x0010
const word J3_IGAIN = 0x0004
const word J3_DGAIN = 0x0001
const word TAIL_PGAIN = 0x000a
const word TAIL_IGAIN = 0x0004
const word TAIL_DGAIN = 0x0004
const word PSHIFT = 0x000e
const word ISHIFT = 0x0002
const word DSHIFT = 0x000f
const int BROADBASE_MAX_COUNTER = 24
const int SLEEPING_MAX_COUNTER = 24
const int STEP_INPUT_NUM_FRAMES = 4
const int HOLD_TIME_NUM_FRAMES = 256


Constructor & Destructor Documentation

PIDControl7::PIDControl7  ) 
 

Definition at line 18 of file PIDControl7.cc.

References jointID, PCS7_IDLE, region, and sensorIndex.

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

Definition at line 153 of file PIDControl7.h.


Member Function Documentation

MovingResult PIDControl7::AdjustDiffJointValue  )  [private]
 

Definition at line 282 of file PIDControl7.cc.

References FindFreeRegion(), GetJointValue(), jointID, NUM_JOINTS, SetJointValue(), and subject.

Referenced by DoStart(), and ReadyEffector().

void PIDControl7::DisableJointGainOfAllLegs  )  [private]
 

Definition at line 436 of file PIDControl7.cc.

References jointID, LFLEG_J1, LFLEG_J2, LFLEG_J3, LRLEG_J1, LRLEG_J2, LRLEG_J3, RFLEG_J1, RFLEG_J2, RFLEG_J3, RRLEG_J1, RRLEG_J2, and RRLEG_J3.

Referenced by ReadyEffector().

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

Definition at line 82 of file PIDControl7.cc.

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

Definition at line 28 of file PIDControl7.cc.

References HOLD_TIME_NUM_FRAMES, logData, NewCommandVectorData(), and OpenPrimitives().

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

Definition at line 51 of file PIDControl7.cc.

References AdjustDiffJointValue(), pidControl7State, and subject.

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

Definition at line 69 of file PIDControl7.cc.

References pidControl7State.

RCRegion * PIDControl7::FindFreeRegion  )  [private]
 

Definition at line 377 of file PIDControl7.cc.

References region.

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

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

Definition at line 421 of file PIDControl7.cc.

References jointID, and sensorIndex.

Referenced by NotifySensor().

int PIDControl7::InputKey const char *  prompt  )  [private]
 

Definition at line 522 of file PIDControl7.cc.

Referenced by InputParameter().

void PIDControl7::InputParameter  )  [private]
 

Definition at line 453 of file PIDControl7.cc.

References PIDControl7Info::desiredValue, PIDControl7Info::dgain, DSHIFT, PIDControl7Info::effectorCounter, PIDControl7Info::igain, InputKey(), ISHIFT, jointID, PIDControl7Info::jointIndex, PIDControl7Info::pgain, pidControl7Info, PSHIFT, and PIDControl7Info::sensorCounter.

Referenced by ReadyEffector().

MovingResult PIDControl7::MoveToBroadBase  )  [private]
 

Definition at line 304 of file PIDControl7.cc.

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

Referenced by ReadyEffector().

MovingResult PIDControl7::MoveToSleeping  )  [private]
 

Definition at line 346 of file PIDControl7.cc.

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

Referenced by ReadyEffector().

void PIDControl7::NewCommandVectorData  )  [private]
 

Definition at line 208 of file PIDControl7.cc.

References jointID, NUM_JOINTS, and region.

Referenced by DoInit().

void PIDControl7::NotifySensor const ONotifyEvent &  event  ) 
 

Definition at line 161 of file PIDControl7.cc.

References InitSensorIndex(), initSensorIndex, PIDControl7Info::jointIndex, logData, memcpy(), observer, pidControl7Info, pidControl7State, PIDControl7Info::sensorCounter, sensorIndex, and STEP_INPUT_NUM_FRAMES.

void PIDControl7::OpenPrimitives  )  [private]
 

Definition at line 195 of file PIDControl7.cc.

References jointID.

Referenced by DoInit().

void PIDControl7::ReadyEffector const OReadyEvent &  event  ) 
 

Definition at line 89 of file PIDControl7.cc.

References AdjustDiffJointValue(), DisableJointGainOfAllLegs(), InputParameter(), MoveToBroadBase(), MoveToSleeping(), MovingResult, observer, pidControl7State, SaveLogData(), SetJointGain(), StepInput(), and YesNo().

void PIDControl7::SaveLogData  )  [private]
 

Definition at line 531 of file PIDControl7.cc.

References logData.

Referenced by ReadyEffector().

void PIDControl7::SetJointGain  )  [private]
 

Definition at line 240 of file PIDControl7.cc.

References DSHIFT, HEAD_PAN, HEAD_TILT1, HEAD_TILT2, 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, TILT1_DGAIN, TILT1_IGAIN, TILT1_PGAIN, TILT2_DGAIN, TILT2_IGAIN, and TILT2_PGAIN.

Referenced by ReadyEffector().

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

Definition at line 387 of file PIDControl7.cc.

References jointID.

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

void PIDControl7::SetJointValueForStepInput RCRegion *  rgn,
int  idx,
double  val
[private]
 

Definition at line 405 of file PIDControl7.cc.

References jointID, and STEP_INPUT_NUM_FRAMES.

Referenced by StepInput().

MovingResult PIDControl7::StepInput  )  [private]
 

Definition at line 484 of file PIDControl7.cc.

References PIDControl7Info::desiredValue, PIDControl7Info::effectorCounter, FindFreeRegion(), HOLD_TIME_NUM_FRAMES, PIDControl7Info::jointIndex, pidControl7Info, PIDControl7Info::sensorCounter, SetJointValueForStepInput(), and subject.

Referenced by ReadyEffector().

bool PIDControl7::YesNo const char *  prompt  )  [private]
 

Definition at line 509 of file PIDControl7.cc.

Referenced by ReadyEffector().


Member Data Documentation

const int PIDControl7::BROADBASE_MAX_COUNTER = 24 [static, private]
 

Definition at line 221 of file PIDControl7.h.

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

Definition at line 219 of file PIDControl7.h.

Referenced by InputParameter(), and SetJointGain().

const int PIDControl7::HOLD_TIME_NUM_FRAMES = 256 [static, private]
 

Definition at line 225 of file PIDControl7.h.

Referenced by DoInit(), and StepInput().

bool PIDControl7::initSensorIndex [private]
 

Definition at line 234 of file PIDControl7.h.

Referenced by NotifySensor().

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

Definition at line 218 of file PIDControl7.h.

Referenced by InputParameter(), and SetJointGain().

const word PIDControl7::J1_DGAIN = 0x0001 [static, private]
 

Definition at line 203 of file PIDControl7.h.

Referenced by SetJointGain().

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

Definition at line 202 of file PIDControl7.h.

Referenced by SetJointGain().

const word PIDControl7::J1_PGAIN = 0x0010 [static, private]
 

Definition at line 201 of file PIDControl7.h.

Referenced by SetJointGain().

const word PIDControl7::J2_DGAIN = 0x0001 [static, private]
 

Definition at line 207 of file PIDControl7.h.

Referenced by SetJointGain().

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

Definition at line 206 of file PIDControl7.h.

Referenced by SetJointGain().

const word PIDControl7::J2_PGAIN = 0x000a [static, private]
 

Definition at line 205 of file PIDControl7.h.

Referenced by SetJointGain().

const word PIDControl7::J3_DGAIN = 0x0001 [static, private]
 

Definition at line 211 of file PIDControl7.h.

Referenced by SetJointGain().

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

Definition at line 210 of file PIDControl7.h.

Referenced by SetJointGain().

const word PIDControl7::J3_PGAIN = 0x0010 [static, private]
 

Definition at line 209 of file PIDControl7.h.

Referenced by SetJointGain().

OPrimitiveID PIDControl7::jointID[NUM_JOINTS] [private]
 

Definition at line 230 of file PIDControl7.h.

Referenced by AdjustDiffJointValue(), DisableJointGainOfAllLegs(), InitSensorIndex(), InputParameter(), MoveToBroadBase(), NewCommandVectorData(), OpenPrimitives(), PIDControl7(), SetJointGain(), SetJointValue(), and SetJointValueForStepInput().

OJointValue* PIDControl7::logData [private]
 

Definition at line 232 of file PIDControl7.h.

Referenced by DoInit(), NotifySensor(), and SaveLogData().

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

Definition at line 187 of file PIDControl7.h.

OObserver* PIDControl7::observer[numOfObserver]
 

Definition at line 156 of file PIDControl7.h.

Referenced by NotifySensor(), and ReadyEffector().

const word PIDControl7::PAN_DGAIN = 0x0004 [static, private]
 

Definition at line 195 of file PIDControl7.h.

Referenced by SetJointGain().

const word PIDControl7::PAN_IGAIN = 0x0002 [static, private]
 

Definition at line 194 of file PIDControl7.h.

Referenced by SetJointGain().

const word PIDControl7::PAN_PGAIN = 0x0008 [static, private]
 

Definition at line 193 of file PIDControl7.h.

Referenced by SetJointGain().

PIDControl7Info PIDControl7::pidControl7Info [private]
 

Definition at line 228 of file PIDControl7.h.

Referenced by InputParameter(), NotifySensor(), and StepInput().

PIDControl7State PIDControl7::pidControl7State [private]
 

Definition at line 227 of file PIDControl7.h.

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

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

Definition at line 217 of file PIDControl7.h.

Referenced by InputParameter(), and SetJointGain().

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

Definition at line 231 of file PIDControl7.h.

Referenced by FindFreeRegion(), NewCommandVectorData(), and PIDControl7().

int PIDControl7::sensorIndex[NUM_JOINTS] [private]
 

Definition at line 235 of file PIDControl7.h.

Referenced by InitSensorIndex(), NotifySensor(), and PIDControl7().

const int PIDControl7::SLEEPING_MAX_COUNTER = 24 [static, private]
 

Definition at line 222 of file PIDControl7.h.

const int PIDControl7::STEP_INPUT_NUM_FRAMES = 4 [static, private]
 

Definition at line 224 of file PIDControl7.h.

Referenced by NotifySensor(), and SetJointValueForStepInput().

OSubject* PIDControl7::subject[numOfSubject]
 

Definition at line 155 of file PIDControl7.h.

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

const word PIDControl7::TAIL_DGAIN = 0x0004 [static, private]
 

Definition at line 215 of file PIDControl7.h.

const word PIDControl7::TAIL_IGAIN = 0x0004 [static, private]
 

Definition at line 214 of file PIDControl7.h.

const word PIDControl7::TAIL_PGAIN = 0x000a [static, private]
 

Definition at line 213 of file PIDControl7.h.

const word PIDControl7::TILT1_DGAIN = 0x0002 [static, private]
 

Definition at line 191 of file PIDControl7.h.

Referenced by SetJointGain().

const word PIDControl7::TILT1_IGAIN = 0x0004 [static, private]
 

Definition at line 190 of file PIDControl7.h.

Referenced by SetJointGain().

const word PIDControl7::TILT1_PGAIN = 0x000a [static, private]
 

Definition at line 189 of file PIDControl7.h.

Referenced by SetJointGain().

const word PIDControl7::TILT2_DGAIN = 0x000c [static, private]
 

Definition at line 199 of file PIDControl7.h.

Referenced by SetJointGain().

const word PIDControl7::TILT2_IGAIN = 0x0008 [static, private]
 

Definition at line 198 of file PIDControl7.h.

Referenced by SetJointGain().

const word PIDControl7::TILT2_PGAIN = 0x000a [static, private]
 

Definition at line 197 of file PIDControl7.h.

Referenced by SetJointGain().


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