ign sim fix alt ground truth and baro

This commit is contained in:
Daniel Agar
2022-08-14 15:22:24 -04:00
parent 04ac07f07a
commit 4c3da85b97
2 changed files with 2 additions and 2 deletions
@@ -157,7 +157,7 @@ void IgnitionSimulator::PoseInfoCallback(const ignition::msgs::Pose_V &pose)
_pos_ref.reproject(local_position_groundtruth.x, local_position_groundtruth.y,
global_position_groundtruth.lat, global_position_groundtruth.lon);
global_position_groundtruth.alt = _param_sim_home_alt.get() - static_cast<float>(pose_position.z());
global_position_groundtruth.alt = _param_sim_home_alt.get() - static_cast<float>(position(2));
global_position_groundtruth.timestamp = hrt_absolute_time();
_gpos_ground_truth_pub.publish(global_position_groundtruth);
}
@@ -156,7 +156,7 @@ void SensorBaroSim::Run()
const float absolute_pressure_noisy = absolute_pressure + abs_pressure_noise + _baro_drift_pa;
// convert to hPa
float pressure = absolute_pressure_noisy * 0.01f + _sim_baro_off_p.get();
float pressure = absolute_pressure_noisy + _sim_baro_off_p.get();
// calculate temperature in Celsius
float temperature = temperature_local - 273.0f + _sim_baro_off_t.get();