addRouteAsync fails when adding account() to RouteComponent

Board: MetaMotion R
FW: 1.3.6.
Android Compile SDK:  27
SDK: 3.3.0
======================================

I try to use account() on my RouteComponent. Removing account() leads to everything working correctly. I configure the board in this function to output quaternions:

private Task<Route> configure() {
sensorFusion = board.getModule(SensorFusionBosch.class);

sensorFusion.configure()
.mode(SensorFusionBosch.Mode.IMU_PLUS)
.accRange(SensorFusionBosch.AccRange.AR_8G)
.gyroRange(SensorFusionBosch.GyroRange.GR_1000DPS)
.commit();

dataProducer = sensorFusion.quaternion();

//Send quaternions to stream route
return dataProducer.addRouteAsync(new RouteBuilder() {
@Override
public void configure(RouteComponent source) {
source.account().stream(new Subscriber() {
@Override
public void apply(Data data, Object... env) {
Log.i("ts", data.toString());
Quaternion q = data.value(Quaternion.class);
emitter.onNext(getMeasurement(data.timestamp().getTimeInMillis(), new float[]{q.w(), q.x(), q.y(), q.z()}));
}
});
}
});
}

I call and evaluate the returned task like this:

configure().onSuccess(new Continuation<Route, Object>() {
@Override
public Object then(Task<Route> task) throws Exception {
if(task.isCompleted()) {
Log.i("task", "yay");
dataProducer.start();
sensorFusion.start();
}
return null;
}
}).continueWith(new Continuation<Object, Object>() {
@Override
public Object then(Task<Object> task) throws Exception {
if(task.isFaulted()) {
Log.i("task", "we faulted!!");
}
return null;
}
});

Comments

  • Log the error and paste the message from Logcat.
  • The error reads: "Not enough space left in the ble packet to add accounter information"
  • edited February 2018
    Please take a look at this paste which contains the full stacktrace:

  • So, as the error message states, the ble packet doesn't have space for the accounter information when using it with quaternion data. There is an alternative mode that appends a counter instead of timestamp data but the android SDK needs to updated to support it.

    If you need accurate timestamps, you will have to log the data.
  • Thank you Eric. Do you plan on implementing the alternative mode into Android SDK in the near future?
  • It will be added but it's not a high priority item.

    What is your use case with the boards that requires this information?
This discussion has been closed.