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

Fix format as input task to handle both joint and state waypoints #525

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
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP
#include <tesseract_task_composer/core/task_composer_node_info.h>
#include <tesseract_task_composer/core/task_composer_data_storage.h>

#include <tesseract_command_language/utils.h>
#include <tesseract_command_language/composite_instruction.h>
#include <tesseract_command_language/poly/move_instruction_poly.h>
#include <tesseract_command_language/poly/state_waypoint_poly.h>
Expand Down Expand Up @@ -139,18 +140,16 @@ std::unique_ptr<TaskComposerNodeInfo> FormatAsInputTask::runImpl(TaskComposerCon

if (mi.getWaypoint().isCartesianWaypoint())
{
const auto& swp = umi.getWaypoint().as<StateWaypointPoly>();
auto& cwp = mi.getWaypoint().as<CartesianWaypointPoly>();
cwp.setSeed(tesseract_common::JointState(swp.getNames(), swp.getPosition()));
cwp.setSeed(tesseract_common::JointState(getJointNames(umi.getWaypoint()), getJointPosition(umi.getWaypoint())));
}
else if (mi.getWaypoint().isJointWaypoint())
{
auto& jwp = mi.getWaypoint().as<JointWaypointPoly>();
if (!jwp.isConstrained() || (jwp.isConstrained() && jwp.isToleranced()))
{
const auto& swp = umi.getWaypoint().as<StateWaypointPoly>();
jwp.setNames(swp.getNames());
jwp.setPosition(swp.getPosition());
jwp.setNames(getJointNames(umi.getWaypoint()));
jwp.setPosition(getJointPosition(umi.getWaypoint()));
}
}
else
Expand Down
Loading