Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add seed IK for base instruction to SimpleMotionPlanner (fixes todo) #377

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions tesseract_motion_planners/simple/src/simple_motion_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <tesseract_environment/utils.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_motion_planners/simple/interpolation.h>
#include <tesseract_motion_planners/simple/simple_motion_planner.h>
#include <tesseract_motion_planners/simple/profile/simple_planner_lvs_no_ik_plan_profile.h>
#include <tesseract_motion_planners/core/utils.h>
Expand Down Expand Up @@ -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<CartesianWaypointPoly>().setSeed(tesseract_common::JointState(
manip->getJointNames(), request.env_state.getJointValues(manip->getJointNames())));
if (!start_waypoint.as<CartesianWaypointPoly>().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<CartesianWaypointPoly>().setSeed(
tesseract_common::JointState(manip->getJointNames(), start_seed));
}
}
else
{
Expand Down