+/**
+ * Global stuff we need
+ */
+OsModel::Os os;
+OsModel::Timer::self_t timer;
+Roomba roomba;
+RoombaUart roomba_uart(os);
+ControlledMotion ctrl_motion;
+
+/**
+ * Sensor data we need, filled in callback
+ */
+struct SensorData {
+ uint16_t capacity, charge;
+ uint8_t charging;
+ int16_t current;
+ int8_t temperature;
+ uint16_t voltage;
+ int16_t left_encoder_counts, right_encoder_counts;
+} sensor_data;
+
+/**
+ * Callback that fills the sensor data when data is available
+ */
+struct DataAvailable {
+ void cb(int state) {
+ if(state != Roomba::DATA_AVAILABLE) {
+ return;
+ }
+ sensor_data.capacity = roomba().capacity;
+ sensor_data.charge = roomba().charge;
+ sensor_data.charging = roomba().charging;
+ sensor_data.current = roomba().current;
+ sensor_data.voltage = roomba().voltage;
+ sensor_data.left_encoder_counts = roomba().left_encoder_counts;
+ sensor_data.right_encoder_counts = roomba().right_encoder_counts;
+ }
+} data_available;
+