mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 17:48:53 +08:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user