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

Trajectory loop closure bool #5

Closed
horverno opened this issue May 16, 2023 · 0 comments
Closed

Trajectory loop closure bool #5

horverno opened this issue May 16, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@horverno
Copy link
Member

Add a boolean and detect whether trajectory is linear (loop closure false) circular (loop closure true).

If false, stop after last waypoint reached

if (target_waypoint >= int(msg.poses.size() - 1))
{
if (last_waypoint_reached == false)
{
last_waypoint_reached_time = this->now();
}
RCLCPP_INFO_STREAM(this->get_logger(), "Last waypoint reached " << std::fixed << std::setprecision(1) << (last_waypoint_reached_time - this->now()).nanoseconds() / -1e9 << "s ago");
last_waypoint_reached = true;
}

If true, repeat it

if(closest_waypoint > int(msg.poses.size()) - 10)
{
closest_waypoint = 0;
}

@horverno horverno added the enhancement New feature or request label May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant