00001 /********************************************************************* 00002 * Software License Agreement (BSD License) 00003 * 00004 * Copyright (c) 2008, Willow Garage, Inc. 00005 * All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * * Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * * Redistributions in binary form must reproduce the above 00014 * copyright notice, this list of conditions and the following 00015 * disclaimer in the documentation and/or other materials provided 00016 * with the distribution. 00017 * * Neither the name of Willow Garage, Inc. nor the names of its 00018 * contributors may be used to endorse or promote products derived 00019 * from this software without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00022 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00023 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00024 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00025 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00026 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00027 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00028 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00029 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00030 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00031 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00032 * POSSIBILITY OF SUCH DAMAGE. 00033 *********************************************************************/ 00034 00037 #ifndef OMPL_ROS_TASK_SPACE_PLANNER_H_ 00038 #define OMPL_ROS_TASK_SPACE_PLANNER_H_ 00039 00040 // OMPL ROS Interface 00041 #include <ompl_ros_interface/ompl_ros_planning_group.h> 00042 #include <ompl_ros_interface/ik/ompl_ros_ik_sampler.h> 00043 #include <ompl_ros_interface/state_validity_checkers/ompl_ros_task_space_validity_checker.h> 00044 00045 #include <ompl/base/GoalStates.h> 00046 00047 namespace ompl_ros_interface 00048 { 00053 class OmplRosTaskSpacePlanner: public OmplRosPlanningGroup 00054 { 00055 public: 00056 00057 OmplRosTaskSpacePlanner(){} 00058 ~OmplRosTaskSpacePlanner(){} 00059 00060 protected: 00061 00065 virtual bool isRequestValid(motion_planning_msgs::GetMotionPlan::Request &request, 00066 motion_planning_msgs::GetMotionPlan::Response &response); 00067 00071 virtual bool setStart(motion_planning_msgs::GetMotionPlan::Request &request, 00072 motion_planning_msgs::GetMotionPlan::Response &response); 00073 00077 virtual bool setGoal(motion_planning_msgs::GetMotionPlan::Request &request, 00078 motion_planning_msgs::GetMotionPlan::Response &response); 00079 00083 virtual bool initializeStateValidityChecker(ompl_ros_interface::OmplRosStateValidityCheckerPtr &state_validity_checker); 00084 00088 virtual bool initializePlanningStateSpace(ompl::base::StateSpacePtr &state_space); 00089 00097 bool getSpaceFromParamServer(const ros::NodeHandle &node_handle, 00098 const std::string &space_name, 00099 ompl::base::StateSpacePtr& state_space, 00100 int& real_vector_index); 00101 00102 protected: 00103 00104 std::string planning_frame_id_; 00105 00106 std::string end_effector_name_; 00110 virtual motion_planning_msgs::RobotTrajectory getSolutionPath() = 0; 00111 00112 boost::shared_ptr<ompl_ros_interface::OmplRosStateTransformer> state_transformer_; 00113 00114 virtual bool constraintsToOmplState(const motion_planning_msgs::Constraints &constraints, 00115 ompl::base::ScopedState<ompl::base::CompoundStateSpace> &goal); 00116 00117 }; 00118 } 00119 #endif //OMPL_ROS_TASK_SPACE_PLANNER_H_