mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-26 09:26:25 +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();
|
||||
}
|
||||
|
||||
SensorSimulator::~SensorSimulator()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void SensorSimulator::loadSensorDataFromFile(std::string 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]);
|
||||
|
||||
} 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);
|
||||
|
||||
} else {
|
||||
|
||||
@@ -73,7 +73,7 @@ class SensorSimulator
|
||||
|
||||
public:
|
||||
SensorSimulator(std::shared_ptr<Ekf> ekf);
|
||||
~SensorSimulator();
|
||||
~SensorSimulator() = default;
|
||||
|
||||
uint64_t getTime() const { return _time; };
|
||||
|
||||
|
||||
@@ -188,11 +188,13 @@ TEST_F(EkfInitializationTest, gyroBias)
|
||||
printf("%d| ", i);
|
||||
|
||||
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");
|
||||
|
||||
Reference in New Issue
Block a user