TUM/2015/ppc/README.mkd

97 lines
1.9 KiB
Markdown
Raw Normal View History

2015-06-22 19:14:46 +02:00
# GPS on CAN
In this task you will need to receive Can-frames on the can-bus that contain the GPS location of the
vehicle. The raw data has to be converted to arc-milliseconds
1°2'5" == (1*3600+ 2*60 + 5)*1000
2015-06-30 15:50:54 +02:00
**Beware that the system you are running your code on will not support floating point operations.
Use only unsigned and signed integers!**
2015-06-22 19:14:46 +02:00
Still the precision of your calculations has to be +-100 milli-arc-seconds
2015-06-30 15:50:54 +02:00
Dynamic allocation is not supported on the system.
You will have to complete the *GpsConverter.cpp* (and .h).
2015-06-22 19:14:46 +02:00
## Conversion to Arc-Degree
inDegree hex = 180/(2^31-1) * (hex) [°]
2015-06-30 15:50:54 +02:00
#### HINT 1
Try to use constants as much as possible, isntead of computing stuff on the go.
#### HINT 2
In order to aviod losing decimals first multiply with a large factor and then divide to get the result in ms.
2015-06-22 19:14:46 +02:00
## GPS Datalayout in CAN Message
Byte7 ST_LAT_NAVI
Byte6 ST_LAT_NAVI
Byte5 ST_LAT_NAVI
Byte4 ST_LAT_NAVI
Byte3 ST_LONG_NAVI
Byte2 ST_LONG_NAVI
Byte1 ST_LONG_NAVI
Byte0 ST_LONG_NAVI
## Byteorder
Little Endian (Least Significant Byte is at lowest address)
## Status Longitude Navigation
ST_LONG_NAVI
### Possible Values
-180° ... +180°
2015-06-30 15:50:54 +02:00
### Signal type
2015-06-22 19:14:46 +02:00
32 Bit Signed Integer (Byte 0 ... Byte 3)
### Invalid Data
Invalid-Value: 80 00 00 00h
2015-06-30 15:50:54 +02:00
2015-06-22 19:14:46 +02:00
Signal not available value: 7F FF FF FF
2015-06-30 15:50:54 +02:00
**Do not forget to check for these values**
2015-06-22 19:14:46 +02:00
## Status Latitude Navigation
ST_LAT_NAVI
### Possible Values
-180° ... +180°
2015-06-30 15:50:54 +02:00
### Signal type
2015-06-22 19:14:46 +02:00
32 Bit Signed Integer (Byte 4 ... Byte 7)
### Invalid Data
Invalid-Value: 80 00 00 00h
Signal not available value: 7F FF FF FF
2015-06-30 15:50:54 +02:00
## Send the data over to the AC
2015-06-22 19:14:46 +02:00
2015-06-30 15:50:54 +02:00
Use the *IGpsACPusher*.
2015-06-22 19:14:46 +02:00
2015-06-30 15:50:54 +02:00
## Running the tests
2015-06-22 19:14:46 +02:00
2015-06-30 15:50:54 +02:00
you will need a working ruby installation to execute the tests
2015-06-22 19:14:46 +02:00
### run the tests
execute `rake run` from this directory
2015-06-30 15:50:54 +02:00
### Install the bake tool
see https://esrlabs.com/gems/doc/bake-toolkit/