Skip to content

Commit

Permalink
Added fixed timesteps to TrajOpt config
Browse files Browse the repository at this point in the history
  • Loading branch information
marip8 authored and Levi-Armstrong committed Jan 1, 2021
1 parent 926c702 commit 3c0255e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ std::shared_ptr<trajopt::ProblemConstructionInfo> TrajOptPlannerDefaultConfig::g
std::vector<int> fixed_steps;
addWaypoints(pci, fixed_steps);

// Add the fixed timesteps. TrajOpt will constrain the optimization such that any costs applied at these timesteps
// will be ignored. Costs applied to variables at fixed timesteps generally causes solver failures
for (auto idx : fixed_steps)
{
if (idx == 0)
{
pci.basic_info.start_fixed = true;
}
else
{
pci.basic_info.fixed_timesteps.push_back(idx);
}
}

if (collision_constraint_config.enabled)
addCollisionConstraint(pci, fixed_steps);

Expand Down

0 comments on commit 3c0255e

Please sign in to comment.