MKDefines.hpp
Go to the documentation of this file.
00001 /*
00002  * MKDefines.hpp
00003  *
00004  *  Created on: Nov 23, 2011
00005  *      Author: mriedel
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 // ACTIVEDATA
00016 #define ACTIVEDATA_SIZE 10
00017 //#define NR_MKDATA 42 // nr of Values
00018 
00019 //namespace TELEKYB_NAMESPACE {
00020 
00021 // Type Definition of Mikrokopterdata
00022 typedef char MKChar;
00023 typedef short int MKInt;
00024 //typedef unsigned short int MKUInt;
00025 
00026 
00027 struct MKActiveValues{
00028         MKInt values[ACTIVEDATA_SIZE];
00029 };
00030 // Chars!!!
00031 struct MKActiveIDs{
00032         MKChar ids[ACTIVEDATA_SIZE];
00033 };
00034 
00035 // Value only ID
00036 //struct MKSingleIdPacket{
00037 //      MKInt id;
00038 //};
00039 
00040 // Value: ID and Value
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         // NULL Initialized
00058         MKCommandsPacket(){
00059                 pitch = 0;
00060                 roll = 0;
00061                 yawrate = 0;
00062                 thrust = 0;
00063         }
00064 };
00065 
00066 
00067 // operators
00068 bool operator==(const MKActiveIDs& lhs, const MKActiveIDs& rhs);
00069 
00070 bool operator==(const MKSingleValuePacket& lhs, const MKSingleValuePacket& rhs);
00071 
00072 // functions
00073 bool isValidMKActiveIDs(const MKActiveIDs& activeIDs);
00074 
00075 TELEKYB_ENUM(MotorState,
00076                 (Init) // 0
00077                 (On) // 1
00078                 (Emer) // 2
00079                 (Off) // 3
00080                 (UnDef) // don;t use this one
00081 )
00082 
00083 TELEKYB_ENUM(MKDataPattern,
00084                 (RawImuAttEst)
00085                 (CompFilt)
00086                 (Stats)
00087                 (AccOffsetGyroDrift)
00088                 (Default) // 0-9.
00089 )
00090 
00091 //
00092 enum SendQueue {
00093         SENDQUEUE_ACTIVEDATAIDS,
00094         SENDQUEUE_SET,
00095         SENDQUEUE_UPDATE,
00096         SENDQUEUE_SIZE
00097 };
00098 
00099 
00100 // Unfortunately TELEKYB_ENUM cannot handle 42 values. e.g. Eclipse cannot handle them. -> old school endum
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 //      "RawAccX",//0
00174 //      "RawAccY",//1
00175 //      "RawAccZ",//2
00176 //      "RawGyroX",//3
00177 //      "RawGyroY",//4
00178 //      "RawGyroZ",//5
00179 //
00180 //      "AccX",//6
00181 //      "AccY",//7
00182 //      "AccZ",//8
00183 //      "OmegaX",//9
00184 //      "OmegaY",//10
00185 //      "OmegaZ",//11
00186 //
00187 //      "BattVolt",//12
00188 //
00189 //      "OffsRAccX",//13
00190 //      "OffsRAccY",//14
00191 //      "OffsRAccZ",//15
00192 //      "GyrDriftX",//16
00193 //      "GyrDriftY",//17
00194 //      "GyrDriftZ",//18
00195 //
00196 //      "EstPitch",//19
00197 //      "EstRoll",//20
00198 //      "EstPitRat",//21
00199 //      "EstRolRat",//22
00200 //
00201 //      "PropGain",//23
00202 //      "DerivGain",//24
00203 //      "IntegGain",//25
00204 //      "YawRatGain",//26
00205 //      "YawAccGain",//27
00206 //
00207 //      "YawCtrTyp",//28
00208 //      "MirrPriod",//29
00209 //
00210 //      "TimeMs60",//30
00211 //
00212 //      "MirrActiv",//31
00213 //
00214 //      "MotState",//32
00215 //
00216 //      "DriftActiv",//33
00217 //
00218 //      "RcvCmdSec",//34
00219 //      "MaxRcvPer",//35
00220 //      "SenPktSec",//36
00221 //      "MaxSenPer",//37
00222 //      "FcStepSec",//38
00223 //      "MaxFcPer",//39
00224 //
00225 //      "RobotId",//40
00226 //      "FirmRev"//41
00227 //};
00228 
00229 
00230 
00231 
00232 //}
00233 
00234 #endif /* MKDEFINES_HPP_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


telekyb_defines
Author(s): Dr. Antonio Franchi and Martin Riedel
autogenerated on Mon Nov 11 2013 11:12:30