diff --git a/planning_scene/src/planning_scene.cpp b/planning_scene/src/planning_scene.cpp index b5078539..0c5a4a3c 100644 --- a/planning_scene/src/planning_scene.cpp +++ b/planning_scene/src/planning_scene.cpp @@ -909,11 +909,18 @@ void planning_scene::PlanningScene::getPlanningSceneMsg(moveit_msgs::PlanningSce if (comp.components & moveit_msgs::PlanningSceneComponents::TRANSFORMS) getTransforms().copyTransforms(scene_msg.fixed_frame_transforms); - if (comp.components & moveit_msgs::PlanningSceneComponents::ROBOT_STATE_ATTACHED_OBJECTS) + if (comp.components & moveit_msgs::PlanningSceneComponents::ROBOT_STATE_ATTACHED_OBJECTS) { robot_state::robotStateToRobotStateMsg(getCurrentState(), scene_msg.robot_state, true); - else - if (comp.components & moveit_msgs::PlanningSceneComponents::ROBOT_STATE) + for(std::vector::iterator it + = scene_msg.robot_state.attached_collision_objects.begin(); + it != scene_msg.robot_state.attached_collision_objects.end(); ++it) { + if(hasObjectType(it->object.id)) { + it->object.type = getObjectType(it->object.id); + } + } + } else if (comp.components & moveit_msgs::PlanningSceneComponents::ROBOT_STATE) { robot_state::robotStateToRobotStateMsg(getCurrentState(), scene_msg.robot_state, false); + } if (comp.components & moveit_msgs::PlanningSceneComponents::ALLOWED_COLLISION_MATRIX) getAllowedCollisionMatrix().getMessage(scene_msg.allowed_collision_matrix);