00001
00002
00003
00004
00005
00006
00007
00008 #ifndef MKDEFINES_HPP_
00009 #define MKDEFINES_HPP_
00010
00011 #include <telekyb_defines/telekyb_defines.hpp>
00012 #include <telekyb_defines/telekyb_enums.hpp>
00013
00014
00015
00016 #define ACTIVEDATA_SIZE 10
00017
00018
00019
00020
00021
00022 typedef char MKChar;
00023 typedef short int MKInt;
00024
00025
00026
00027 struct MKActiveValues{
00028 MKInt values[ACTIVEDATA_SIZE];
00029 };
00030
00031 struct MKActiveIDs{
00032 MKChar ids[ACTIVEDATA_SIZE];
00033 };
00034
00035
00036
00037
00038
00039
00040
00041 struct MKSingleValuePacket{
00042 MKInt id;
00043 MKInt value;
00044
00045 MKSingleValuePacket(MKInt id_, MKInt value_) {
00046 id = id_;
00047 value = value_;
00048 }
00049 };
00050
00051 struct MKCommandsPacket {
00052 MKChar pitch;
00053 MKChar roll;
00054 MKChar yawrate;
00055 MKChar thrust;
00056
00057
00058 MKCommandsPacket(){
00059 pitch = 0;
00060 roll = 0;
00061 yawrate = 0;
00062 thrust = 0;
00063 }
00064 };
00065
00066
00067
00068 bool operator==(const MKActiveIDs& lhs, const MKActiveIDs& rhs);
00069
00070 bool operator==(const MKSingleValuePacket& lhs, const MKSingleValuePacket& rhs);
00071
00072
00073 bool isValidMKActiveIDs(const MKActiveIDs& activeIDs);
00074
00075 TELEKYB_ENUM(MotorState,
00076 (Init)
00077 (On)
00078 (Emer)
00079 (Off)
00080 (UnDef)
00081 )
00082
00083 TELEKYB_ENUM(MKDataPattern,
00084 (RawImuAttEst)
00085 (CompFilt)
00086 (Stats)
00087 (AccOffsetGyroDrift)
00088 (Default)
00089 )
00090
00091
00092 enum SendQueue {
00093 SENDQUEUE_ACTIVEDATAIDS,
00094 SENDQUEUE_SET,
00095 SENDQUEUE_UPDATE,
00096 SENDQUEUE_SIZE
00097 };
00098
00099
00100
00101 class MKDataDefines
00102 {
00103 public:
00104
00105 enum MKIntMapping {
00106 MKINT_LOGICAL_OFF = 0,
00107 MKINT_LOGICAL_ON = 1
00108 };
00109
00110 enum MKDataIds{
00111 RAW_ACC_X = 0,
00112 RAW_ACC_Y = 1,
00113 RAW_ACC_Z = 2,
00114 RAW_GYRO_X = 3,
00115 RAW_GYRO_Y = 4,
00116 RAW_GYRO_Z = 5,
00117
00118 ACC_X = 6,
00119 ACC_Y = 7,
00120 ACC_Z = 8,
00121 OMEGA_X = 9,
00122 OMEGA_Y = 10,
00123 OMEGA_Z = 11,
00124
00125 BATT_VOLT = 12,
00126
00127 OFFSET_RAW_ACC_X = 13,
00128 OFFSET_RAW_ACC_Y = 14,
00129 OFFSET_RAW_ACC_Z = 15,
00130 DRIFT_GYRO_X = 16,
00131 DRIFT_GYRO_Y = 17,
00132 DRIFT_GYRO_Z = 18,
00133
00134 PITCH = 19,
00135 ROLL = 20,
00136 PITCH_RATE = 21,
00137 ROLL_RATE = 22,
00138
00139 PROP_GAIN = 23,
00140 DERIV_GAIN = 24,
00141 INTEG_GAIN = 25,
00142 YAW_RATE_GAIN = 26,
00143 YAW_ACC_GAIN = 27,
00144
00145 YAW_CTRL_TYPE = 28,
00146 MIRROR_TIME_PERIOD = 29,
00147
00148 TIME_MS_MOD_60S = 30,
00149
00150 MIRROR_DATA_ACTIVE = 31,
00151
00152 MOTOR_STATE = 32,
00153
00154 DRIFT_ESTIM_ACTIVE = 33,
00155
00156 RCVD_CMD_PER_SEC = 34,
00157 MAX_RCVD_PERIOD_MS = 35,
00158 SENT_PKT_PER_SEC = 36,
00159 MAX_SENT_PERIOD_MS = 37,
00160
00161 CTRL_STEPS_PER_SEC = 38,
00162 MAX_FLIGHT_CTRL_PERIOD_MS = 39,
00163
00164 ROBOT_ID = 40,
00165 FIRMWARE_REVISION = 41,
00166
00167 MKDATAIDS_NUM = 42
00168 };
00169
00170 static const char* MKDATAIDS_NAMES[MKDATAIDS_NUM];
00171 };
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234 #endif