Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Make swerve headings wrap #54

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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: 4 additions & 1 deletion src/optimization/SwerveTrajoptUtil.inc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ void ApplyKinematicsConstraints(
auto alpha_n = alpha.at(idx);
opti.SubjectTo(x_n_1 + vx_n * dt_sgmt == x_n);
opti.SubjectTo(y_n_1 + vy_n * dt_sgmt == y_n);
opti.SubjectTo(theta_n_1 + omega_n * dt_sgmt == theta_n);
opti.SubjectTo(cos(theta_n_1 + omega_n * dt_sgmt) == // NOLINT
cos(theta_n)); // NOLINT
opti.SubjectTo(sin(theta_n_1 + omega_n * dt_sgmt) == // NOLINT
sin(theta_n)); // NOLINT
opti.SubjectTo(vx_n_1 + ax_n * dt_sgmt == vx_n);
opti.SubjectTo(vy_n_1 + ay_n * dt_sgmt == vy_n);
opti.SubjectTo(omega_n_1 + alpha_n * dt_sgmt == omega_n);
Expand Down