This commit is contained in:
Andrei Bechet 2015-07-01 08:44:21 +02:00
commit a205f55d01
4 changed files with 57 additions and 10 deletions

View file

@ -7,3 +7,5 @@ You are part of a 4 member team. Your task is to enhance the usability of our ca
location data will come from the application developed by your fellow teammates, on the other controller of the system. In order to display a popup on the headunit you will have to implement an AIDL. To help the development process you will use a test framework which will give you fake location data and will test that you have displayed or hidden the popup accordingly. You will also have the possibility to check this in the android simulator by observing a notification in the task bar when the “current” location will be outside of the given geofence.
For both tasks you have 2 hours, hence your team will be split into two sub-teams in order to tackle these different controllers. A valid result will contain working solutions for both tasks. When everything is working you will see your solution running on the latest car-sharing DriveNow system in a BMW i3. Good luck!
![idea](https://raw.githubusercontent.com/esrlabs/TUM/master/2015/idea.png)

View file

@ -24,7 +24,31 @@ bindService(headUnitServiceIntent, serviceConnection_object, BIND_AUTO_CREATE);
The first step is to implement a circle geofence. You cannot use the google API because that is part of the play API, and it is not supported by our android controller. You have included in the test suite a test class for the circle geofence to help you.
The second step is to display a popup if the current location is outside of a given geofence (alternatively to close if the location is inside). If this is correctly implemented than all the tests should be green (**Note** that unless you are going for the bonus you should disable the test in the *PolygonGeofenceTest* class).
The second step is to display a popup if the current location is outside of a given geofence (alternatively to close if the location is inside). If this is correctly implemented than all the tests should be green (**Note** that unless you are going for the bonus you should disable the test in the *PolygonGeofenceTest* class with *@Ignore* in front of the *@Test*).
For the circle geofence you should use this location as the center and radius of :
(48.262596, 11.668720) and radius of 25 meters
## Observations
In order to ease testing dependancy injection has been used. That means to pass the objects our class will use via a constructor. In android, services are not constructed by the user, instead they are built internally. The needed things for the service to run are instantated during the *onCreate()* call. The constructor in the code is there just for testing purposes. For the functioning of the service you should do the following:
```java
if (locationManager == null) {
locationManager = (LocationManager)
this.getSystemService(Context.LOCATION_SERVICE);
}
```
and
```java
if (geofence == null) {
geofence = myGeofence(...);
}
```
## **Bonus** Implement a polygon geofence instead
@ -38,4 +62,8 @@ Use the slope of a straight line in order to tell if the ray starting from the g
90 + (90 - Math.abs(angle))
```
For the polygon geofence you should use the following locations as the polygon's cornerns:
(48.262739, 11.668393), (48.262674, 11.668956), (48.262100, 11.668419), (48.262324, 11.670174)

BIN
2015/idea.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View file

@ -6,15 +6,27 @@ vehicle. The raw data has to be converted to arc-milliseconds
1°2'5" == (1*3600+ 2*60 + 5)*1000
Beware that the system you are running your code on will not support floating point operations.
Use only unsigned and signed integers!
**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).
## Conversion to Arc-Degree
inDegree hex = 180/(2^31-1) * (hex) [°]
#### 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.
## GPS Datalayout in CAN Message
Byte7 ST_LAT_NAVI
@ -38,15 +50,18 @@ Little Endian (Least Significant Byte is at lowest address)
-180° ... +180°
### signal type
### Signal type
32 Bit Signed Integer (Byte 0 ... Byte 3)
### Invalid Data
Invalid-Value: 80 00 00 00h
Signal not available value: 7F FF FF FF
**Do not forget to check for these values**
## Status Latitude Navigation
ST_LAT_NAVI
@ -55,7 +70,7 @@ Signal not available value: 7F FF FF FF
-180° ... +180°
### signal type
### Signal type
32 Bit Signed Integer (Byte 4 ... Byte 7)
@ -64,16 +79,18 @@ Signal not available value: 7F FF FF FF
Invalid-Value: 80 00 00 00h
Signal not available value: 7F FF FF FF
## Send the data over to the AC
Use the *IGpsACPusher*.
## Running the tests
you will need a working ruby installation to execute the tests
### Install the bake tool
see https://esrlabs.com/gems/doc/bake-toolkit/
### run the tests
execute `rake run` from this directory
### Install the bake tool
see https://esrlabs.com/gems/doc/bake-toolkit/