Go to the documentation of this file.00001 #include "tidyup_actions/actionExecutorOpenDoorService.h"
00002 #include <pluginlib/class_list_macros.h>
00003 #include "tidyup_utils/planning_scene_interface.h"
00004
00005 PLUGINLIB_DECLARE_CLASS(tidyup_actions, action_executor_open_door_service,
00006 tidyup_actions::ActionExecutorOpenDoorService,
00007 continual_planning_executive::ActionExecutorInterface)
00008
00009 namespace tidyup_actions
00010 {
00011
00012 bool ActionExecutorOpenDoorService::fillGoal(std_srvs::Empty::Request & goal,
00013 const DurativeAction & a, const SymbolicState & current)
00014 {
00015 if(!PlanningSceneInterface::instance()->resetPlanningScene())
00016 ROS_ERROR("%s: PlanningScene reset failed.", __PRETTY_FUNCTION__);
00017
00018 return true;
00019 }
00020
00021 void ActionExecutorOpenDoorService::updateState(bool success,
00022 std_srvs::Empty::Response & response,
00023 const DurativeAction & a, SymbolicState & current)
00024 {
00025 ROS_INFO("OpenDoorService returned result");
00026 ROS_ASSERT(a.parameters.size() == 3);
00027 string location = a.parameters[0];
00028 string door = a.parameters[1];
00029 string arm = a.parameters[2];
00030
00031 if(success) {
00032 ROS_INFO("OpenDoorService succeeded.");
00033 current.setBooleanPredicate("door-open", door, true);
00034 }
00035
00036 current.setObjectFluent("arm-state", arm, "arm_unknown");
00037 current.setBooleanPredicate("door-state-known", door, false);
00038 }
00039
00040 };
00041