Skip to content

Commit cacbe5f

Browse files
Update README.md
1 parent 862af97 commit cacbe5f

File tree

1 file changed

+8
-91
lines changed

1 file changed

+8
-91
lines changed

README.md

+8-91
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
The files ADAS.py, COMS.py and vision.py run on the OBU while the android code runs on a phone. please separate the codes when running locally. The scripts have been put in the same repository only for the sake of convenience.
22

3-
# Smartphone end :
4-
Android Project back end taken from : https://github.com/maddevsio/mad-location-manager
5-
The app prints and sends the filtered coordinates, speed and heading over the micro-usb port through an OTG to the raspberry pi
63

7-
# OBU end:
8-
# ADAS
4+
# OBU :
5+
## ADAS
96
An alert generation-transmission system for vehicles. https://www.youtube.com/watch?v=PU8L8YUw1JM
107
The android part of this project is in the repository "GPS-IMU" https://github.com/Celestini-Lucifer/GPS-IMU-android-Alert
118

@@ -19,7 +16,7 @@ numpy (pip install numpy)
1916

2017
serial (pip install pyserial)
2118

22-
# WHAT IT DOES:
19+
## how it works:
2320
->The ADAS.py file is the main file which uses the vision.py and COMS.py files.
2421
ADAS.py is supposed to generate an alert for the user when the vision component(vision.py) detects a threat(collision iminent) or sudden braking(by leveraging the sensors in the mobile) and is supposed to broadcast an alert using communications back end(COMS.py, can use any transceiver that works on UART protocol).
2522

@@ -29,14 +26,16 @@ ADAS.py is supposed to generate an alert for the user when the vision component(
2926

3027
->COMS.py is a communications back end (not really that complex or sophisticated if you take a peek, it just makes our job easier, thats it) which can handle UART communications. It has been tested for xbees in transparent mode and for RF APC220s. Look into ADAS.py for understanding how to use them.
3128

32-
# Further developments :
29+
## Further developments :
3330
-> refining the system hardware.
3431
-> frequency hopping for different message types.
3532
-> This project is currently being integrated into a mini self driving car project to tinker with the possibilities of combining V2V communication into autonomous cars https://github.com/naughtyStark/Self-driving-car-STM-32
3633

34+
# Smartphone end :
35+
Android Project back end taken from : https://github.com/maddevsio/mad-location-manager
36+
The app prints and sends the filtered coordinates, speed and heading over the micro-usb port through an OTG to the raspberry pi.
3737

38-
//============ the rest of the readme is all him ===============
39-
38+
The following is the readme of the original android project which was used for it's backend in our project. It is included for reference as well as installation instructions if you get stuck.
4039
# mad-location-manager
4140
This is library for GPS and Accelerometer data "fusion" with Kalman filter.
4241
Project consists of 2 parts: GpsAccelerationKalmanFusion (AAR module) and 2 helper applications. Main thing here is GpsAccelerationKalmanFusion module.
@@ -63,84 +62,6 @@ Use last version from link below (jitpack):
6362
## How to use
6463
There is example application in current repository called "Sensor Data Collector" .
6564

66-
### WARNING!!
67-
68-
Right now these sensors should be available:
69-
TYPE_ROTATION_VECTOR, TYPE_LINEAR_ACCELERATION .
70-
71-
It's possible to use just TYPE_ACCELEROMETER with high-pass filter. Also it's possible to use Madgwick filter instead of rotation vector, but gyroscope and magnetometer sensors should be available in that case.
72-
73-
### KalmanLocationService
74-
75-
This is main class. It implements data collecting and processing. You need to make several preparation steps for using it :
76-
1. Add to application manifest this :
77-
78-
```
79-
<service
80-
android:name="mad.location.manager.lib.Services.KalmanLocationService"
81-
android:enabled="true"
82-
android:exported="false"
83-
android:stopWithTask="false" />
84-
```
85-
2. Create some class and implement LocationServiceInterface and optionally LocationServiceStatusInterface .
86-
3. Register this class with ServicesHelper.addLocationServiceInterface(this) (do it in constructor for example)
87-
4. Handle locationChanged callback. There is Kalman filtered location WITHOUT geohash filtering. Example of geohash filtering is in MapPresenter class.
88-
5. Init location service settings object (or use standard one) and pass it to reset() function.
89-
90-
#### Important things!
91-
It's recommended to use start(), stop() and reset() methods, because this service has internal state. Use start() method at the beginning of new route. Stop service when your application doesn't use locations data. That need to be done for decrease battery consumption.
92-
93-
### Kalman filter settings
94-
95-
There are several settings for KalmanFilter. All of them stored in KalmanLocationService.Settings class.
96-
97-
- Acceleration deviation - this value controls process noise covariance matrix. In other words it's "trust level" of accelerometer data. Low value means that accelerometer data is more preferable.
98-
- Gps min time - minimum time interval between location updates, in milliseconds
99-
- Gps min distance - minimum distance between location updates, in meters
100-
- Sensor frequency in Herz - the rate sensor events are delivered at
101-
- GeoHash precision - length of geohash string (and precision)
102-
- GeoHash min point - count of points with same geohash. GPS point becomes valid only when count greater then this value.
103-
- Logger - if you need to log something to file just implement ILogger interface and initialize settings with that object. If you don't need that - just pass null .
104-
105-
There is an example in MainActivity class how to use logger and settings.
106-
107-
### GeoHashRTFilter
108-
109-
There are 2 ways of using GeoHash real-time filter :
110-
* It could be used as part of KalmanLocationService. It will work inside that thread and will be used by service. But then you need to use start(), stop() and reset() methods.
111-
* It could be used as external component and filter Location objects from any source (not only from KalmanLocationService). You need to reset it before using and then use method filter() .
112-
113-
It will calculate distance in 2 ways : Vincenty and haversine formula . Both of them show good results so maybe we will add some flag for choose.
114-
115-
116-
## The roadmap
117-
### Visualizer
118-
119-
- [x] Implement some route visualizer for desktop application
120-
- [x] Implement Kalman filter and test all settings
121-
- [x] Implement noise generator for logged data
122-
- [ ] Improve UI. Need to use some controls for coefficient/noise changes
123-
124-
### Filter
125-
126-
- [x] Implement GeoHash function
127-
- [x] Get device orientation
128-
- [x] Get device orientation using magnetometer and accelerometer + android sensor manager
129-
- [x] Get device orientation using magnetometer, accelerometer and gyroscope + Madgwick AHRS
130-
- [x] Get device orientation using rotation vector virtual sensor
131-
- [x] Compare result device orientation and choose most stable one
132-
- [x] Get linear acceleration of device (acceleration without gravity force)
133-
- [x] Convert relative linear acceleration axis to absolute coordinate system (east/north/up)
134-
- [x] Implement Kalman filter core
135-
- [x] Implement Kalman filter for accelerometer and gps data "fusion"
136-
- [x] Logger for pure GPS data, acceleration data and filtered GPS data.
137-
- [ ] Restore route if gps connection is lost
138-
139-
### Library
140-
141-
- [x] Separate test android application and library
142-
- [x] Add library to some public repository
143-
14465
## Theory
14566

14667
Kalman filtering, also known as linear quadratic estimation (LQE), is an algorithm that uses a series of measurements observed over time, containing statistical noise and other inaccuracies, and produces estimates of unknown variables that tend to be more accurate than those based on a single measurement alone, by estimating a joint probability distribution over the variables for each timeframe.
@@ -160,10 +81,6 @@ So first - we need to define matrices and do some math with them. And second - w
16081

16182
Best results show Madgwick filter and ROTATION_VECTOR sensor, but Madgwick filter should be used when we know sensor frequency. Android doesn't provide such information. We can set minimum frequency, but it could be much higher then specified. Also we need to provide gain coefficient for each device. So best solution here is to use virtual ROTATION_VECTOR sensor. You can get more details from current project's wiki.
16283

163-
## Issues
164-
165-
Feel free to send pull requests. Also feel free to create issues.
166-
16784
## License
16885

16986
MIT License

0 commit comments

Comments
 (0)