UNKNOWN_LOG_ENTRY when logging
Hi Eric,
I modified the MetaWear app in the SensorFusionFragment.java to log and download the euler angles data. When debug the app and select quartenion I found that streamRoute = task.getResult(); returns a route but when i choose Euler Angles, it doesn't.
I guess that's why it shows the error type:UNKNOWN_LOG_ENTRY in the LogDownloadErrorHandler
Here's a piece of the code:
@Override
protected void setup() {
logging.clearEntries();
sensorFusion.configure()
.mode(Mode.NDOF)
.accRange(AccRange.AR_16G)
.gyroRange(GyroRange.GR_2000DPS)
.commit();
if (srcIndex == 0) {
sensorFusion.quaternion().addRouteAsync(source -> source.stream((data, env) -> {
})).continueWith(task -> {
streamRoute = task.getResult();
sensorFusion.quaternion().start();
sensorFusion.start();
return null;
});
} else {
sensorFusion.eulerAngles().addRouteAsync(source -> source.log((data, env) -> {
Log.i("MainActivity", data.value(EulerAngles.class).toString());
})).continueWith(task -> {
streamRoute = task.getResult();
logging.start(true);
sensorFusion.eulerAngles().start();
sensorFusion.start();
return null;
});
}
}
@Override
protected void clean() {
downloadDados();
sensorFusion.stop();
logging.stop();
//logging.downloadAsync();
}
protected void downloadDados ()
{
// download log data and send 100 progress updates during the download
logging.downloadAsync(100, new Logging.LogDownloadUpdateHandler() {
@Override
public void receivedUpdate(long nEntriesLeft, long totalEntries) {
Log.i("MainActivity", "Progress Update = " + nEntriesLeft + "/" + totalEntries);
}
}, new Logging.LogDownloadErrorHandler() {
@Override
public void receivedError(Logging.DownloadError errorType, byte logId, Calendar timestamp, byte[] data) {
Log.i("MainActivity", "logid " + logId + " error type:" + errorType + " byte " + Arrays.toString(data));
}
}).continueWithTask(new Continuation<Void, Task<Void>>()
{
@Override
public Task<Void> then(Task<Void> task) throws Exception
{
Log.i("MainActivity", "Download completed");
return null;
}
});
}
This discussion has been closed.
Comments
tearDown
and try again.