comm.h
Go to the documentation of this file.
00001 #ifndef COMM_H
00002 #define COMM_H
00003 
00004 // KF packet bits
00005 
00006 #define MAV_KF_X_BIT           0
00007 #define MAV_KF_Y_BIT           1
00008 #define MAV_KF_Z_BIT           2
00009 #define MAV_KF_ROLL_BIT        3
00010 #define MAV_KF_PITCH_BIT       4
00011 #define MAV_KF_YAW_BIT         5
00012 #define MAV_KF_RESET_BIT       7
00013 
00014 // LL_CMD packet bits
00015 
00016 #define MAV_LL_CMD_PITCH_BIT        0
00017 #define MAV_LL_CMD_ROLL_BIT         1
00018 #define MAV_LL_CMD_YAW_RATE_BIT     2
00019 #define MAV_LL_CMD_THRUST_BIT       3
00020 #define MAV_LL_CMD_HEIGHT_BIT       4
00021 #define MAV_LL_CMD_GPS_BIT          5
00022 
00023 #define MAV_LL_CMD_ROLL_MASK         (1<<MAV_LL_CMD_ROLL_BIT)
00024 #define MAV_LL_CMD_PITCH_MASK        (1<<MAV_LL_CMD_PITCH_BIT)
00025 #define MAV_LL_CMD_YAW_RATE_MASK     (1<<MAV_LL_CMD_YAW_RATE_BIT)
00026 #define MAV_LL_CMD_THRUST_MASK       (1<<MAV_LL_CMD_THRUST_BIT)
00027 #define MAV_LL_CMD_HEIGHT_MASK       (1<<MAV_LL_CMD_HEIGHT_BIT)
00028 #define MAV_LL_CMD_GPS_MASK          (1<<MAV_LL_CMD_GPS_BIT)
00029 
00030 #define MAV_LL_CMD_RPYT_MASK (MAV_LL_CMD_ROLL_MASK || MAV_LL_CMD_PITCH_MASK || MAV_LL_CMD_YAW_RATE_MASK || MAV_LL_CMD_THRUST_MASK)
00031 
00032 // defaukt serial baudrate speed
00033 
00034 #define MAV_DEFAULT_BAUDRATE                    460800
00035 
00036 // packet transmit periods (in ms)
00037 
00038 /*
00039 #define MAV_DEFAULT_TX_PERIOD_POSE                   5
00040 #define MAV_DEFAULT_TX_PERIOD_IMU                   20
00041 #define MAV_DEFAULT_TX_PERIOD_FLIGHT_STATE          20
00042 #define MAV_DEFAULT_TX_PERIOD_RCDATA               100
00043 #define MAV_DEFAULT_TX_PERIOD_STATUS               100
00044 #define MAV_DEFAULT_TX_PERIOD_CTRL_DEBUG           100
00045 
00046 // packet transmit phases (in ms)
00047 #define MAV_DEFAULT_TX_PHASE_POSE                   1
00048 #define MAV_DEFAULT_TX_PHASE_IMU                   10
00049 #define MAV_DEFAULT_TX_PHASE_FLIGHT_STATE          15
00050 #define MAV_DEFAULT_TX_PHASE_RCDATA                 3
00051 #define MAV_DEFAULT_TX_PHASE_STATUS                57
00052 #define MAV_DEFAULT_TX_PHASE_CTRL_DEBUG            77
00053 */
00054 
00055 // flight actions
00056 #define MAV_ACTION_ESTOP                                                                0x00
00057 #define MAV_ACTION_ADVANCE_STATE                                                        0x01
00058 #define MAV_ACTION_RETREAT_STATE                                                        0x02
00059 #define MAV_ACTION_TOGGLE_ENGAGE                                                        0x03
00060 #define MAV_ACTION_TAKEOFF                                                              0x04
00061 #define MAV_ACTION_LAND                                                     0x05
00062 
00063 // flight states
00064 #define MAV_STATE_OFF                                                                           0x00
00065 #define MAV_STATE_ENGAGING                      0x01
00066 #define MAV_STATE_DISENGAGING                   0x02
00067 #define MAV_STATE_IDLE                                                                          0x03
00068 #define MAV_STATE_LANDING                                                                       0x04
00069 #define MAV_STATE_FLYING                        0x05
00070 #define MAV_STATE_ERROR                                                                         0xFF
00071 
00072 // control modes - for the RPYT axis controllers
00073 #define MAV_CTRL_MODE_DISABLED      0x00
00074 #define MAV_CTRL_MODE_DIRECT        0x01
00075 #define MAV_CTRL_MODE_POSITION      0x02
00076 #define MAV_CTRL_MODE_VELOCITY      0x03
00077 
00078 // defines that a packet has to be acknowledged when received
00079 
00080 #define MAV_COMM_ACK                0x01
00081 
00082 #endif // COMM_H


mav_common
Author(s): Ivan Dryanovski
autogenerated on Thu Jan 2 2014 11:28:00