A tool to implement and understand Kalman Filters.
Kalman Mobile along with Kalman Desktop is a Server-Client pair that reads the accelerometer readings from an Android device and sends them over to a desktop application over websockets. Kalman Desktop then moves the cursor on the screen according to the change in acceleration of the mobile device.
- Download and install Kalman Mobile
- Provide camera access manually (TODO handle permissions)
- Download and run Kalman Desktop
- Scan the QR code shown fom Kalman Mobile
- Turn on or off the Move switch to move the cursor
A JSON containing acceleration along x
, y
and z
in m/s2 and a timestamp
in nanoseconds (time since the device has been on) is sent to Kalman Desktop.
private final DecimalFormat f = new DecimalFormat("#0.000000");
@Override
public void onSensorChanged(SensorEvent event) {
JSONObject data = new JSONObject();
try {
data.put("x", f.format(event.values[0]));
data.put("y", f.format(event.values[1]));
data.put("z", f.format(event.values[2]));
data.put("timestamp", event.timestamp);
} catch (JSONException e) {
e.printStackTrace();
}
socket.emit("move_event", data);
}
Kalman Mobile reads Sensor.TYPE_ACCELEROMETER
and not Sensor.TYPE_ACCELEROMETER_UNCALIBRATED
. Meaning it is bias compensated.
Server | Client |
---|---|
Netty-socketio v1.7.19 | Socket.IO-client Java v1.0.1 |
GNU General Public License
App icon stolen from kalmanfilter.net