Unterschiede zwischen den Revisionen 3 und 10 (über 7 Versionen hinweg)
Revision 3 vom 01.11.2016 12:45
Größe: 8410
Autor: HolgerB
Kommentar:
Revision 10 vom 01.03.2017 13:15
Größe: 9462
Autor: HolgerB
Kommentar:
Gelöschter Text ist auf diese Art markiert. Hinzugefügter Text ist auf diese Art markiert.
Zeile 4: Zeile 4:
= Navigation Data structures = = Navigation Data =
Zeile 8: Zeile 8:
The MK will send differnt data sets. Data that did not change will be sent slower than sets that with changed data content. == Interval ==
This value [10ms] is used when starting the abbo.

10 => send the data every 100ms

== Max Bytes per second ==
This value [bytes per second] is used when starting the abbo.

It is used to keep the used bandwith to a specified (max) level according to the maximum data throughput of the communication interface.

A useful value could be 1024 for a good wireless transmission and 200 for a slow transmission like GSM-Modems etc.

== Index ==
The MK will send differnt data sets automatically.

Data that did not change will be sent more seldom than sets that with changed data content.
Zeile 14: Zeile 29:
{{{
#!cplusplus
 {{{#!cplusplus numbers=off
Zeile 87: Zeile 100:
 u8 OSD_SatState;
Zeile 88: Zeile 102:
u8 reserve2;
Zeile 173: Zeile 186:
{{{
#!cplusplus
{{{#!cplusplus numbers=off
Zeile 196: Zeile 207:

// NaviData_Flags.OSDStatusFlags3 (Index:13 Home-Position) -> use only for flags that change slowly
#define OSD3_FLAG_FIXBIT0 0x01
#define OSD3_FLAG_FIXBIT1 0x02
#define OSD3_FLAG_FIXBIT2 0x04
#define OSD3_FLAG_HOTSHOE 0x08
#define OSD3_FLAG_BOAT_MODE 0x10

-> for Bits OSD3_FLAG_FIXBIT0-2 there are the followig Satfix States possible:
#define OSD_FIX_NONE 0
#define OSD_FIX_2D 1
#define OSD_FIX_3D 2
#define OSD_FIX_DGPS 3
#define OSD_FIX_RTK_FLOAT 4
#define OSD_FIX_RTK_FIX 5
Zeile 197: Zeile 224:

from uart1.h in NaviCtrl code (please take a look at SVN for latest version of header files)

Navigation Data

The MikroKopter will send these data after getting the abbo command 'O' with interval and max bytes per second.

Interval

This value [10ms] is used when starting the abbo.

10 => send the data every 100ms

Max Bytes per second

This value [bytes per second] is used when starting the abbo.

It is used to keep the used bandwith to a specified (max) level according to the maximum data throughput of the communication interface.

A useful value could be 1024 for a good wireless transmission and 200 for a slow transmission like GSM-Modems etc.

Index

The MK will send differnt data sets automatically.

Data that did not change will be sent more seldom than sets that with changed data content.

The different data sets can be identified by the index.

Implementations of the data structure

  • //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    //+ New protocol
    //+ start abbo communication with: 'O' + Interval 1byte [10ms] + MaxBytesPerSecond (2Bytes)
    //+ i.e. 'O'+10+1024
    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    
    typedef struct // Index:10 (15 Bytes need 27 ASCII-characters)
    {
            u8 Index;                       // Index to identify this data set
            s32 ActualLongitude;    // 
            s32 ActualLatitude;             // 
            s16 Altimeter_5cm;              // hight -> devide by 20 to get meters & multiply with 5 to get cm
            u8 GroundSpeed;                 // speed over ground in 10cm/s (2D) (255 = 91km/h)
            u8 OSDStatusFlags;              // see main.h for definitions OSD_FLAG_xxx
            u8 CamCtrlChar;                 // Status from a connected CamCtrl unit: 'R' = REC  'c' = Ready  '!' = Error  ...etc
    u8 reserve1;                     
    } __attribute__((packed)) NaviData_Tiny_t;
    extern NaviData_Tiny_t NaviData_Tiny;
    
    #define START_PAYLOAD_DATA  13  // 
    
    typedef struct  // Index:11 (24 Bytes need 39 ASCII-characters)
    {
            u8 Index;                       // Index to identify this data set
            s32 ActualLongitude;    // 
            s32 ActualLatitude;             // 
            s16 Altimeter_5cm;              // hight -> devide by 20 to get meters & multiply with 5 to get cm 
            u8 GroundSpeed;                 // speed over ground in 10cm/s (2D) (255 = 91km/h)
            u8 OSDStatusFlags;              // see main.h for definitions OSD_FLAG_xxx
            u8 OSDStatusFlags2;             // see main.h for definitions OSD_FLAG2_xxx
            u8  NCFlags;                    // Flags from NC
    u8 ReserveFlags;
            u8  Errorcode;                  // 0 --> okay  see http://wiki.mikrokopter.de/ErrorCodes
            u8 SpeakHoTT;                   // voice output SPEAK_xxx (see spi_slave.h)
            u8 VarioCharacter;              // display as ascii character ('+' = 'climb' etc)
            u8 GPS_ModeCharacter;   // display as ascii character ('H' = 'Home' etc)
            u8 BL_MinOfMaxPWM;              // status byte of the BL-Ctrls
    } __attribute__((packed)) NaviData_Flags_t;
    extern NaviData_Flags_t NaviData_Flags;
    
    typedef struct  // Index:12  (27 Bytes need 43 ASCII-characters)
    {
            u8 Index;                       // Index to identify this data set
            s32 ActualLongitude;    // 
            s32 ActualLatitude;             // 
            s16 Altimeter_5cm;              // hight -> devide by 20 to get meters & multiply with 5 to get cm
            u8 GroundSpeed;                 // speed over ground in 10cm/s (2D) (255 = 91km/h)
            u8 OSDStatusFlags;              // see main.h for definitions OSD_FLAG_xxx
            s32 TargetLongitude;    // 
            s32 TargetLatitude;             // 
            s16 TargetAltitude;     // hight according to air pressure
            u8  RC_Quality;                 // RC_Quality
    } __attribute__((packed)) NaviData_Target_t;
    extern NaviData_Target_t NaviData_Target;
    
    typedef struct  // Index:13  (30 Bytes need 47 ASCII-characters)
    {                                          
            u8 Index;                       // Index to identify this data set
            s32 ActualLongitude;    // 
            s32 ActualLatitude;             // 
            s16 Altimeter_5cm;              // hight -> devide by 20 to get meters & multiply with 5 to get cm
            u8 GroundSpeed;                 // speed over ground in 10cm/s (2D) (255 = 91km/h)
            u8 OSDStatusFlags;              // see main.h for definitions OSD_FLAG_xxx
            s32 HomeLongitude;              // 
            s32 HomeLatitude;               // 
            s16 HomeAltitude;               // hight according to air pressure
            u16 WP_OperatingRadius; // current WP operation radius around the Home Position in m
            u8 LipoCellCount;
            u8 DescendRange;                // in [10m]
            u8 ManualFlyingRange;   // in [10m]
            u8 OSD_SatState;
    u8 reserve1;
    } __attribute__((packed)) NaviData_Home_t;
    extern NaviData_Home_t NaviData_Home;
    
    typedef struct   // Index:14    (24 Bytes need 39 ASCII-characters)
    {
            u8 Index;                       // Index to identify this data set
            s32 ActualLongitude;    // 
            s32 ActualLatitude;             // 
            s16 Altimeter_5cm;              // hight -> devide by 20 to get meters & multiply with 5 to get cm
            u8 GroundSpeed;                 // speed over ground in 10cm/s (2D) (255 = 91km/h)
            u8 OSDStatusFlags;              // see main.h for definitions OSD_FLAG_xxx
            u16 FlyingTime;                 // in seconds
            u16 DistanceToHome;             // [10cm] (100 = 10m)
            u8  HeadingToHome;              // in 2° (100 = 200°)
            u16 DistanceToTarget;   // [10cm] (100 = 10m)   
            u8  HeadingToTarget;    // in 2° (100 = 200°)
            s8  AngleNick;                  // current Nick angle in 1°
            s8  AngleRoll;                  // current Rick angle in 1°
            u8  SatsInUse;                  // number of satellites used for position solution
    } __attribute__((packed)) NaviData_Deviation_t;
    extern NaviData_Deviation_t NaviData_Deviation;
    
    typedef struct // Index:15 (18 Bytes need 31 ASCII-characters)
    {
            u8 Index;                       // Index to identify this data set
            s32 ActualLongitude;    // 
            s32 ActualLatitude;             // 
            s16 Altimeter_5cm;              // hight -> devide by 20 to get meters & multiply with 5 to get cm
            u8  GroundSpeed;                // speed over ground in 10cm/s (2D) (255 = 91km/h)
            u8 OSDStatusFlags;              // see main.h for definitions OSD_FLAG_xxx
            u8  WaypointIndex;              // index of current waypoints running from 0 to WaypointNumber-1
            u8  WaypointNumber;             // number of stored waypoints
            u8  TargetHoldTime;             // time in s to stay at the given target, counts down to 0 if target has been reached
            u8 WP_Eventchannel;             // the current value of the event channel
    u8 reserve;
    } __attribute__((packed)) NaviData_WP_t;
    extern NaviData_WP_t NaviData_WP;
    
    typedef struct // Index:16  (27 Bytes need 43 ASCII-characters)
    {
            u8 Index;                       // Index to identify this data set
            s32 ActualLongitude;    // 
            s32 ActualLatitude;             // 
            s16 Altimeter_5cm;              // hight -> devide by 20 to get meters & multiply with 5 to get cm
            u8 GroundSpeed;                 // speed over ground in 10cm/s (2D) (255 = 91km/h)
            u8 OSDStatusFlags;              // see main.h for definitions OSD_FLAG_xxx
            u16 UBat;                               // Battery Voltage in 0.1 Volts
            u16 Current;                    // actual current in 0.1A steps
            u16 UsedCapacity;               // used capacity in mAh
            s8  Variometer;                 // climb(+) and sink(-) rate
            u8  Heading;                    // Current moving direction in 2° (100 = 200°)
            u8      CompassHeading;         // current compass value in 2°
            u8  Gas;                                // current gas (thrust)
            u16 ShutterCounter;             // counts every time a Out1 was activated
            s16 SetpointAltitude;   // setpoint for altitude
    } __attribute__((packed)) NaviData_Volatile_t;
    extern NaviData_Volatile_t NaviData_Volatile;
    
    
    typedef struct  // Index:17  (21 Bytes need 35 ASCII-characters)
    {
            u8 Index;                       // Index to identify this data set
            s32 ActualLongitude;    // 
            s32 ActualLatitude;             // 
            s16 Altimeter_5cm;              // hight -> devide by 20 to get meters & multiply with 5 to get cm
            u8 GroundSpeed;                 // speed over ground in 10cm/s (2D) (255 = 91km/h)
            u8 OSDStatusFlags;              // see main.h for definitions OSD_FLAG_xxx
            s32 Longitude;                  // Failsafe-Position
            s32 Latitude;                   // Failsafe-Position
    } __attribute__((packed)) NaviData_FS_Pos_t;
    extern NaviData_FS_Pos_t NaviData_Failsafe;
    
    typedef struct // Index:18  (9 Bytes need 19 ASCII-characters)
    {
            u8 Index;                               // Index to identify this data set
            s32 Longitude;                  // Trigger Position
            s32 Latitude;                   // Trigger Position
    } __attribute__((packed)) NaviData_Out_t;
    extern NaviData_Out_t NaviData_Out1Trigger;
    

OSD flags definitions

// xxx.OSDStatusFlags   (multiple data sets)    -> this is the definition in the OSD data structure 
#define OSD_FLAG_CAREFREE               0x01
#define OSD_FLAG_ALTITUDE_CONTROL       0x02
#define OSD_FLAG_CALIBRATE              0x04
#define OSD_FLAG_OUT1_ACTIVE            0x08
#define OSD_FLAG_OUT2_ACTIVE            0x10
#define OSD_FLAG_LOWBAT                 0x20
#define OSD_FLAG_VARIO_TRIM_UP          0x40
#define OSD_FLAG_VARIO_TRIM_DOWN        0x80

// NaviData_Flags.OSDStatusFlags2 (Index:11)    -> this is the definition in the OSD data structure 
#define OSD2_FLAG_MOTOR_RUN             0x01
#define OSD2_FLAG_FLY                   0x02
#define OSD2_FLAG_RC_FAILSAVE_ACTIVE    0x04
#define OSD2_FLAG_START                 0x08
#define OSD2_FLAG_EMERGENCY_LANDING     0x10
#define OSD2_FLAG_WAIT_FOR_TAKEOFF      0x20   // Motor Running, but still on the ground
#define OSD2_FLAG_AUTO_STARTING         0x40
#define OSD2_FLAG_AUTO_LANDING          0x80

// NaviData_Flags.OSDStatusFlags3 (Index:13 Home-Position) -> use only for flags that change slowly 
#define OSD3_FLAG_FIXBIT0                                       0x01
#define OSD3_FLAG_FIXBIT1                                       0x02
#define OSD3_FLAG_FIXBIT2                                       0x04
#define OSD3_FLAG_HOTSHOE                                       0x08
#define OSD3_FLAG_BOAT_MODE                                     0x10

-> for Bits OSD3_FLAG_FIXBIT0-2 there are the followig Satfix States possible:
#define OSD_FIX_NONE                                                    0
#define OSD_FIX_2D                                                      1
#define OSD_FIX_3D                                                      2
#define OSD_FIX_DGPS                                                    3
#define OSD_FIX_RTK_FLOAT                                               4
#define OSD_FIX_RTK_FIX                                                 5