Fix uninitialized memory found using Valgrind

This commit is contained in:
Julian Kent 2019-04-23 16:51:20 +02:00 committed by Daniel Agar
parent a9c3bce20d
commit dc3341db59
2 changed files with 2 additions and 2 deletions

View File

@ -3135,7 +3135,7 @@ protected:
if (control_mode.flag_control_position_enabled) {
position_setpoint_triplet_s pos_sp_triplet;
position_setpoint_triplet_s pos_sp_triplet = {};
_pos_sp_triplet_sub->update(&pos_sp_triplet);
if (pos_sp_triplet.timestamp > 0 && pos_sp_triplet.current.valid

View File

@ -676,7 +676,7 @@ MulticopterAttitudeControl::publish_rates_setpoint()
void
MulticopterAttitudeControl::publish_rate_controller_status()
{
rate_ctrl_status_s rate_ctrl_status;
rate_ctrl_status_s rate_ctrl_status = {};
rate_ctrl_status.timestamp = hrt_absolute_time();
rate_ctrl_status.rollspeed = _rates_prev(0);
rate_ctrl_status.pitchspeed = _rates_prev(1);