Go to the documentation of this file.00001
00002 #ifndef TABLETOP_OBJECT_DETECTOR_SERVICE_TABLETOPSEGMENTATION_H
00003 #define TABLETOP_OBJECT_DETECTOR_SERVICE_TABLETOPSEGMENTATION_H
00004 #include <string>
00005 #include <vector>
00006 #include <map>
00007 #include <ostream>
00008 #include "ros/serialization.h"
00009 #include "ros/builtin_message_traits.h"
00010 #include "ros/message_operations.h"
00011 #include "ros/time.h"
00012
00013 #include "ros/macros.h"
00014
00015 #include "ros/assert.h"
00016
00017 #include "ros/service_traits.h"
00018
00019 #include "tabletop_object_detector/Table.h"
00020
00021
00022 #include "tabletop_object_detector/Table.h"
00023 #include "sensor_msgs/PointCloud.h"
00024
00025 namespace tabletop_object_detector
00026 {
00027 template <class ContainerAllocator>
00028 struct TabletopSegmentationRequest_ {
00029 typedef TabletopSegmentationRequest_<ContainerAllocator> Type;
00030
00031 TabletopSegmentationRequest_()
00032 : table()
00033 {
00034 }
00035
00036 TabletopSegmentationRequest_(const ContainerAllocator& _alloc)
00037 : table(_alloc)
00038 {
00039 }
00040
00041 typedef ::tabletop_object_detector::Table_<ContainerAllocator> _table_type;
00042 ::tabletop_object_detector::Table_<ContainerAllocator> table;
00043
00044
00045 typedef boost::shared_ptr< ::tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> > Ptr;
00046 typedef boost::shared_ptr< ::tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> const> ConstPtr;
00047 boost::shared_ptr<std::map<std::string, std::string> > __connection_header;
00048 };
00049 typedef ::tabletop_object_detector::TabletopSegmentationRequest_<std::allocator<void> > TabletopSegmentationRequest;
00050
00051 typedef boost::shared_ptr< ::tabletop_object_detector::TabletopSegmentationRequest> TabletopSegmentationRequestPtr;
00052 typedef boost::shared_ptr< ::tabletop_object_detector::TabletopSegmentationRequest const> TabletopSegmentationRequestConstPtr;
00053
00054
00055 template <class ContainerAllocator>
00056 struct TabletopSegmentationResponse_ {
00057 typedef TabletopSegmentationResponse_<ContainerAllocator> Type;
00058
00059 TabletopSegmentationResponse_()
00060 : table()
00061 , clusters()
00062 , result(0)
00063 {
00064 }
00065
00066 TabletopSegmentationResponse_(const ContainerAllocator& _alloc)
00067 : table(_alloc)
00068 , clusters(_alloc)
00069 , result(0)
00070 {
00071 }
00072
00073 typedef ::tabletop_object_detector::Table_<ContainerAllocator> _table_type;
00074 ::tabletop_object_detector::Table_<ContainerAllocator> table;
00075
00076 typedef std::vector< ::sensor_msgs::PointCloud_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::sensor_msgs::PointCloud_<ContainerAllocator> >::other > _clusters_type;
00077 std::vector< ::sensor_msgs::PointCloud_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::sensor_msgs::PointCloud_<ContainerAllocator> >::other > clusters;
00078
00079 typedef int32_t _result_type;
00080 int32_t result;
00081
00082 enum { NO_CLOUD_RECEIVED = 1 };
00083 enum { NO_TABLE = 2 };
00084 enum { OTHER_ERROR = 3 };
00085 enum { SUCCESS = 4 };
00086
00087 typedef boost::shared_ptr< ::tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> > Ptr;
00088 typedef boost::shared_ptr< ::tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> const> ConstPtr;
00089 boost::shared_ptr<std::map<std::string, std::string> > __connection_header;
00090 };
00091 typedef ::tabletop_object_detector::TabletopSegmentationResponse_<std::allocator<void> > TabletopSegmentationResponse;
00092
00093 typedef boost::shared_ptr< ::tabletop_object_detector::TabletopSegmentationResponse> TabletopSegmentationResponsePtr;
00094 typedef boost::shared_ptr< ::tabletop_object_detector::TabletopSegmentationResponse const> TabletopSegmentationResponseConstPtr;
00095
00096 struct TabletopSegmentation
00097 {
00098
00099 typedef TabletopSegmentationRequest Request;
00100 typedef TabletopSegmentationResponse Response;
00101 Request request;
00102 Response response;
00103
00104 typedef Request RequestType;
00105 typedef Response ResponseType;
00106 };
00107 }
00108
00109 namespace ros
00110 {
00111 namespace message_traits
00112 {
00113 template<class ContainerAllocator> struct IsMessage< ::tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> > : public TrueType {};
00114 template<class ContainerAllocator> struct IsMessage< ::tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> const> : public TrueType {};
00115 template<class ContainerAllocator>
00116 struct MD5Sum< ::tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> > {
00117 static const char* value()
00118 {
00119 return "eb8b1c91882b1925278d37d3e15fd20a";
00120 }
00121
00122 static const char* value(const ::tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> &) { return value(); }
00123 static const uint64_t static_value1 = 0xeb8b1c91882b1925ULL;
00124 static const uint64_t static_value2 = 0x278d37d3e15fd20aULL;
00125 };
00126
00127 template<class ContainerAllocator>
00128 struct DataType< ::tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> > {
00129 static const char* value()
00130 {
00131 return "tabletop_object_detector/TabletopSegmentationRequest";
00132 }
00133
00134 static const char* value(const ::tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> &) { return value(); }
00135 };
00136
00137 template<class ContainerAllocator>
00138 struct Definition< ::tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> > {
00139 static const char* value()
00140 {
00141 return "\n\
00142 \n\
00143 \n\
00144 Table table\n\
00145 \n\
00146 \n\
00147 ================================================================================\n\
00148 MSG: tabletop_object_detector/Table\n\
00149 # Informs that a planar table has been detected at a given location\n\
00150 \n\
00151 # The pose gives you the transform that take you to the coordinate system\n\
00152 # of the table, with the origin somewhere in the table plane and the \n\
00153 # z axis normal to the plane\n\
00154 geometry_msgs/PoseStamped pose\n\
00155 \n\
00156 # These values give you the observed extents of the table, along x and y,\n\
00157 # in the table's own coordinate system (above)\n\
00158 # there is no guarantee that the origin of the table coordinate system is\n\
00159 # inside the boundary defined by these values. \n\
00160 float32 x_min\n\
00161 float32 x_max\n\
00162 float32 y_min\n\
00163 float32 y_max\n\
00164 \n\
00165 # There is no guarantee that the table does NOT extend further than these \n\
00166 # values; this is just as far as we've observed it.\n\
00167 \n\
00168 \n\
00169 # Newer table definition as triangle mesh of convex hull (relative to pose)\n\
00170 arm_navigation_msgs/Shape convex_hull\n\
00171 \n\
00172 ================================================================================\n\
00173 MSG: geometry_msgs/PoseStamped\n\
00174 # A Pose with reference coordinate frame and timestamp\n\
00175 Header header\n\
00176 Pose pose\n\
00177 \n\
00178 ================================================================================\n\
00179 MSG: std_msgs/Header\n\
00180 # Standard metadata for higher-level stamped data types.\n\
00181 # This is generally used to communicate timestamped data \n\
00182 # in a particular coordinate frame.\n\
00183 # \n\
00184 # sequence ID: consecutively increasing ID \n\
00185 uint32 seq\n\
00186 #Two-integer timestamp that is expressed as:\n\
00187 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00188 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00189 # time-handling sugar is provided by the client library\n\
00190 time stamp\n\
00191 #Frame this data is associated with\n\
00192 # 0: no frame\n\
00193 # 1: global frame\n\
00194 string frame_id\n\
00195 \n\
00196 ================================================================================\n\
00197 MSG: geometry_msgs/Pose\n\
00198 # A representation of pose in free space, composed of postion and orientation. \n\
00199 Point position\n\
00200 Quaternion orientation\n\
00201 \n\
00202 ================================================================================\n\
00203 MSG: geometry_msgs/Point\n\
00204 # This contains the position of a point in free space\n\
00205 float64 x\n\
00206 float64 y\n\
00207 float64 z\n\
00208 \n\
00209 ================================================================================\n\
00210 MSG: geometry_msgs/Quaternion\n\
00211 # This represents an orientation in free space in quaternion form.\n\
00212 \n\
00213 float64 x\n\
00214 float64 y\n\
00215 float64 z\n\
00216 float64 w\n\
00217 \n\
00218 ================================================================================\n\
00219 MSG: arm_navigation_msgs/Shape\n\
00220 byte SPHERE=0\n\
00221 byte BOX=1\n\
00222 byte CYLINDER=2\n\
00223 byte MESH=3\n\
00224 \n\
00225 byte type\n\
00226 \n\
00227 \n\
00228 #### define sphere, box, cylinder ####\n\
00229 # the origin of each shape is considered at the shape's center\n\
00230 \n\
00231 # for sphere\n\
00232 # radius := dimensions[0]\n\
00233 \n\
00234 # for cylinder\n\
00235 # radius := dimensions[0]\n\
00236 # length := dimensions[1]\n\
00237 # the length is along the Z axis\n\
00238 \n\
00239 # for box\n\
00240 # size_x := dimensions[0]\n\
00241 # size_y := dimensions[1]\n\
00242 # size_z := dimensions[2]\n\
00243 float64[] dimensions\n\
00244 \n\
00245 \n\
00246 #### define mesh ####\n\
00247 \n\
00248 # list of triangles; triangle k is defined by tre vertices located\n\
00249 # at indices triangles[3k], triangles[3k+1], triangles[3k+2]\n\
00250 int32[] triangles\n\
00251 geometry_msgs/Point[] vertices\n\
00252 \n\
00253 ";
00254 }
00255
00256 static const char* value(const ::tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> &) { return value(); }
00257 };
00258
00259 }
00260 }
00261
00262
00263 namespace ros
00264 {
00265 namespace message_traits
00266 {
00267 template<class ContainerAllocator> struct IsMessage< ::tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> > : public TrueType {};
00268 template<class ContainerAllocator> struct IsMessage< ::tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> const> : public TrueType {};
00269 template<class ContainerAllocator>
00270 struct MD5Sum< ::tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> > {
00271 static const char* value()
00272 {
00273 return "1ece7d86360ba38c12673652ea654b18";
00274 }
00275
00276 static const char* value(const ::tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> &) { return value(); }
00277 static const uint64_t static_value1 = 0x1ece7d86360ba38cULL;
00278 static const uint64_t static_value2 = 0x12673652ea654b18ULL;
00279 };
00280
00281 template<class ContainerAllocator>
00282 struct DataType< ::tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> > {
00283 static const char* value()
00284 {
00285 return "tabletop_object_detector/TabletopSegmentationResponse";
00286 }
00287
00288 static const char* value(const ::tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> &) { return value(); }
00289 };
00290
00291 template<class ContainerAllocator>
00292 struct Definition< ::tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> > {
00293 static const char* value()
00294 {
00295 return "\n\
00296 \n\
00297 Table table\n\
00298 \n\
00299 \n\
00300 sensor_msgs/PointCloud[] clusters\n\
00301 \n\
00302 \n\
00303 int32 NO_CLOUD_RECEIVED = 1\n\
00304 int32 NO_TABLE = 2\n\
00305 int32 OTHER_ERROR = 3\n\
00306 int32 SUCCESS = 4\n\
00307 int32 result\n\
00308 \n\
00309 \n\
00310 ================================================================================\n\
00311 MSG: tabletop_object_detector/Table\n\
00312 # Informs that a planar table has been detected at a given location\n\
00313 \n\
00314 # The pose gives you the transform that take you to the coordinate system\n\
00315 # of the table, with the origin somewhere in the table plane and the \n\
00316 # z axis normal to the plane\n\
00317 geometry_msgs/PoseStamped pose\n\
00318 \n\
00319 # These values give you the observed extents of the table, along x and y,\n\
00320 # in the table's own coordinate system (above)\n\
00321 # there is no guarantee that the origin of the table coordinate system is\n\
00322 # inside the boundary defined by these values. \n\
00323 float32 x_min\n\
00324 float32 x_max\n\
00325 float32 y_min\n\
00326 float32 y_max\n\
00327 \n\
00328 # There is no guarantee that the table does NOT extend further than these \n\
00329 # values; this is just as far as we've observed it.\n\
00330 \n\
00331 \n\
00332 # Newer table definition as triangle mesh of convex hull (relative to pose)\n\
00333 arm_navigation_msgs/Shape convex_hull\n\
00334 \n\
00335 ================================================================================\n\
00336 MSG: geometry_msgs/PoseStamped\n\
00337 # A Pose with reference coordinate frame and timestamp\n\
00338 Header header\n\
00339 Pose pose\n\
00340 \n\
00341 ================================================================================\n\
00342 MSG: std_msgs/Header\n\
00343 # Standard metadata for higher-level stamped data types.\n\
00344 # This is generally used to communicate timestamped data \n\
00345 # in a particular coordinate frame.\n\
00346 # \n\
00347 # sequence ID: consecutively increasing ID \n\
00348 uint32 seq\n\
00349 #Two-integer timestamp that is expressed as:\n\
00350 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00351 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00352 # time-handling sugar is provided by the client library\n\
00353 time stamp\n\
00354 #Frame this data is associated with\n\
00355 # 0: no frame\n\
00356 # 1: global frame\n\
00357 string frame_id\n\
00358 \n\
00359 ================================================================================\n\
00360 MSG: geometry_msgs/Pose\n\
00361 # A representation of pose in free space, composed of postion and orientation. \n\
00362 Point position\n\
00363 Quaternion orientation\n\
00364 \n\
00365 ================================================================================\n\
00366 MSG: geometry_msgs/Point\n\
00367 # This contains the position of a point in free space\n\
00368 float64 x\n\
00369 float64 y\n\
00370 float64 z\n\
00371 \n\
00372 ================================================================================\n\
00373 MSG: geometry_msgs/Quaternion\n\
00374 # This represents an orientation in free space in quaternion form.\n\
00375 \n\
00376 float64 x\n\
00377 float64 y\n\
00378 float64 z\n\
00379 float64 w\n\
00380 \n\
00381 ================================================================================\n\
00382 MSG: arm_navigation_msgs/Shape\n\
00383 byte SPHERE=0\n\
00384 byte BOX=1\n\
00385 byte CYLINDER=2\n\
00386 byte MESH=3\n\
00387 \n\
00388 byte type\n\
00389 \n\
00390 \n\
00391 #### define sphere, box, cylinder ####\n\
00392 # the origin of each shape is considered at the shape's center\n\
00393 \n\
00394 # for sphere\n\
00395 # radius := dimensions[0]\n\
00396 \n\
00397 # for cylinder\n\
00398 # radius := dimensions[0]\n\
00399 # length := dimensions[1]\n\
00400 # the length is along the Z axis\n\
00401 \n\
00402 # for box\n\
00403 # size_x := dimensions[0]\n\
00404 # size_y := dimensions[1]\n\
00405 # size_z := dimensions[2]\n\
00406 float64[] dimensions\n\
00407 \n\
00408 \n\
00409 #### define mesh ####\n\
00410 \n\
00411 # list of triangles; triangle k is defined by tre vertices located\n\
00412 # at indices triangles[3k], triangles[3k+1], triangles[3k+2]\n\
00413 int32[] triangles\n\
00414 geometry_msgs/Point[] vertices\n\
00415 \n\
00416 ================================================================================\n\
00417 MSG: sensor_msgs/PointCloud\n\
00418 # This message holds a collection of 3d points, plus optional additional\n\
00419 # information about each point.\n\
00420 \n\
00421 # Time of sensor data acquisition, coordinate frame ID.\n\
00422 Header header\n\
00423 \n\
00424 # Array of 3d points. Each Point32 should be interpreted as a 3d point\n\
00425 # in the frame given in the header.\n\
00426 geometry_msgs/Point32[] points\n\
00427 \n\
00428 # Each channel should have the same number of elements as points array,\n\
00429 # and the data in each channel should correspond 1:1 with each point.\n\
00430 # Channel names in common practice are listed in ChannelFloat32.msg.\n\
00431 ChannelFloat32[] channels\n\
00432 \n\
00433 ================================================================================\n\
00434 MSG: geometry_msgs/Point32\n\
00435 # This contains the position of a point in free space(with 32 bits of precision).\n\
00436 # It is recommeded to use Point wherever possible instead of Point32. \n\
00437 # \n\
00438 # This recommendation is to promote interoperability. \n\
00439 #\n\
00440 # This message is designed to take up less space when sending\n\
00441 # lots of points at once, as in the case of a PointCloud. \n\
00442 \n\
00443 float32 x\n\
00444 float32 y\n\
00445 float32 z\n\
00446 ================================================================================\n\
00447 MSG: sensor_msgs/ChannelFloat32\n\
00448 # This message is used by the PointCloud message to hold optional data\n\
00449 # associated with each point in the cloud. The length of the values\n\
00450 # array should be the same as the length of the points array in the\n\
00451 # PointCloud, and each value should be associated with the corresponding\n\
00452 # point.\n\
00453 \n\
00454 # Channel names in existing practice include:\n\
00455 # \"u\", \"v\" - row and column (respectively) in the left stereo image.\n\
00456 # This is opposite to usual conventions but remains for\n\
00457 # historical reasons. The newer PointCloud2 message has no\n\
00458 # such problem.\n\
00459 # \"rgb\" - For point clouds produced by color stereo cameras. uint8\n\
00460 # (R,G,B) values packed into the least significant 24 bits,\n\
00461 # in order.\n\
00462 # \"intensity\" - laser or pixel intensity.\n\
00463 # \"distance\"\n\
00464 \n\
00465 # The channel name should give semantics of the channel (e.g.\n\
00466 # \"intensity\" instead of \"value\").\n\
00467 string name\n\
00468 \n\
00469 # The values array should be 1-1 with the elements of the associated\n\
00470 # PointCloud.\n\
00471 float32[] values\n\
00472 \n\
00473 ";
00474 }
00475
00476 static const char* value(const ::tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> &) { return value(); }
00477 };
00478
00479 }
00480 }
00481
00482 namespace ros
00483 {
00484 namespace serialization
00485 {
00486
00487 template<class ContainerAllocator> struct Serializer< ::tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> >
00488 {
00489 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00490 {
00491 stream.next(m.table);
00492 }
00493
00494 ROS_DECLARE_ALLINONE_SERIALIZER;
00495 };
00496 }
00497 }
00498
00499
00500 namespace ros
00501 {
00502 namespace serialization
00503 {
00504
00505 template<class ContainerAllocator> struct Serializer< ::tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> >
00506 {
00507 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00508 {
00509 stream.next(m.table);
00510 stream.next(m.clusters);
00511 stream.next(m.result);
00512 }
00513
00514 ROS_DECLARE_ALLINONE_SERIALIZER;
00515 };
00516 }
00517 }
00518
00519 namespace ros
00520 {
00521 namespace service_traits
00522 {
00523 template<>
00524 struct MD5Sum<tabletop_object_detector::TabletopSegmentation> {
00525 static const char* value()
00526 {
00527 return "f7ebff3d714e0788849f9ca334c83a5f";
00528 }
00529
00530 static const char* value(const tabletop_object_detector::TabletopSegmentation&) { return value(); }
00531 };
00532
00533 template<>
00534 struct DataType<tabletop_object_detector::TabletopSegmentation> {
00535 static const char* value()
00536 {
00537 return "tabletop_object_detector/TabletopSegmentation";
00538 }
00539
00540 static const char* value(const tabletop_object_detector::TabletopSegmentation&) { return value(); }
00541 };
00542
00543 template<class ContainerAllocator>
00544 struct MD5Sum<tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> > {
00545 static const char* value()
00546 {
00547 return "f7ebff3d714e0788849f9ca334c83a5f";
00548 }
00549
00550 static const char* value(const tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> &) { return value(); }
00551 };
00552
00553 template<class ContainerAllocator>
00554 struct DataType<tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> > {
00555 static const char* value()
00556 {
00557 return "tabletop_object_detector/TabletopSegmentation";
00558 }
00559
00560 static const char* value(const tabletop_object_detector::TabletopSegmentationRequest_<ContainerAllocator> &) { return value(); }
00561 };
00562
00563 template<class ContainerAllocator>
00564 struct MD5Sum<tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> > {
00565 static const char* value()
00566 {
00567 return "f7ebff3d714e0788849f9ca334c83a5f";
00568 }
00569
00570 static const char* value(const tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> &) { return value(); }
00571 };
00572
00573 template<class ContainerAllocator>
00574 struct DataType<tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> > {
00575 static const char* value()
00576 {
00577 return "tabletop_object_detector/TabletopSegmentation";
00578 }
00579
00580 static const char* value(const tabletop_object_detector::TabletopSegmentationResponse_<ContainerAllocator> &) { return value(); }
00581 };
00582
00583 }
00584 }
00585
00586 #endif // TABLETOP_OBJECT_DETECTOR_SERVICE_TABLETOPSEGMENTATION_H
00587