mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 14:40:34 +08:00
Expand test framework and test cases (#685)
* Fix comment * Ekf wrapper for testing Add utility function for accessing information in the ekf object * Add step function for Gps sensor * Add RangeFinder and Flow to simulated sensors * Add first fusion logic tests * Add units to function name * Use EXPECT_TRUE * Adding missing qualifiers * Improve EXPECT_ calls * Improve naming
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
#include "flow.h"
|
||||
|
||||
namespace sensor_simulator
|
||||
{
|
||||
namespace sensor
|
||||
{
|
||||
|
||||
Flow::Flow(std::shared_ptr<Ekf> ekf):Sensor(ekf)
|
||||
{
|
||||
}
|
||||
|
||||
Flow::~Flow()
|
||||
{
|
||||
}
|
||||
|
||||
void Flow::send(uint32_t time)
|
||||
{
|
||||
_ekf->setOpticalFlowData(time, &_flow_data);
|
||||
}
|
||||
|
||||
void Flow::setData(const flow_message& flow)
|
||||
{
|
||||
_flow_data = flow;
|
||||
|
||||
}
|
||||
|
||||
flow_message Flow::dataAtRest()
|
||||
{
|
||||
flow_message _flow_at_rest;
|
||||
_flow_at_rest.dt = 20000;
|
||||
_flow_at_rest.flowdata = Vector2f{0.0f, 0.0f};
|
||||
_flow_at_rest.gyrodata = Vector3f{0.0f, 0.0f, 0.0f};
|
||||
_flow_at_rest.quality = 255;
|
||||
return _flow_at_rest;
|
||||
}
|
||||
|
||||
} // namespace sensor
|
||||
} // namespace sensor_simulator
|
||||
Reference in New Issue
Block a user