Skip to content

Commit

Permalink
[trajoptlib] Set dt upper bound
Browse files Browse the repository at this point in the history
Without it, the solver increases dt a lot, then reports infeasible on
most paths.

The anti-tunneling constraint implicitly set an upper bound on dt, but
setting an explicit upper bound is better.
  • Loading branch information
calcmogul committed Jan 6, 2025
1 parent 97962cb commit 0b5abd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions trajoptlib/src/DifferentialTrajectoryGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ DifferentialTrajectoryGenerator::DifferentialTrajectoryGenerator(
T_tot += T_sgmt;

problem.SubjectTo(dt >= 0);
problem.SubjectTo(dt <= 0.1);

// Use initialGuess and Ns to find the dx, dy, dθ between wpts
const auto sgmt_start = GetIndex(Ns, sgmtIndex);
const auto sgmt_end = GetIndex(Ns, sgmtIndex + 1);
Expand Down
1 change: 1 addition & 0 deletions trajoptlib/src/SwerveTrajectoryGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ SwerveTrajectoryGenerator::SwerveTrajectoryGenerator(
T_tot += T_sgmt;

problem.SubjectTo(dt >= 0);
problem.SubjectTo(dt <= 0.1);

// Use initialGuess and Ns to find the dx, dy, dθ between wpts
const auto sgmt_start = GetIndex(Ns, sgmtIndex);
Expand Down

0 comments on commit 0b5abd1

Please sign in to comment.