Skip to content

Commit

Permalink
Fix generation of Solution msg: consider backward operation
Browse files Browse the repository at this point in the history
Need to generate full planning scene message if planning progressed backwards:
The scene_diff field describes PlanningScene changes of the end scene relative to the start scene,
while during planning it might be inversed.
  • Loading branch information
rhaschke committed Mar 8, 2024
1 parent e09fecd commit 4aac679
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/src/storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ void SubTrajectory::appendTo(moveit_task_constructor_msgs::Solution& msg, Intros
if (trajectory())
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::JointState();
t.scene_diff.robot_state.multi_dof_joint_state = sensor_msgs::MultiDOFJointState();
if (this->end()->scene()->getParent() == this->start()->scene())
this->end()->scene()->getPlanningSceneDiffMsg(t.scene_diff);
else
this->end()->scene()->getPlanningSceneMsg(t.scene_diff);
}

double SubTrajectory::computeCost(const CostTerm& f, std::string& comment) const {
Expand Down

0 comments on commit 4aac679

Please sign in to comment.