send MAVLink GROUND_TRUTH at 25 Hz, only in SIH mode. And minor cleanup

This commit is contained in:
Beat Küng
2019-04-12 09:25:07 +02:00
parent 9adb4410bd
commit 744b50b478
6 changed files with 408 additions and 453 deletions
+6 -1
View File
@@ -766,7 +766,12 @@ Mavlink::set_hil_enabled(bool hil_enabled)
_hil_enabled = true;
ret = configure_stream("HIL_ACTUATOR_CONTROLS", 200.0f);
configure_stream("GROUND_TRUTH", 200.0f); // HIL_STATE_QUATERNION to display the SIH
if (_param_sys_hitl.get() == 2) { // Simulation in Hardware enabled ?
configure_stream("GROUND_TRUTH", 25.0f); // HIL_STATE_QUATERNION to display the SIH
} else {
configure_stream("GROUND_TRUTH", 0.0f);
}
}
/* disable HIL */
+2 -1
View File
@@ -656,7 +656,8 @@ private:
(ParamInt<px4::params::MAV_BROADCAST>) _param_mav_broadcast,
(ParamBool<px4::params::MAV_HASH_CHK_EN>) _param_mav_hash_chk_en,
(ParamBool<px4::params::MAV_HB_FORW_EN>) _param_mav_hb_forw_en,
(ParamBool<px4::params::MAV_ODOM_LP>) _param_mav_odom_lp
(ParamBool<px4::params::MAV_ODOM_LP>) _param_mav_odom_lp,
(ParamInt<px4::params::SYS_HITL>) _param_sys_hitl
)
perf_counter_t _loop_perf; /**< loop performance counter */