00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef WALKPRIMITIVE_H
00011 #define WALKPRIMITIVE_H
00012
00013 #include "step.h"
00014 #include "nuwalk.h"
00015
00016 struct primitive_t
00017 {
00018 Step* lfirst;
00019 Step* rfirst;
00020 Step* lfollow;
00021 Step* rfollow;
00022 Step* lnormal;
00023 Step* rnormal;
00024 Step* lfstop;
00025 Step* rfstop;
00026 Step* lnstop;
00027 Step* rnstop;
00028 };
00029
00030 class WalkPrimitive
00031 {
00032 public:
00033 WalkPrimitive(StepTypeEnum steptype);
00034 ~WalkPrimitive();
00035
00036 void getInitialPose(float** positions, float** hardnesses);
00037
00038 Step* getStartStep(float direction);
00039 Step* getStartGStep(float direction);
00040 Step* getForwardStep(Step* previousstep, float direction, WalkPrimitive* forwardprimitives);
00041 Step* getTurnStep(Step* previousstep, float direction);
00042 Step* getSideStep(Step* previousstep, float direction);
00043
00044 private:
00045
00046 void loadSteps(string primitivename, unsigned char numvalues, string valuenames[]);
00047 void loadSubPrimitive(unsigned char index, string subprimitivename);
00048 void loadForwardSteps();
00049 void loadArcSteps();
00050 void loadDiagonalSteps();
00051 void loadSidewardSteps();
00052 void loadTurnSteps();
00053 void loadBackwardSteps();
00054
00055 primitive_t* getSubStepFromDirection(float direction);
00056
00057 public:
00058 primitive_t* Steps;
00059 unsigned char StepsLength;
00060 private:
00061 StepTypeEnum StepType;
00062
00063 float StepLeftDirectionToIndex;
00064 float StepRightDirectionToIndex;
00065 unsigned char StepLeftDirectionToIndexOffset, StepRightDirectionToIndexOffset;
00066 unsigned char StepsFirstLeftDirection, StepsLastLeftDirection;
00067 unsigned char StepsFirstRightDirection, StepsLastRightDirection;
00068 };
00069
00070 #endif