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

Make TrajoptLib kinematics use current and next variables instead of previous and current #811

Closed
calcmogul opened this issue Oct 2, 2024 · 0 comments · Fixed by #830
Closed
Labels
component: trajoptlib TrajoptLib type: bug Something isn't working

Comments

@calcmogul
Copy link
Member

calcmogul commented Oct 2, 2024

The TrajoptLib kinematics constraints use previous and current variables: xₙ = xₙ₋₁ + vₙt + 1/2 aₙt².

      problem.SubjectTo(x_n_1 + v_n * dt_sgmt + a_n * 0.5 * dt_sgmt * dt_sgmt ==
                        x_n);

It's using the wrong velocity and acceleration for that timestep. It should be xₙ = xₙ₋₁ + vₙ₋₁t + 1/2 aₙ₋₁t² instead, and ideally xₙ₊₁ = xₙ + vₙt + 1/2 aₙt² to follow common convention.

@calcmogul calcmogul added type: bug Something isn't working component: trajoptlib TrajoptLib labels Oct 2, 2024
calcmogul added a commit to calcmogul/Choreo that referenced this issue Oct 2, 2024
calcmogul added a commit to calcmogul/Choreo that referenced this issue Oct 3, 2024
calcmogul added a commit to calcmogul/Choreo that referenced this issue Oct 3, 2024
calcmogul added a commit to calcmogul/Choreo that referenced this issue Oct 3, 2024
calcmogul added a commit to calcmogul/Choreo that referenced this issue Oct 3, 2024
calcmogul added a commit to calcmogul/Choreo that referenced this issue Oct 3, 2024
calcmogul added a commit to calcmogul/Choreo that referenced this issue Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: trajoptlib TrajoptLib type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant