PIDControl Class Reference

#include <PIDControl.h>

List of all members.

Public Member Functions

 PIDControl ()
virtual ~PIDControl ()
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

PIDControlState pidControlState
PIDControlInfo pidControlInfo
OPrimitiveID jointID [NUM_JOINTS]
RCRegion * region [NUM_COMMAND_VECTOR]
OJointValue * logData
bool initSensorIndex
int sensorIndex [NUM_JOINTS]

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
const int STEP_INPUT_NUM_FRAMES = 4
const int HOLD_TIME_NUM_FRAMES = 256


Constructor & Destructor Documentation

PIDControl::PIDControl  ) 
 

Definition at line 18 of file PIDControl.cc.

References jointID, PCS_IDLE, region, and sensorIndex.

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

Definition at line 142 of file PIDControl.h.


Member Function Documentation

MovingResult PIDControl::AdjustDiffJointValue  )  [private]
 

Definition at line 280 of file PIDControl.cc.

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

Referenced by DoStart(), and ReadyEffector().

void PIDControl::DisableJointGainOfAllLegs  )  [private]
 

Definition at line 434 of file PIDControl.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 PIDControl::DoDestroy const OSystemEvent &  event  )  [virtual]
 

Definition at line 80 of file PIDControl.cc.

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

Definition at line 27 of file PIDControl.cc.

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

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

Definition at line 49 of file PIDControl.cc.

References AdjustDiffJointValue(), pidControlState, and subject.

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

Definition at line 67 of file PIDControl.cc.

References pidControlState.

RCRegion * PIDControl::FindFreeRegion  )  [private]
 

Definition at line 375 of file PIDControl.cc.

References region.

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

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

Definition at line 419 of file PIDControl.cc.

References jointID, and sensorIndex.

Referenced by NotifySensor().

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

Definition at line 520 of file PIDControl.cc.

Referenced by InputParameter().

void PIDControl::InputParameter  )  [private]
 

Definition at line 451 of file PIDControl.cc.

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

Referenced by ReadyEffector().

MovingResult PIDControl::MoveToBroadBase  )  [private]
 

Definition at line 302 of file PIDControl.cc.

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

Referenced by ReadyEffector().

MovingResult PIDControl::MoveToSleeping  )  [private]
 

Definition at line 344 of file PIDControl.cc.

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

Referenced by ReadyEffector().

void PIDControl::NewCommandVectorData  )  [private]
 

Definition at line 206 of file PIDControl.cc.

References jointID, NUM_JOINTS, and region.

Referenced by DoInit().

void PIDControl::NotifySensor const ONotifyEvent &  event  ) 
 

Definition at line 159 of file PIDControl.cc.

References InitSensorIndex(), initSensorIndex, PIDControlInfo::jointIndex, logData, memcpy(), observer, pidControlInfo, pidControlState, PIDControlInfo::sensorCounter, sensorIndex, and STEP_INPUT_NUM_FRAMES.

void PIDControl::OpenPrimitives  )  [private]
 

Definition at line 193 of file PIDControl.cc.

References jointID.

Referenced by DoInit().

void PIDControl::ReadyEffector const OReadyEvent &  event  ) 
 

Definition at line 87 of file PIDControl.cc.

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

void PIDControl::SaveLogData  )  [private]
 

Definition at line 529 of file PIDControl.cc.

References logData.

Referenced by ReadyEffector().

void PIDControl::SetJointGain  )  [private]
 

Definition at line 238 of file PIDControl.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 PIDControl::SetJointValue RCRegion *  rgn,
int  idx,
double  start,
double  end
[private]
 

Definition at line 385 of file PIDControl.cc.

References jointID.

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

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

Definition at line 403 of file PIDControl.cc.

References jointID, and STEP_INPUT_NUM_FRAMES.

Referenced by StepInput().

MovingResult PIDControl::StepInput  )  [private]
 

Definition at line 482 of file PIDControl.cc.

References PIDControlInfo::desiredValue, PIDControlInfo::effectorCounter, FindFreeRegion(), HOLD_TIME_NUM_FRAMES, PIDControlInfo::jointIndex, pidControlInfo, PIDControlInfo::sensorCounter, SetJointValueForStepInput(), and subject.

Referenced by ReadyEffector().

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

Definition at line 507 of file PIDControl.cc.

Referenced by ReadyEffector().


Member Data Documentation

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

Definition at line 207 of file PIDControl.h.

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

Definition at line 205 of file PIDControl.h.

Referenced by InputParameter(), and SetJointGain().

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

Definition at line 211 of file PIDControl.h.

Referenced by DoInit(), and StepInput().

bool PIDControl::initSensorIndex [private]
 

Definition at line 220 of file PIDControl.h.

Referenced by NotifySensor().

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

Definition at line 204 of file PIDControl.h.

Referenced by InputParameter(), and SetJointGain().

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

Definition at line 193 of file PIDControl.h.

Referenced by SetJointGain().

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

Definition at line 192 of file PIDControl.h.

Referenced by SetJointGain().

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

Definition at line 191 of file PIDControl.h.

Referenced by SetJointGain().

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

Definition at line 197 of file PIDControl.h.

Referenced by SetJointGain().

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

Definition at line 196 of file PIDControl.h.

Referenced by SetJointGain().

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

Definition at line 195 of file PIDControl.h.

Referenced by SetJointGain().

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

Definition at line 201 of file PIDControl.h.

Referenced by SetJointGain().

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

Definition at line 200 of file PIDControl.h.

Referenced by SetJointGain().

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

Definition at line 199 of file PIDControl.h.

Referenced by SetJointGain().

OPrimitiveID PIDControl::jointID[NUM_JOINTS] [private]
 

Definition at line 216 of file PIDControl.h.

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

OJointValue* PIDControl::logData [private]
 

Definition at line 218 of file PIDControl.h.

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

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

Definition at line 177 of file PIDControl.h.

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

Definition at line 176 of file PIDControl.h.

Referenced by AdjustDiffJointValue(), and NewCommandVectorData().

OObserver* PIDControl::observer[numOfObserver]
 

Definition at line 145 of file PIDControl.h.

Referenced by NotifySensor(), and ReadyEffector().

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

Definition at line 185 of file PIDControl.h.

Referenced by SetJointGain().

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

Definition at line 184 of file PIDControl.h.

Referenced by SetJointGain().

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

Definition at line 183 of file PIDControl.h.

Referenced by SetJointGain().

PIDControlInfo PIDControl::pidControlInfo [private]
 

Definition at line 214 of file PIDControl.h.

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

PIDControlState PIDControl::pidControlState [private]
 

Definition at line 213 of file PIDControl.h.

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

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

Definition at line 203 of file PIDControl.h.

Referenced by InputParameter(), and SetJointGain().

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

Definition at line 217 of file PIDControl.h.

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

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

Definition at line 189 of file PIDControl.h.

Referenced by SetJointGain().

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

Definition at line 188 of file PIDControl.h.

Referenced by SetJointGain().

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

Definition at line 187 of file PIDControl.h.

Referenced by SetJointGain().

int PIDControl::sensorIndex[NUM_JOINTS] [private]
 

Definition at line 221 of file PIDControl.h.

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

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

Definition at line 208 of file PIDControl.h.

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

Definition at line 210 of file PIDControl.h.

Referenced by NotifySensor(), and SetJointValueForStepInput().

OSubject* PIDControl::subject[numOfSubject]
 

Definition at line 144 of file PIDControl.h.

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

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

Definition at line 181 of file PIDControl.h.

Referenced by SetJointGain().

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

Definition at line 180 of file PIDControl.h.

Referenced by SetJointGain().

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

Definition at line 179 of file PIDControl.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