User`s manual

AscTec Hummingbird with AutoPilot User’s Manual
GPS Data Advanced: GPS data + position and
speed estimates after data fusion
The data structures in detail are shown in Appendix
C.
There is a unique packet descriptor/ID for every struc-
ture. Here is a list of all packet descriptors used in the
system:
//packet descriptors
#define PD_IMURAWDATA 0x01
#define PD_LLSTATUS 0x02
#define PD_IMUCALCDATA 0x03
#define PD_HLSTATUS 0x04
#define PD_DEBUGDATA 0x05
#define PD_CTRLOUT 0x11
#define PD_FLIGHTPARAMS 0x12
#define PD_CTRLCOMMANDS 0x13
#define PD_CTRLINTERNAL 0x14
#define PD_RCDATA 0x15
#define PD_CTRLSTATUS 0x16
#define PD_CTRLINPUT 0x17
#define PD_CTRLFALCON 0x18
#define PD_WAYPOINT 0x20
#define PD_CURRENTWAY 0x21
#define PD_NMEADATA 0x22
#define PD_GPSDATA 0x23
#define PD_SINGLEWAYPOINT 0x24
#define PD_GOTOCOMMAND 0x25
#define PD_LAUNCHCOMMAND 0x26
#define PD_LANDCOMMAND 0x27
#define PD_HOMECOMMAND 0x28
#define PD_GPSDATAADVANCED 0x29
All structures are sent as follows:
startstring: >*>
length of structure: unsigned short
packet descriptor: unsigned char
the actual data structure: ”length of structure” bytes
crc16: unsigned short
stopstring: <#<
CRC16 algorithm
unsigned short crc_update (unsigned
short crc, unsigned char data)
{
data ˆ= (crc & 0xff);
data ˆ= data << 4;
return ((((unsigned short) data <<
8) | ((crc>>8)&0xff)) ˆ (unsigned
char) (data >> 4) ˆ ((unsigned
short) data << 3));
}
unsigned short crc16(void
*
data,
unsigned short cnt)
{
unsigned short crc=0xff;
unsigned char
*
ptr=(unsigned char
*
) data;
int i;
for (i=0;i<cnt;i++)
{
crc=crc_update(crc,
*
ptr);
ptr++;
}
return crc;
}
example use:
unsigned short checksum=crc16(&
IMU_CalcData, sizeof(IMU_CalcData))
;
Requesting (polling) data structures
The user can select the desired data structures by sen-
ding the following string to the vehicle.
>*>p[unsigned short packets]
The following bits set in ”packets” request a data
structure:
0x0001 LL
Status
0x0002 IMU
RawData
0x0004 IMU
CalcData
0x0008 RC
Data
0x0010 CTRL
Out
0x0080 GPS
Data
0x0100 current
way
0x0200 GPS
Data Advanced
0x0800 CAM
Data
Please note that you can set as many bits at a time
as required in your application. The vehicle will then
Ascending Technologies GmbH - 16 - www.asctec.de