modeCtrl.h
Go to the documentation of this file.00001 #ifndef MODE_CTRL_H
00002 #define MODE_CTRL_H
00003
00013 #include "velocityCtrl.h"
00014
00015
00016 #ifndef NULL
00017 #define NULL 0x0
00018 #endif
00019
00020
00024 typedef struct {
00025 int ctrl;
00026 int straight_ctrl;
00027 int rotate_ctrl;
00028 int pre_straight_ctrl;
00029 int pre_rotate_ctrl;
00030 int follow_r;
00031 } modeInfo_t;
00032
00033
00034 enum {
00035
00036 MODE_NO_CTRL = 0,
00037 MODE_SERVO_CTRL = 1,
00038 MODE_SERVO_FREE,
00039 MODE_DIRECT_CTRL,
00040 MODE_DIRECT_WHEEL_CTRL,
00041
00042
00043 MODE_HOLD_VELOCITY_FIRST = 0x100,
00044 MODE_HOLD_VELOCITY,
00045 MODE_HOLD_POSITION_FIRST,
00046 MODE_HOLD_POSITION,
00047 MODE_STOP_FIRST,
00048 MODE_STOP,
00049
00050
00051 MODE_HOLD_ROTATE_VELOCITY_FIRST = 0x200,
00052 MODE_HOLD_ROTATE_VELOCITY,
00053 MODE_HOLD_ANGLE_FIRST,
00054 MODE_HOLD_ANGLE,
00055 MODE_ROTATE_ANGLE_FIRST,
00056 MODE_ROTATE_ANGLE,
00057 MODE_FOLLOW_LINE_FIRST,
00058 MODE_FOLLOW_LINE,
00059 MODE_FOLLOW_CIRCLE_FIRST,
00060 MODE_FOLLOW_CIRCLE,
00061 MODE_ROTATE_STOP_FIRST,
00062 MODE_ROTATE_STOP,
00063 };
00064
00065
00066
00067 BEGIN_C_DECLS;
00068
00069 extern void initModeInfo(modeInfo_t *mode);
00070 extern int calcStraightRefVel(velocityCtrlInfo_t *velCtrl, modeInfo_t *mode,
00071 bodyPosition_t *bodyPos,
00072 velocityInfo_t *velInfo,
00073 coordinateInfo_t *run_crd);
00074 extern int calcRotateRefVel(velocityCtrlInfo_t *velCtrl, modeInfo_t *mode,
00075 bodyPosition_t *bodyPos, velocityInfo_t *velInfo,
00076 coordinateInfo_t *run_crd);
00077
00078 END_C_DECLS;
00079 #endif
00080