Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef METABLOCK_H
00018 #define METABLOCK_H
00019
00020
00021 #include <ros/ros.h>
00022
00023 #include <geometry_msgs/Pose.h>
00024 #include <geometry_msgs/PoseStamped.h>
00025 #include <tf/transform_listener.h>
00026
00027 #include <geometric_shapes/solid_primitive_dims.h>
00028
00029 #include <moveit_msgs/CollisionObject.h>
00030
00031 #include <moveit/planning_scene_interface/planning_scene_interface.h>
00032
00033 #include <object_recognition_msgs/RecognizedObjectArray.h>
00034
00035 typedef shape_msgs::SolidPrimitive sprimitive;
00036 typedef moveit_msgs::CollisionObject mcollobj;
00037 typedef moveit::planning_interface::PlanningSceneInterface mscene;
00038
00039 namespace moveit_simple_actions
00040 {
00041
00043 class MetaBlock
00044 {
00045 public:
00047 MetaBlock(const std::string name,
00048 const geometry_msgs::Pose pose,
00049 const uint &shapeType,
00050 const float &size_x,
00051 const float &size_y,
00052 const float &size_z,
00053 ros::Time timestamp=ros::Time::now(),
00054 std::string base_frame="base_link");
00055
00057 MetaBlock(const std::string name,
00058 const geometry_msgs::Pose pose,
00059 const shape_msgs::Mesh mesh,
00060 const object_recognition_msgs::ObjectType type,
00061 ros::Time timestamp=ros::Time::now(),
00062 std::string base_frame="odom");
00063
00065 void updatePose(const geometry_msgs::Pose &pose);
00066
00068 void updatePoseVis(const geometry_msgs::Pose &pose);
00069
00071 void updatePose(mscene *current_scene,
00072 const geometry_msgs::Pose &pose);
00073
00075 void removeBlock(mscene *current_scene);
00076
00078 void publishBlock(mscene *current_scene);
00079
00081 tf::Stamped<tf::Pose> getTransform(tf::TransformListener *listener,
00082 const std::string &frame);
00083
00085 geometry_msgs::PoseStamped getTransformed(tf::TransformListener *listener,
00086 const std::string &frame);
00087
00089 std::string name_;
00090
00092 geometry_msgs::Pose pose_;
00093
00095 geometry_msgs::Pose goal_pose_;
00096
00098 moveit_msgs::CollisionObject collObj_;
00099
00101 double size_x_;
00102
00104 double size_y_;
00105
00107 double size_z_;
00108
00110 ros::Time timestamp_;
00111
00113 std::string base_frame_;
00114
00116 object_recognition_msgs::ObjectType type_;
00117
00118 protected:
00120 shape_msgs::SolidPrimitive shape_;
00121
00123 shape_msgs::Mesh mesh_;
00124 };
00125 }
00126
00127 #endif // METABLOCK_H