Skip to content

Commit 4aac679

Browse files
committed
Fix generation of Solution msg: consider backward operation
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.
1 parent e09fecd commit 4aac679

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/src/storage.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,10 @@ void SubTrajectory::appendTo(moveit_task_constructor_msgs::Solution& msg, Intros
231231
if (trajectory())
232232
trajectory()->getRobotTrajectoryMsg(t.trajectory);
233233

234-
this->end()->scene()->getPlanningSceneDiffMsg(t.scene_diff);
235-
// reset JointStates (joints are already handled in trajectories)
236-
t.scene_diff.robot_state.joint_state = sensor_msgs::JointState();
237-
t.scene_diff.robot_state.multi_dof_joint_state = sensor_msgs::MultiDOFJointState();
234+
if (this->end()->scene()->getParent() == this->start()->scene())
235+
this->end()->scene()->getPlanningSceneDiffMsg(t.scene_diff);
236+
else
237+
this->end()->scene()->getPlanningSceneMsg(t.scene_diff);
238238
}
239239

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

0 commit comments

Comments
 (0)