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

fixup! Reset joint values in scene diff for execution (#498) #504

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions core/src/storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ void SubTrajectory::appendTo(moveit_task_constructor_msgs::msg::Solution& msg, I
trajectory()->getRobotTrajectoryMsg(t.trajectory);

this->end()->scene()->getPlanningSceneDiffMsg(t.scene_diff);
// reset JointStates (joints are already handled in trajectories)
t.scene_diff.robot_state.joint_state = sensor_msgs::msg::JointState();
t.scene_diff.robot_state.multi_dof_joint_state = sensor_msgs::msg::MultiDOFJointState();
}

double SubTrajectory::computeCost(const CostTerm& f, std::string& comment) const {
Expand Down
7 changes: 0 additions & 7 deletions core/src/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,6 @@ moveit::core::MoveItErrorCode Task::execute(const SolutionBase& s) {
moveit_task_constructor_msgs::action::ExecuteTaskSolution::Goal goal;
s.toMsg(goal.solution, pimpl()->introspection_.get());

// Reset joint values in scene diff to prevent any execution capability from
// modifying the planning scene joint values
for (auto& sub_trajectory : goal.solution.sub_trajectory) {
sub_trajectory.scene_diff.robot_state.joint_state = sensor_msgs::msg::JointState();
sub_trajectory.scene_diff.robot_state.multi_dof_joint_state = sensor_msgs::msg::MultiDOFJointState();
}

moveit_msgs::msg::MoveItErrorCodes error_code;
error_code.val = moveit_msgs::msg::MoveItErrorCodes::FAILURE;
auto goal_handle_future = ac->async_send_goal(goal);
Expand Down
Loading