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
+9 -6
View File
@@ -1,9 +1,11 @@
#include "Imu.h"
#include "imu.h"
namespace sensor_simulator::sensor
namespace sensor_simulator
{
namespace sensor
{
Imu::Imu(Ekf* ekf):Sensor(ekf)
Imu::Imu(std::shared_ptr<Ekf> ekf):Sensor(ekf)
{
}
@@ -25,20 +27,21 @@ void Imu::send(uint32_t time)
_time_last_data_sent = time;
}
void Imu::setData(Vector3f accel, Vector3f gyro)
void Imu::setData(const Vector3f& accel, const Vector3f& gyro)
{
setAccelData(accel);
setGyroData(gyro);
}
void Imu::setAccelData(Vector3f accel)
void Imu::setAccelData(const Vector3f& accel)
{
_accel_data = accel;
}
void Imu::setGyroData(Vector3f gyro)
void Imu::setGyroData(const Vector3f& gyro)
{
_gyro_data = gyro;
}
} // namespace sensor
} // namespace sensor_simulator::sensor