Skip to content

Commit

Permalink
mc_att_control: copy sensor_correction topic once initially
Browse files Browse the repository at this point in the history
Signed-off-by: Roman <bapstroman@gmail.com>
  • Loading branch information
RomanBapst authored and dagar committed Nov 13, 2018
1 parent 82aa24a commit f13bbac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/modules/mc_att_control/mc_att_control_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,14 @@ MulticopterAttitudeControl::run()
}

_sensor_correction_sub = orb_subscribe(ORB_ID(sensor_correction));

// sensor correction topic is not being published regularly and we might have missed the first update.
// so copy it once initially so that we have the latest data. In future this will not be needed anymore as the
// behavior of the orb_check function will change
if (_sensor_correction_sub > 0) {
orb_copy(ORB_ID(sensor_correction), _sensor_correction_sub, &_sensor_correction);
}

_sensor_bias_sub = orb_subscribe(ORB_ID(sensor_bias));

/* wakeup source: gyro data from sensor selected by the sensor app */
Expand Down

0 comments on commit f13bbac

Please sign in to comment.