Skip to content

Commit 27bc38c

Browse files
Levi ArmstrongLevi-Armstrong
authored andcommitted
Utilize parameter in TrajOpt planner
1 parent b22b907 commit 27bc38c

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

tesseract/tesseract_planning/tesseract_motion_planners/src/trajopt/problem_generators/default_problem_generator.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ DefaultTrajoptProblemGenerator(const std::string& name,
140140
{
141141
const Eigen::VectorXd& position = getJointPosition(start_waypoint);
142142
start_plan_profile->apply(*pci, position, *start_instruction, composite_mi, active_links, index);
143+
144+
// Add to fixed indices
145+
fixed_steps.push_back(index);
143146
}
144147
else
145148
{
@@ -267,6 +270,9 @@ DefaultTrajoptProblemGenerator(const std::string& name,
267270
// Add final point with waypoint
268271
cur_plan_profile->apply(*pci, cur_position, *plan_instruction, composite_mi, active_links, index);
269272

273+
// Add to fixed indices
274+
fixed_steps.push_back(index);
275+
270276
// Add seed state
271277
assert(isMoveInstruction(seed_composite->back()));
272278
const auto* seed_instruction = seed_composite->back().cast_const<MoveInstruction>();
@@ -327,9 +333,6 @@ DefaultTrajoptProblemGenerator(const std::string& name,
327333
/** @todo Should check that the joint names match the order of the manipulator */
328334
cur_plan_profile->apply(*pci, *cur_wp, *plan_instruction, composite_mi, active_links, index);
329335

330-
// Add to fixed indices
331-
fixed_steps.push_back(index);
332-
333336
// Add seed state
334337
assert(isMoveInstruction(seed_composite->back()));
335338
const auto* seed_instruction = seed_composite->back().cast_const<MoveInstruction>();
@@ -358,9 +361,12 @@ DefaultTrajoptProblemGenerator(const std::string& name,
358361
// Setup Basic Info
359362
pci->basic_info.n_steps = index;
360363
pci->basic_info.manip = composite_mi.manipulator;
361-
pci->basic_info.start_fixed = false;
362364
pci->basic_info.use_time = false;
363365

366+
// Add the fixed timesteps. TrajOpt will constrain the optimization such that any costs applied at these timesteps
367+
// will be ignored. Costs applied to variables at fixed timesteps generally causes solver failures
368+
pci->basic_info.fixed_timesteps = fixed_steps;
369+
364370
// Set trajopt seed
365371
assert(static_cast<long>(seed_states.size()) == pci->basic_info.n_steps);
366372
pci->init_info.type = trajopt::InitInfo::GIVEN_TRAJ;

tesseract/tesseract_planning/tesseract_process_managers/src/process_generators/fix_state_collision_process_generator.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ bool MoveWaypointFromCollisionTrajopt(Waypoint& waypoint,
125125
ProblemConstructionInfo pci(input.env);
126126
pci.basic_info.n_steps = 1;
127127
pci.basic_info.manip = input.manip_info.manipulator;
128-
pci.basic_info.start_fixed = false;
129128
pci.basic_info.use_time = false;
130129

131130
// Create Kinematic Object

tesseract_python/tesseract_python/swig/trajopt/problem_description.i

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,10 @@ struct TrajOptResult
176176

177177
struct BasicInfo
178178
{
179-
bool start_fixed;
180179
int n_steps;
181180
std::string manip;
182-
std::string robot;
183-
IntVec dofs_fixed;
181+
IntVec fixed_timesteps;
182+
IntVec fixed_dofs;
184183
sco::ModelType convex_solver;
185184
bool use_time;
186185
double dt_upper_lim;

0 commit comments

Comments
 (0)