mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
28 lines
343 B
C++
28 lines
343 B
C++
#include "mag.h"
|
|
|
|
namespace sensor_simulator
|
|
{
|
|
namespace sensor
|
|
{
|
|
|
|
Mag::Mag(std::shared_ptr<Ekf> ekf): Sensor(ekf)
|
|
{
|
|
}
|
|
|
|
Mag::~Mag()
|
|
{
|
|
}
|
|
|
|
void Mag::send(uint64_t time)
|
|
{
|
|
_ekf->setMagData(magSample{time, _mag_data + _bias});
|
|
}
|
|
|
|
void Mag::setData(const Vector3f &mag)
|
|
{
|
|
_mag_data = mag;
|
|
}
|
|
|
|
} // namespace sensor
|
|
} // namespace sensor_simulator
|