sensors: no temperature compensation in HITL

Temperature compensation is not supported in HITL. Therefore, don't try
and fail. This basically removes the confusing error message that we get
in HITL.
This commit is contained in:
Julian Oes
2018-07-24 13:40:03 +02:00
committed by Lorenz Meier
parent ee3e34cd06
commit 80cac6561f
4 changed files with 35 additions and 38 deletions

View File

@@ -95,6 +95,7 @@
using namespace DriverFramework;
using namespace sensors;
using namespace time_literals;
/**
* Analog layout:
@@ -584,13 +585,11 @@ Sensors::run()
}
sensor_combined_s raw = {};
sensor_preflight_s preflt = {};
vehicle_air_data_s airdata = {};
vehicle_magnetometer_s magnetometer = {};
struct sensor_preflight_s preflt = {};
_rc_update.init();
_voted_sensors_update.init(raw);
/* (re)load params and calibration */
@@ -600,11 +599,8 @@ Sensors::run()
* do subscriptions
*/
_diff_pres_sub = orb_subscribe(ORB_ID(differential_pressure));
_vcontrol_mode_sub = orb_subscribe(ORB_ID(vehicle_control_mode));
_params_sub = orb_subscribe(ORB_ID(parameter_update));
_actuator_ctrl_0_sub = orb_subscribe(ORB_ID(actuator_controls_0));
/* get a set of initial values */
@@ -614,18 +610,10 @@ Sensors::run()
_rc_update.rc_parameter_map_poll(_parameter_handles, true /* forced */);
/* advertise the sensor_preflight topic and make the initial publication */
preflt.accel_inconsistency_m_s_s = 0.0f;
preflt.gyro_inconsistency_rad_s = 0.0f;
preflt.mag_inconsistency_ga = 0.0f;
_sensor_preflight = orb_advertise(ORB_ID(sensor_preflight), &preflt);
/* wakeup source */
px4_pollfd_struct_t poll_fds = {};
poll_fds.events = POLLIN;
uint64_t last_config_update = hrt_absolute_time();
@@ -704,7 +692,7 @@ Sensors::run()
/* keep adding sensors as long as we are not armed,
* when not adding sensors poll for param updates
*/
if (!_armed && hrt_elapsed_time(&last_config_update) > 500 * 1000) {
if (!_armed && hrt_elapsed_time(&last_config_update) > 500_ms) {
_voted_sensors_update.initialize_sensors();
last_config_update = hrt_absolute_time();
@@ -846,7 +834,7 @@ Sensors *Sensors::instantiate(int argc, char *argv[])
return nullptr;
}
return new Sensors(hil_enabled);;
return new Sensors(hil_enabled);
}
int sensors_main(int argc, char *argv[])