Add BMI160 visualization
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifndef GLOBALCANVASSETTINGS_H
|
||||
#define GLOBALCANVASSETTINGS_H
|
||||
|
||||
//#include <glm/glm.hpp>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
class GlobalCanvasSettings
|
||||
{
|
||||
|
35
include/opengl-playground/imu-serial.hpp
Normal file
35
include/opengl-playground/imu-serial.hpp
Normal 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_ */
|
Reference in New Issue
Block a user