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

Support trimming an existing trajectory #765

Closed

Conversation

lidor51
Copy link

@lidor51 lidor51 commented Sep 29, 2024

This PR supports a trimming of a trajectory. Introduce an elegant way to start a trajectory in the middle (and also to terminate it earlier).

My original thought was to trim a PathPlannerPath, but it would be less user friendly as the params were WaypointPos instead of seconds.
Let me know if you think it's better to add trim support to a path instead to a trajectory.

#764
#698

@github-actions github-actions bot added the PathPlannerLib Changes to PathPlannerLib label Sep 29, 2024
@mjansen4857
Copy link
Owner

This isn't something that I think should be in the main library. Trimming trajectories like this can lead to some pretty bad path following performance very easily. If you cut out part of the trajectory in the beginning handling acceleration, the robot would be commanded to go much faster than it is capable of doing and the robot will fall behind for the whole trajectory.

This method is something that can be easily implemented in user code, and if you know what you're doing when using it then it can work fine, but if its not something I would recommend anyone to use because of the potential issues caused by it then it just probably shouldn't be in the library. I want to leave anything like this outside of just following the trajectory as-is up to the user to implement themselves so they are fully aware of what is happening.

@lidor51 lidor51 closed this Sep 30, 2024
@lidor51
Copy link
Author

lidor51 commented Sep 30, 2024

If you can expose also getters for PathPlannerPath, it'll be appreciated, so advanced users can make modifications to the path without modifying the json object in runtime. Do you want me to open a feature request? @mjansen4857

@mjansen4857
Copy link
Owner

What getters? I think everything needed should already be exposed.

@lidor51
Copy link
Author

lidor51 commented Sep 30, 2024

Getter of number of waypoints (not path points) & getter of rotation targets (although can be extracted from iterating through path points), would be appreciated.

@mjansen4857
Copy link
Owner

Yeah you should be able to trim the path purely off path points but all that stuff should be publicly accessible anyway so I’ll do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PathPlannerLib Changes to PathPlannerLib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants