mc_pos_control: don't do orb_check on polled topic

When we poll on vehicle_local_position we shouldn't do yet another
orb_check but copy it first up.
This commit is contained in:
Julian Oes
2018-12-22 10:32:18 +01:00
parent 0e04d3e9a9
commit 22bd06e5d5
@@ -412,6 +412,9 @@ MulticopterPositionControl::parameters_update(bool force)
void
MulticopterPositionControl::poll_subscriptions()
{
// This is polled for, so all we need to do is a copy now.
orb_copy(ORB_ID(vehicle_local_position), _local_pos_sub, &_local_pos);
bool updated;
orb_check(_vehicle_status_sub, &updated);
@@ -447,12 +450,6 @@ MulticopterPositionControl::poll_subscriptions()
orb_copy(ORB_ID(vehicle_control_mode), _control_mode_sub, &_control_mode);
}
orb_check(_local_pos_sub, &updated);
if (updated) {
orb_copy(ORB_ID(vehicle_local_position), _local_pos_sub, &_local_pos);
}
orb_check(_att_sub, &updated);
if (updated) {