17 #ifndef VISIONTRANSFER_DATACHANNEL_IMU_BNO080_H 18 #define VISIONTRANSFER_DATACHANNEL_IMU_BNO080_H 20 #include <visiontransfer/datachannelservicebase.h> 21 #include <visiontransfer/sensorringbuffer.h> 48 static DataChannelIMUBNO080Commands::Command getCommand(
unsigned char* data,
int datalen) {
49 if (datalen < 2)
throw std::runtime_error(
"Buffer too small");
50 return (DataChannelIMUBNO080Commands::Command) ntohs(*((uint16_t*) data));
52 static int packResetMessage(
unsigned char* data,
int datalen) {
53 if (datalen < 2)
throw std::runtime_error(
"Buffer too small");
54 *((uint16_t*)data) = htons(DataChannelIMUBNO080Commands::BNOReset);
67 static constexpr
int RINGBUFFER_SIZE = 2048;
78 DataChannel::Type getChannelType()
const override {
return DataChannel::Types::BNO080; }
79 int handleSensorInputRecord(
unsigned char* data,
int datalen, uint64_t baseTime);
80 void handleChunk(
unsigned char* data,
int datalen);
84 int stopService()
override {
return 1; }
Encapsulate a 4D (quaternion) sensor report, containing X, Y, Z, W, as well as timestamp and status f...
Encapsulate a scalar sensor measurement, containing the value, as well as timestamp and status fields...
Encapsulate a 3D sensor report, containing X, Y, Z, as well as timestamp and status fields...
bool initialize() override
When initialize() implementations return false, the service will be deactivated.
Helper functions for IMU control messages.
Base class all data channel services derive from (once on the server side, once on the API side) ...
Encapsulated receiver with ring buffers for IMU / environment sensor data.
int startService() override
startService() implementations can start devices, launch an IO-blocked worker thread etc...
Commands to control the IMU/environmental sensor and its data reporting.