Commit 46da1829 authored by Sigurd M. Albrektsen's avatar Sigurd M. Albrektsen

Fixed lint

parent d7b1e98a
......@@ -25,7 +25,7 @@ class ImuMessage : public SentiboardMessage {
accl_ = accl;
gyro_ = gyro;
has_delta_values_ = has_delta_values;
if(!SentiboardMessage::initialized()) {
if (!SentiboardMessage::initialized()) {
SentiboardMessage::populate(package);
}
return true;
......@@ -45,10 +45,10 @@ class ImuMessage : public SentiboardMessage {
return gyro_;
}
private:
private:
std::tuple<float, float, float> accl_;
std::tuple<float, float, float> gyro_;
bool has_delta_values_;
};
#endif // INCLUDE_SENTIBOARD_MESSAGES_IMUMESSAGE_HPP_
#endif // INCLUDE_SENTIBOARD_MESSAGES_IMUMESSAGE_HPP_
......@@ -6,8 +6,8 @@
#include "sentiboard/Package.hpp"
class SentiboardMessage {
public:
SentiboardMessage(const sentiboard::Package& package) {
public:
explicit SentiboardMessage(const sentiboard::Package& package) {
populate(package);
}
SentiboardMessage() {
......@@ -26,7 +26,8 @@ public:
~SentiboardMessage() { }
SentiboardMessage(const SentiboardMessage& other) {// copy constructor
// Copy constructor
SentiboardMessage(const SentiboardMessage& other) {
sensor_ix_ = other.sensor_ix_;
tov_ = other.tov_;
......@@ -36,7 +37,7 @@ public:
onboard_timestamp_ = other.onboard_timestamp_;
}
//copy assignment
// Copy assignment
SentiboardMessage& operator=(const SentiboardMessage& other) {
sensor_ix_ = other.sensor_ix_;
......@@ -48,7 +49,7 @@ public:
return *this;
}
//Copy constructor
// Copy constructor
SentiboardMessage(const SentiboardMessage &&other) {
sensor_ix_ = other.sensor_ix_;
......@@ -58,9 +59,10 @@ public:
onboard_timestamp_ = other.onboard_timestamp_;
}
//move assignment
// Move assignment
SentiboardMessage& operator=(SentiboardMessage&& other) {
if(this == &other) {
if (this == &other) {
return *this;
}
......@@ -96,7 +98,7 @@ public:
return initialized_;
}
private:
private:
uint8_t sensor_ix_;
uint32_t tov_;
......@@ -108,4 +110,4 @@ private:
bool initialized_;
};
#endif // INCLUDE_SENTIBOARD_MESSAGES_SENTIBOARDMESSAGE_HPP_
#endif // INCLUDE_SENTIBOARD_MESSAGES_SENTIBOARDMESSAGE_HPP_
......@@ -3,12 +3,13 @@
#ifndef INCLUDE_SENTIBOARD_SENSORS_STIMPARSER_HPP_
#define INCLUDE_SENTIBOARD_SENSORS_STIMPARSER_HPP_
#include <tuple>
#include "sentiboard/messages/ImuMessage.hpp"
#include "SentiboardParser.hpp"
#include <iostream>
class StimParser : public SentiboardParser {
private:
private:
float stim_bytes_to_float(const uint8_t *ptr, uint8_t div) {
return stim_bytes_to_float((int8_t)ptr[0], ptr[1], ptr[2], div);
}
......@@ -17,10 +18,9 @@ private:
return tmp / (1 << div);
}
public:
public:
bool parse(const sentiboard::Package package, ImuMessage *message,
bool delta_values) {
if (package.data_len() != 38) {
return false;
}
......@@ -37,7 +37,7 @@ public:
float g_z = stim_bytes_to_float(&data[7], gyro_div);
std::tuple<float, float, float> gyro(g_x, g_y, g_z);
// TODO: implement other than 10g
// TODO(sigurdal): implement other than 10g
uint8_t accl_div = delta_values ? 22 : 19;
float a_x = stim_bytes_to_float(&data[11], accl_div);
float a_y = stim_bytes_to_float(&data[14], accl_div);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment