00001 00060 #ifndef TABLE_MARKER_H_ 00061 #define TABLE_MARKER_H_ 00062 00063 //################## 00064 //#### includes #### 00065 // standard includes 00066 #include <stdio.h> 00067 #include <sstream> 00068 00069 // ROS includes 00070 #include <ros/ros.h> 00071 //#include <sensor_msgs/PointCloud2.h> 00072 #include <visualization_msgs/Marker.h> 00073 #include <visualization_msgs/MarkerArray.h> 00074 #include <visualization_msgs/InteractiveMarker.h> 00075 #include <visualization_msgs/InteractiveMarkerControl.h> 00076 #include <visualization_msgs/InteractiveMarkerFeedback.h> 00077 //#include <visualization_msgs/MenuEntry.h> 00078 #include <interactive_markers/interactive_marker_server.h> 00079 #include <interactive_markers/menu_handler.h> 00080 00081 // PCL includes 00082 #include <pcl/pcl_config.h> 00083 #ifdef PCL_VERSION_COMPARE 00084 #include <pcl/common/transforms.h> 00085 #else 00086 #include <pcl/common/transform.h> 00087 #endif 00088 #include <pcl/common/eigen.h> 00089 #include <pcl/point_cloud.h> 00090 #include <pcl/ros/conversions.h> 00091 #include <pcl/point_types.h> 00092 #include <boost/shared_ptr.hpp> 00093 00094 // external includes 00095 #include <Eigen/Core> 00096 00097 //#include <cob_3d_visualization/polypartition.h> 00098 //#include <cob_3d_mapping_msgs/ShapeArray.h> 00099 #include <cob_3d_visualization/shape_marker.h> 00100 //#include <cob_3d_mapping_msgs/ModifyMap.h> 00101 00102 #include <cob_3d_mapping_common/ros_msg_conversions.h> 00103 #include "cob_3d_mapping_common/polygon.h" 00104 #include <cob_3d_mapping_msgs/MoveToTable.h> 00105 00106 00107 00108 00109 00110 class TableMarker 00111 { 00112 public: 00113 // Constructor 00114 TableMarker (boost::shared_ptr<interactive_markers::InteractiveMarkerServer> server,cob_3d_mapping_msgs::Shape& table,int ctr/*, 00115 tabletop_object_detector::Table& tableMsg*/) ; 00116 // Destructor 00117 ~TableMarker () 00118 { 00119 00120 } 00128 void createMarkerforTable (visualization_msgs::InteractiveMarkerControl& im_ctrl); 00132 void createInteractiveMarkerForTable(); 00139 TPPLPoint msgToPoint2DforTable (const pcl::PointXYZ &point); 00144 void tableFeedbackCallback(const visualization_msgs::InteractiveMarkerFeedbackConstPtr& feedback); 00148 void createTableMenu(); 00153 void MoveToTheTable(const visualization_msgs::InteractiveMarkerFeedbackConstPtr& feedback); 00154 00155 protected: 00156 visualization_msgs::InteractiveMarker table_int_marker_ ; 00157 visualization_msgs::Marker table_marker_; 00158 00159 ros::NodeHandle nh_; 00160 00161 cob_3d_mapping_msgs::Shape table_; 00162 00163 ros::Publisher goal_pub_ ; 00164 00165 00166 visualization_msgs::InteractiveMarkerControl im_ctrl; 00167 boost::shared_ptr<interactive_markers::InteractiveMarkerServer> table_im_server_; 00168 interactive_markers::MenuHandler table_menu_handler_; 00169 00170 Eigen::Affine3f transformation_; 00171 Eigen::Affine3f transformation_inv_; 00172 00173 int id_; 00174 00175 // Table Parameters 00176 //tabletop_object_detector::Table table_msg_; 00177 00178 }; 00179 00180 00181 #endif /* TABLE_MARKER_H_ */