simplepickplace.hpp
Go to the documentation of this file.
00001 /*
00002  * Copyright 2016 SoftBank Robotics Europe
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015 */
00016 
00017 #ifndef SIMPLEACTIONS_HPP
00018 #define SIMPLEACTIONS_HPP
00019 
00020 #include <ros/ros.h>
00021 #include <moveit_visual_tools/moveit_visual_tools.h>
00022 #include <moveit/planning_scene_interface/planning_scene_interface.h>
00023 
00024 #include "romeo_moveit_actions/metablock.hpp"
00025 #include "romeo_moveit_actions/action.hpp"
00026 #include "romeo_moveit_actions/objprocessing.hpp"
00027 #include "romeo_moveit_actions/evaluation.hpp"
00028 
00029 namespace moveit_simple_actions
00030 {
00031 
00033 class SimplePickPlace
00034 {
00035 public:
00037   SimplePickPlace(const std::string robot_name,
00038                   const double test_step,
00039                   const double x_min,
00040                   const double x_max,
00041                   const double y_min,
00042                   const double y_max,
00043                   const double z_min,
00044                   const double z_max,
00045                   const std::string left_arm_name,
00046                   const std::string right_arm_name,
00047                   const bool verbose);
00048 
00050   void run();
00051 
00052 protected:
00054   MetaBlock createTable();
00055 
00057   void switchArm(Action *action_now);
00058 
00060   void createObj(const MetaBlock &block);
00061 
00063   void resetBlock(MetaBlock *block);
00064 
00066   void getCollisionObjects(const moveit_msgs::CollisionObject::ConstPtr& msg);
00067 
00069   void cleanObjects(std::vector<MetaBlock> *objects,
00070                     const bool list_erase=true);
00071 
00073   bool checkObj(int &block_id);
00074 
00076   ros::NodeHandle nh_, nh_priv_;
00077 
00079   std::string robot_name_;
00080 
00082   const bool verbose_;
00083 
00085   std::string base_frame_;
00086 
00088   double block_size_x_;
00089 
00091   double block_size_y_;
00092 
00094   double floor_to_base_height_;
00095 
00097   ObjProcessor obj_proc_;
00098 
00100   Evaluation evaluation_;
00101 
00103   bool env_shown_;
00104 
00105   //the working space of the robot
00106   double x_min_;
00107   double x_max_;
00108   double y_min_;
00109   double y_max_;
00110   double z_min_;
00111   double z_max_;
00112 
00114   std::string support_surface_;
00115 
00117   Action *action_left_;
00118 
00120   Action *action_right_;
00121 
00123   moveit_visual_tools::MoveItVisualToolsPtr visual_tools_;
00124 
00126   moveit::planning_interface::PlanningSceneInterface current_scene_;
00127 
00129   std::vector<MetaBlock> blocks_surfaces_;
00130 
00132   ros::Subscriber sub_obj_coll_;
00133 
00135   ros::Publisher pub_obj_pose_;
00136 
00138   geometry_msgs::PoseStamped msg_obj_pose_;
00139 
00141   geometry_msgs::Pose pose_default_;
00142 
00144   geometry_msgs::Pose pose_default_r_;
00145 
00147   geometry_msgs::Pose pose_zero_;
00148 
00150   std::vector <geometry_msgs::Pose> stat_poses_success_;
00151 
00153   ros::Publisher pub_obj_moveit_;
00154 
00156   ros::Rate rate_;
00157 };
00158 }
00159 
00160 #endif // SIMPLEACTIONS_HPP


romeo_moveit_actions
Author(s):
autogenerated on Thu Jun 6 2019 21:57:24