mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 04:06:33 +08:00
ekf2: test fix double promotion warnings
This commit is contained in:
@@ -17,11 +17,6 @@ SensorSimulator::SensorSimulator(std::shared_ptr<Ekf> ekf):
|
|||||||
startBasicSensor();
|
startBasicSensor();
|
||||||
}
|
}
|
||||||
|
|
||||||
SensorSimulator::~SensorSimulator()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SensorSimulator::loadSensorDataFromFile(std::string file_name)
|
void SensorSimulator::loadSensorDataFromFile(std::string file_name)
|
||||||
{
|
{
|
||||||
std::ifstream file(file_name);
|
std::ifstream file(file_name);
|
||||||
@@ -281,7 +276,7 @@ void SensorSimulator::setSingleReplaySample(const sensor_info &sample)
|
|||||||
// _vio.setData((float) sample.sensor_data[0], (float) sample.sensor_data[1]);
|
// _vio.setData((float) sample.sensor_data[0], (float) sample.sensor_data[1]);
|
||||||
|
|
||||||
} else if (sample.sensor_type == sensor_info::LANDING_STATUS) {
|
} else if (sample.sensor_type == sensor_info::LANDING_STATUS) {
|
||||||
bool landed = fabsf(sample.sensor_data[0]) <= 0.f;
|
bool landed = std::abs(sample.sensor_data[0]) <= 0;
|
||||||
_ekf->set_in_air_status(!landed);
|
_ekf->set_in_air_status(!landed);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class SensorSimulator
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
SensorSimulator(std::shared_ptr<Ekf> ekf);
|
SensorSimulator(std::shared_ptr<Ekf> ekf);
|
||||||
~SensorSimulator();
|
~SensorSimulator() = default;
|
||||||
|
|
||||||
uint64_t getTime() const { return _time; };
|
uint64_t getTime() const { return _time; };
|
||||||
|
|
||||||
|
|||||||
@@ -188,11 +188,13 @@ TEST_F(EkfInitializationTest, gyroBias)
|
|||||||
printf("%d| ", i);
|
printf("%d| ", i);
|
||||||
|
|
||||||
for (uint8_t j = 0; j <= 15; j++) {
|
for (uint8_t j = 0; j <= 15; j++) {
|
||||||
double corr = sqrt(abs(P(i, i) * P(j, j)));
|
float corr = sqrtf(fabsf(P(i, i) * P(j, j)));
|
||||||
|
|
||||||
if (corr > 0.0) { corr = double(abs(P(i, j))) / corr; }
|
if (corr > 0.0f) {
|
||||||
|
corr = fabsf(P(i, j)) / corr;
|
||||||
|
}
|
||||||
|
|
||||||
printf("%.3f\t", corr);
|
printf("%.3f\t", (double)corr);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user