mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 03:33:33 +08:00
navigator: API changes, reparing to move manual modes to navigator, WIP
This commit is contained in:
@@ -121,7 +121,7 @@ Navigator::Navigator() :
|
||||
_mission(this, "MIS"),
|
||||
_loiter(this, "LOI"),
|
||||
_rtl(this, "RTL"),
|
||||
_update_triplet(false),
|
||||
_pos_sp_triplet_updated(false),
|
||||
_param_loiter_radius(this, "LOITER_RAD"),
|
||||
_param_acceptance_radius(this, "ACC_RAD")
|
||||
{
|
||||
@@ -371,20 +371,21 @@ Navigator::task_main()
|
||||
|
||||
/* iterate through navigation modes and set active/inactive for each */
|
||||
for(unsigned int i = 0; i < NAVIGATOR_MODE_ARRAY_SIZE; i++) {
|
||||
_update_triplet = _navigation_mode_array[i]->run(_navigation_mode == _navigation_mode_array[i], &_pos_sp_triplet);
|
||||
_navigation_mode_array[i]->run(_navigation_mode == _navigation_mode_array[i]);
|
||||
}
|
||||
|
||||
/* if nothing is running, set position setpoint triplet invalid */
|
||||
if (_navigation_mode == nullptr) {
|
||||
// TODO publish empty sp only once
|
||||
_pos_sp_triplet.previous.valid = false;
|
||||
_pos_sp_triplet.current.valid = false;
|
||||
_pos_sp_triplet.next.valid = false;
|
||||
_update_triplet = true;
|
||||
_pos_sp_triplet_updated = true;
|
||||
}
|
||||
|
||||
if (_update_triplet) {
|
||||
if (_pos_sp_triplet_updated) {
|
||||
publish_position_setpoint_triplet();
|
||||
_update_triplet = false;
|
||||
_pos_sp_triplet_updated = false;
|
||||
}
|
||||
|
||||
perf_end(_loop_perf);
|
||||
|
||||
Reference in New Issue
Block a user