Add BMI160 visualization

This commit is contained in:
2020-07-13 18:20:54 +02:00
parent adf1841592
commit bb5048274f
4 changed files with 251 additions and 45 deletions

View File

@@ -1,7 +1,7 @@
#ifndef GLOBALCANVASSETTINGS_H
#define GLOBALCANVASSETTINGS_H
//#include <glm/glm.hpp>
#include <glm/glm.hpp>
class GlobalCanvasSettings
{

View File

@@ -0,0 +1,35 @@
#ifndef _IMU_SERIAL_HPP_
#define _IMU_SERIAL_HPP_
#include <string>
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <mutex>
#include <thread>
class ImuSerial
{
public:
ImuSerial(const std::string &serial_device, unsigned int baud);
~ImuSerial();
void start();
void stop();
glm::quat get_quaternion();
const glm::mat4 get_rot_matrix();
private:
std::string serial_device;
unsigned int baud;
std::mutex quat_mutex;
glm::quat quaternion;
std::thread worker;
int stop_flag;
int fd;
friend void working_thread(ImuSerial *self);
friend void update_quaternion(ImuSerial *self, const glm::quat &quat);
};
#endif /* _IMU_SERIAL_HPP_ */