Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

navigator: fix triplet resetting/publication logic #13588

Merged
merged 2 commits into from
Nov 25, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/modules/navigator/mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,14 @@ Mission::on_active()
bool mission_sub_updated = _mission_sub.updated();

if (mission_sub_updated) {
_navigator->reset_triplets();
update_mission();
}

/* reset the current mission if needed */
if (need_to_reset_mission(true)) {
reset_mission(_mission);
_navigator->reset_triplets();
update_mission();
_navigator->reset_cruising_speed();
mission_sub_updated = true;
Expand Down Expand Up @@ -442,9 +444,6 @@ Mission::update_mission()

bool failed = true;

/* reset triplets */
_navigator->reset_triplets();

/* Reset vehicle_roi
* Missions that do not explicitly configure ROI would not override
* an existing ROI setting from previous missions */
Expand Down
9 changes: 0 additions & 9 deletions src/modules/navigator/navigator_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,6 @@ Navigator::run()
case vehicle_status_s::NAVIGATION_STATE_OFFBOARD:
case vehicle_status_s::NAVIGATION_STATE_STAB:
default:
_pos_sp_triplet_published_invalid_once = false;
navigation_mode_new = nullptr;
_can_loiter_at_sp = false;
break;
Expand Down Expand Up @@ -720,16 +719,8 @@ Navigator::print_status()
void
Navigator::publish_position_setpoint_triplet()
{
// do not publish an invalid setpoint
if (!_pos_sp_triplet.current.valid) {
return;
}

_pos_sp_triplet.timestamp = hrt_absolute_time();

/* lazily publish the position setpoint triplet only once available */
_pos_sp_triplet_pub.publish(_pos_sp_triplet);

_pos_sp_triplet_updated = false;
}

Expand Down