forked from Archive/PX4-Autopilot
Navigator: Publish mission triplet only when actually updated
This commit is contained in:
parent
7892a72f90
commit
5748a9c964
|
@ -468,16 +468,6 @@ Navigator::task_main()
|
|||
advance_current_mission_item();
|
||||
}
|
||||
}
|
||||
|
||||
/* lazily publish the setpoint only once available */
|
||||
if (_triplet_pub > 0) {
|
||||
/* publish the attitude setpoint */
|
||||
orb_publish(ORB_ID(mission_item_triplet), _triplet_pub, &_mission_item_triplet);
|
||||
|
||||
} else {
|
||||
/* advertise and publish */
|
||||
_triplet_pub = orb_advertise(ORB_ID(mission_item_triplet), &_mission_item_triplet);
|
||||
}
|
||||
}
|
||||
|
||||
perf_end(_loop_perf);
|
||||
|
@ -721,6 +711,16 @@ Navigator::update_mission_item_triplet()
|
|||
_mission_item_triplet.next_valid = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* lazily publish the mission triplet only once available */
|
||||
if (_triplet_pub > 0) {
|
||||
/* publish the mission triplet */
|
||||
orb_publish(ORB_ID(mission_item_triplet), _triplet_pub, &_mission_item_triplet);
|
||||
|
||||
} else {
|
||||
/* advertise and publish */
|
||||
_triplet_pub = orb_advertise(ORB_ID(mission_item_triplet), &_mission_item_triplet);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue