diff --git a/tesseract_motion_planners/simple/src/simple_motion_planner.cpp b/tesseract_motion_planners/simple/src/simple_motion_planner.cpp index cff100349d1..fab9fcb73e9 100644 --- a/tesseract_motion_planners/simple/src/simple_motion_planner.cpp +++ b/tesseract_motion_planners/simple/src/simple_motion_planner.cpp @@ -31,6 +31,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include TESSERACT_COMMON_IGNORE_WARNINGS_POP +#include #include #include #include @@ -162,9 +163,14 @@ CompositeInstruction SimpleMotionPlanner::processCompositeInstruction(const Comp } else if (start_waypoint.isCartesianWaypoint()) { - /** @todo Update to run IK to find solution closest to start */ - start_waypoint.as().setSeed(tesseract_common::JointState( - manip->getJointNames(), request.env_state.getJointValues(manip->getJointNames()))); + if (!start_waypoint.as().hasSeed()) + { + // Run IK to find solution closest to start + KinematicGroupInstructionInfo info(prev_instruction, request, request.instructions.getManipulatorInfo()); + auto start_seed = getClosestJointSolution(info, request.env_state.getJointValues(manip->getJointNames())); + start_waypoint.as().setSeed( + tesseract_common::JointState(manip->getJointNames(), start_seed)); + } } else {