Skip to content

Commit 9034d9a

Browse files
committed
Fixes planToTSR on robot's util
1 parent 64c95ab commit 9034d9a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/robot/util.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ trajectory::TrajectoryPtr planToTSR(
217217

218218
auto robot = metaSkeleton->getBodyNode(0)->getSkeleton();
219219
SnapConfigurationToConfigurationPlanner::Result pResult;
220-
auto problem = ConfigurationToConfiguration(
221-
space, startState, goalState, collisionTestable);
220+
222221
auto planner = std::make_shared<SnapConfigurationToConfigurationPlanner>(
223222
space, std::make_shared<GeodesicInterpolator>(space));
224223
while (snapSamples < maxSnapSamples && generator->canSample())
@@ -235,6 +234,11 @@ trajectory::TrajectoryPtr planToTSR(
235234
}
236235
++snapSamples;
237236

237+
// Create ConfigurationToConfiguration Problem.
238+
// NOTE: This is done here because the ConfigurationToConfiguration
239+
// problem stores a *cloned* scoped state of the passed state.
240+
auto problem = ConfigurationToConfiguration(
241+
space, startState, goalState, collisionTestable);
238242
auto traj = planner->plan(problem, &pResult);
239243

240244
if (traj)

0 commit comments

Comments
 (0)