Skip to content

Commit f13bbac

Browse files
RomanBapstdagar
authored andcommitted
mc_att_control: copy sensor_correction topic once initially
Signed-off-by: Roman <bapstroman@gmail.com>
1 parent 82aa24a commit f13bbac

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/modules/mc_att_control/mc_att_control_main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,14 @@ MulticopterAttitudeControl::run()
613613
}
614614

615615
_sensor_correction_sub = orb_subscribe(ORB_ID(sensor_correction));
616+
617+
// sensor correction topic is not being published regularly and we might have missed the first update.
618+
// so copy it once initially so that we have the latest data. In future this will not be needed anymore as the
619+
// behavior of the orb_check function will change
620+
if (_sensor_correction_sub > 0) {
621+
orb_copy(ORB_ID(sensor_correction), _sensor_correction_sub, &_sensor_correction);
622+
}
623+
616624
_sensor_bias_sub = orb_subscribe(ORB_ID(sensor_bias));
617625

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

0 commit comments

Comments
 (0)