TUM/2016/ppc/README.mkd

107 lines
2.2 KiB
Markdown
Raw Permalink Normal View History

# Prerequisites
To be able to compile your solutions and execute the tests, you will need the following:
- working gcc compiler
- working ruby installation
- rubygems: rake and bake-toolkit
## Install the bake tool
2016-06-28 10:27:27 +02:00
see https://esrlabs.github.io/bake/
2016-07-03 23:18:54 +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
**Beware that the system you are running your code on will not support floating point operations.
Use only unsigned and signed integers!**
Still the precision of your calculations has to be +-100 milli-arc-seconds
Dynamic allocation is not supported on the system.
You will have to complete the *GpsConverter.cpp* (and .h).
2016-07-04 17:46:39 +02:00
## Conversion between Arc-Degree and arc-milliseconds
2016-07-04 17:51:21 +02:00
1<>2'5" == (1*3600+ 2*60 + 5)*1000
2016-07-03 23:18:54 +02:00
2016-07-04 17:46:39 +02:00
## Conversion of raw values to Arc-Degree
2016-07-03 23:18:54 +02:00
2016-07-04 17:51:21 +02:00
value [degree] = 180/(2^31-1) * value[raw]
2016-07-03 23:18:54 +02:00
#### HINT 1
2016-07-04 17:46:39 +02:00
Try to use constants as much as possible, instead of computing stuff on the go.
2016-07-03 23:18:54 +02:00
#### HINT 2
2016-07-04 17:46:39 +02:00
In order to avoid losing decimals first, multiply with a large factor and then divide to get the result in ms.
2016-07-03 23:18:54 +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)
2016-07-04 17:46:39 +02:00
# Signal Descriptions
2016-07-03 23:18:54 +02:00
## Status Longitude Navigation
ST_LONG_NAVI
### Possible Values
-180<38> ... +180<38>
### Signal type
32 Bit Signed Integer (Byte 0 ... Byte 3)
### Invalid Data
Invalid-Value: 80 00 00 00
Signal not available value: 7F FF FF FF and FF FF FF FF
**Do not forget to check for these values**
## Status Latitude Navigation
ST_LAT_NAVI
### Possible Values
-180<38> ... +180<38>
### Signal type
32 Bit Signed Integer (Byte 4 ... Byte 7)
### Invalid Data
Invalid-Value: 80 00 00 00
Signal not available value: 7F FF FF FF and FF FF FF FF
2016-07-04 17:46:39 +02:00
# Tests
Use the rake file in the "ppc" folder to build your project and run the tests
## Building the project
2016-07-03 23:18:54 +02:00
2016-07-04 17:46:39 +02:00
execute `rake build` from this directory
2016-07-03 23:18:54 +02:00
## Running the tests
execute `rake run` from this directory