use shared pointer

This commit is contained in:
kamilritz
2019-12-16 09:04:35 +01:00
committed by Mathieu Bresciani
parent 00cd720a66
commit f13f2f8452
14 changed files with 78 additions and 49 deletions
+5 -2
View File
@@ -42,17 +42,20 @@
#pragma once
#include <memory>
#include "imu.h"
#include "mag.h"
#include "baro.h"
#include "gps.h"
#include "EKF/ekf.h"
using namespace sensor_simulator::sensor;
class SensorSimulator
{
public:
SensorSimulator(Ekf* ekf);
SensorSimulator(std::shared_ptr<Ekf> ekf);
~SensorSimulator();
void setImuRate(uint32_t rate){ _imu.setRate(rate); }
@@ -68,7 +71,7 @@ public:
void setImuBias(Vector3f accel_bias, Vector3f gyro_bias);
private:
Ekf* _ekf;
std::shared_ptr<Ekf> _ekf;
Imu _imu;
Mag _mag;