00001
00002 #ifndef SENSOR_MSGS_MESSAGE_POINTCLOUD2_H
00003 #define SENSOR_MSGS_MESSAGE_POINTCLOUD2_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 "std_msgs/Header.h"
00018 #include "sensor_msgs/PointField.h"
00019
00020 namespace sensor_msgs
00021 {
00022 template <class ContainerAllocator>
00023 struct PointCloud2_ {
00024 typedef PointCloud2_<ContainerAllocator> Type;
00025
00026 PointCloud2_()
00027 : header()
00028 , height(0)
00029 , width(0)
00030 , fields()
00031 , is_bigendian(false)
00032 , point_step(0)
00033 , row_step(0)
00034 , data()
00035 , is_dense(false)
00036 {
00037 }
00038
00039 PointCloud2_(const ContainerAllocator& _alloc)
00040 : header(_alloc)
00041 , height(0)
00042 , width(0)
00043 , fields(_alloc)
00044 , is_bigendian(false)
00045 , point_step(0)
00046 , row_step(0)
00047 , data(_alloc)
00048 , is_dense(false)
00049 {
00050 }
00051
00052 typedef ::std_msgs::Header_<ContainerAllocator> _header_type;
00053 ::std_msgs::Header_<ContainerAllocator> header;
00054
00055 typedef uint32_t _height_type;
00056 uint32_t height;
00057
00058 typedef uint32_t _width_type;
00059 uint32_t width;
00060
00061 typedef std::vector< ::sensor_msgs::PointField_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::sensor_msgs::PointField_<ContainerAllocator> >::other > _fields_type;
00062 std::vector< ::sensor_msgs::PointField_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::sensor_msgs::PointField_<ContainerAllocator> >::other > fields;
00063
00064 typedef uint8_t _is_bigendian_type;
00065 uint8_t is_bigendian;
00066
00067 typedef uint32_t _point_step_type;
00068 uint32_t point_step;
00069
00070 typedef uint32_t _row_step_type;
00071 uint32_t row_step;
00072
00073 typedef std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > _data_type;
00074 std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > data;
00075
00076 typedef uint8_t _is_dense_type;
00077 uint8_t is_dense;
00078
00079
00080 ROS_DEPRECATED uint32_t get_fields_size() const { return (uint32_t)fields.size(); }
00081 ROS_DEPRECATED void set_fields_size(uint32_t size) { fields.resize((size_t)size); }
00082 ROS_DEPRECATED void get_fields_vec(std::vector< ::sensor_msgs::PointField_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::sensor_msgs::PointField_<ContainerAllocator> >::other > & vec) const { vec = this->fields; }
00083 ROS_DEPRECATED void set_fields_vec(const std::vector< ::sensor_msgs::PointField_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::sensor_msgs::PointField_<ContainerAllocator> >::other > & vec) { this->fields = vec; }
00084 ROS_DEPRECATED uint32_t get_data_size() const { return (uint32_t)data.size(); }
00085 ROS_DEPRECATED void set_data_size(uint32_t size) { data.resize((size_t)size); }
00086 ROS_DEPRECATED void get_data_vec(std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > & vec) const { vec = this->data; }
00087 ROS_DEPRECATED void set_data_vec(const std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > & vec) { this->data = vec; }
00088 private:
00089 static const char* __s_getDataType_() { return "sensor_msgs/PointCloud2"; }
00090 public:
00091 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00092
00093 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00094
00095 private:
00096 static const char* __s_getMD5Sum_() { return "1158d486dd51d683ce2f1be655c3c181"; }
00097 public:
00098 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00099
00100 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00101
00102 private:
00103 static const char* __s_getMessageDefinition_() { return "# This message holds a collection of N-dimensional points, which may\n\
00104 # contain additional information such as normals, intensity, etc. The\n\
00105 # point data is stored as a binary blob, its layout described by the\n\
00106 # contents of the \"fields\" array.\n\
00107 \n\
00108 # The point cloud data may be organized 2d (image-like) or 1d\n\
00109 # (unordered). Point clouds organized as 2d images may be produced by\n\
00110 # camera depth sensors such as stereo or time-of-flight.\n\
00111 \n\
00112 # Time of sensor data acquisition, and the coordinate frame ID (for 3d\n\
00113 # points).\n\
00114 Header header\n\
00115 \n\
00116 # 2D structure of the point cloud. If the cloud is unordered, height is\n\
00117 # 1 and width is the length of the point cloud.\n\
00118 uint32 height\n\
00119 uint32 width\n\
00120 \n\
00121 # Describes the channels and their layout in the binary data blob.\n\
00122 PointField[] fields\n\
00123 \n\
00124 bool is_bigendian # Is this data bigendian?\n\
00125 uint32 point_step # Length of a point in bytes\n\
00126 uint32 row_step # Length of a row in bytes\n\
00127 uint8[] data # Actual point data, size is (row_step*height)\n\
00128 \n\
00129 bool is_dense # True if there are no invalid points\n\
00130 \n\
00131 ================================================================================\n\
00132 MSG: std_msgs/Header\n\
00133 # Standard metadata for higher-level stamped data types.\n\
00134 # This is generally used to communicate timestamped data \n\
00135 # in a particular coordinate frame.\n\
00136 # \n\
00137 # sequence ID: consecutively increasing ID \n\
00138 uint32 seq\n\
00139 #Two-integer timestamp that is expressed as:\n\
00140 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00141 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00142 # time-handling sugar is provided by the client library\n\
00143 time stamp\n\
00144 #Frame this data is associated with\n\
00145 # 0: no frame\n\
00146 # 1: global frame\n\
00147 string frame_id\n\
00148 \n\
00149 ================================================================================\n\
00150 MSG: sensor_msgs/PointField\n\
00151 # This message holds the description of one point entry in the\n\
00152 # PointCloud2 message format.\n\
00153 uint8 INT8 = 1\n\
00154 uint8 UINT8 = 2\n\
00155 uint8 INT16 = 3\n\
00156 uint8 UINT16 = 4\n\
00157 uint8 INT32 = 5\n\
00158 uint8 UINT32 = 6\n\
00159 uint8 FLOAT32 = 7\n\
00160 uint8 FLOAT64 = 8\n\
00161 \n\
00162 string name # Name of field\n\
00163 uint32 offset # Offset from start of point struct\n\
00164 uint8 datatype # Datatype enumeration, see above\n\
00165 uint32 count # How many elements in the field\n\
00166 \n\
00167 "; }
00168 public:
00169 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00170
00171 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00172
00173 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00174 {
00175 ros::serialization::OStream stream(write_ptr, 1000000000);
00176 ros::serialization::serialize(stream, header);
00177 ros::serialization::serialize(stream, height);
00178 ros::serialization::serialize(stream, width);
00179 ros::serialization::serialize(stream, fields);
00180 ros::serialization::serialize(stream, is_bigendian);
00181 ros::serialization::serialize(stream, point_step);
00182 ros::serialization::serialize(stream, row_step);
00183 ros::serialization::serialize(stream, data);
00184 ros::serialization::serialize(stream, is_dense);
00185 return stream.getData();
00186 }
00187
00188 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00189 {
00190 ros::serialization::IStream stream(read_ptr, 1000000000);
00191 ros::serialization::deserialize(stream, header);
00192 ros::serialization::deserialize(stream, height);
00193 ros::serialization::deserialize(stream, width);
00194 ros::serialization::deserialize(stream, fields);
00195 ros::serialization::deserialize(stream, is_bigendian);
00196 ros::serialization::deserialize(stream, point_step);
00197 ros::serialization::deserialize(stream, row_step);
00198 ros::serialization::deserialize(stream, data);
00199 ros::serialization::deserialize(stream, is_dense);
00200 return stream.getData();
00201 }
00202
00203 ROS_DEPRECATED virtual uint32_t serializationLength() const
00204 {
00205 uint32_t size = 0;
00206 size += ros::serialization::serializationLength(header);
00207 size += ros::serialization::serializationLength(height);
00208 size += ros::serialization::serializationLength(width);
00209 size += ros::serialization::serializationLength(fields);
00210 size += ros::serialization::serializationLength(is_bigendian);
00211 size += ros::serialization::serializationLength(point_step);
00212 size += ros::serialization::serializationLength(row_step);
00213 size += ros::serialization::serializationLength(data);
00214 size += ros::serialization::serializationLength(is_dense);
00215 return size;
00216 }
00217
00218 typedef boost::shared_ptr< ::sensor_msgs::PointCloud2_<ContainerAllocator> > Ptr;
00219 typedef boost::shared_ptr< ::sensor_msgs::PointCloud2_<ContainerAllocator> const> ConstPtr;
00220 boost::shared_ptr<std::map<std::string, std::string> > __connection_header;
00221 };
00222 typedef ::sensor_msgs::PointCloud2_<std::allocator<void> > PointCloud2;
00223
00224 typedef boost::shared_ptr< ::sensor_msgs::PointCloud2> PointCloud2Ptr;
00225 typedef boost::shared_ptr< ::sensor_msgs::PointCloud2 const> PointCloud2ConstPtr;
00226
00227
00228 template<typename ContainerAllocator>
00229 std::ostream& operator<<(std::ostream& s, const ::sensor_msgs::PointCloud2_<ContainerAllocator> & v)
00230 {
00231 ros::message_operations::Printer< ::sensor_msgs::PointCloud2_<ContainerAllocator> >::stream(s, "", v);
00232 return s;}
00233
00234 }
00235
00236 namespace ros
00237 {
00238 namespace message_traits
00239 {
00240 template<class ContainerAllocator> struct IsMessage< ::sensor_msgs::PointCloud2_<ContainerAllocator> > : public TrueType {};
00241 template<class ContainerAllocator> struct IsMessage< ::sensor_msgs::PointCloud2_<ContainerAllocator> const> : public TrueType {};
00242 template<class ContainerAllocator>
00243 struct MD5Sum< ::sensor_msgs::PointCloud2_<ContainerAllocator> > {
00244 static const char* value()
00245 {
00246 return "1158d486dd51d683ce2f1be655c3c181";
00247 }
00248
00249 static const char* value(const ::sensor_msgs::PointCloud2_<ContainerAllocator> &) { return value(); }
00250 static const uint64_t static_value1 = 0x1158d486dd51d683ULL;
00251 static const uint64_t static_value2 = 0xce2f1be655c3c181ULL;
00252 };
00253
00254 template<class ContainerAllocator>
00255 struct DataType< ::sensor_msgs::PointCloud2_<ContainerAllocator> > {
00256 static const char* value()
00257 {
00258 return "sensor_msgs/PointCloud2";
00259 }
00260
00261 static const char* value(const ::sensor_msgs::PointCloud2_<ContainerAllocator> &) { return value(); }
00262 };
00263
00264 template<class ContainerAllocator>
00265 struct Definition< ::sensor_msgs::PointCloud2_<ContainerAllocator> > {
00266 static const char* value()
00267 {
00268 return "# This message holds a collection of N-dimensional points, which may\n\
00269 # contain additional information such as normals, intensity, etc. The\n\
00270 # point data is stored as a binary blob, its layout described by the\n\
00271 # contents of the \"fields\" array.\n\
00272 \n\
00273 # The point cloud data may be organized 2d (image-like) or 1d\n\
00274 # (unordered). Point clouds organized as 2d images may be produced by\n\
00275 # camera depth sensors such as stereo or time-of-flight.\n\
00276 \n\
00277 # Time of sensor data acquisition, and the coordinate frame ID (for 3d\n\
00278 # points).\n\
00279 Header header\n\
00280 \n\
00281 # 2D structure of the point cloud. If the cloud is unordered, height is\n\
00282 # 1 and width is the length of the point cloud.\n\
00283 uint32 height\n\
00284 uint32 width\n\
00285 \n\
00286 # Describes the channels and their layout in the binary data blob.\n\
00287 PointField[] fields\n\
00288 \n\
00289 bool is_bigendian # Is this data bigendian?\n\
00290 uint32 point_step # Length of a point in bytes\n\
00291 uint32 row_step # Length of a row in bytes\n\
00292 uint8[] data # Actual point data, size is (row_step*height)\n\
00293 \n\
00294 bool is_dense # True if there are no invalid points\n\
00295 \n\
00296 ================================================================================\n\
00297 MSG: std_msgs/Header\n\
00298 # Standard metadata for higher-level stamped data types.\n\
00299 # This is generally used to communicate timestamped data \n\
00300 # in a particular coordinate frame.\n\
00301 # \n\
00302 # sequence ID: consecutively increasing ID \n\
00303 uint32 seq\n\
00304 #Two-integer timestamp that is expressed as:\n\
00305 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00306 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00307 # time-handling sugar is provided by the client library\n\
00308 time stamp\n\
00309 #Frame this data is associated with\n\
00310 # 0: no frame\n\
00311 # 1: global frame\n\
00312 string frame_id\n\
00313 \n\
00314 ================================================================================\n\
00315 MSG: sensor_msgs/PointField\n\
00316 # This message holds the description of one point entry in the\n\
00317 # PointCloud2 message format.\n\
00318 uint8 INT8 = 1\n\
00319 uint8 UINT8 = 2\n\
00320 uint8 INT16 = 3\n\
00321 uint8 UINT16 = 4\n\
00322 uint8 INT32 = 5\n\
00323 uint8 UINT32 = 6\n\
00324 uint8 FLOAT32 = 7\n\
00325 uint8 FLOAT64 = 8\n\
00326 \n\
00327 string name # Name of field\n\
00328 uint32 offset # Offset from start of point struct\n\
00329 uint8 datatype # Datatype enumeration, see above\n\
00330 uint32 count # How many elements in the field\n\
00331 \n\
00332 ";
00333 }
00334
00335 static const char* value(const ::sensor_msgs::PointCloud2_<ContainerAllocator> &) { return value(); }
00336 };
00337
00338 template<class ContainerAllocator> struct HasHeader< ::sensor_msgs::PointCloud2_<ContainerAllocator> > : public TrueType {};
00339 template<class ContainerAllocator> struct HasHeader< const ::sensor_msgs::PointCloud2_<ContainerAllocator> > : public TrueType {};
00340 }
00341 }
00342
00343 namespace ros
00344 {
00345 namespace serialization
00346 {
00347
00348 template<class ContainerAllocator> struct Serializer< ::sensor_msgs::PointCloud2_<ContainerAllocator> >
00349 {
00350 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00351 {
00352 stream.next(m.header);
00353 stream.next(m.height);
00354 stream.next(m.width);
00355 stream.next(m.fields);
00356 stream.next(m.is_bigendian);
00357 stream.next(m.point_step);
00358 stream.next(m.row_step);
00359 stream.next(m.data);
00360 stream.next(m.is_dense);
00361 }
00362
00363 ROS_DECLARE_ALLINONE_SERIALIZER;
00364 };
00365 }
00366 }
00367
00368 namespace ros
00369 {
00370 namespace message_operations
00371 {
00372
00373 template<class ContainerAllocator>
00374 struct Printer< ::sensor_msgs::PointCloud2_<ContainerAllocator> >
00375 {
00376 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::sensor_msgs::PointCloud2_<ContainerAllocator> & v)
00377 {
00378 s << indent << "header: ";
00379 s << std::endl;
00380 Printer< ::std_msgs::Header_<ContainerAllocator> >::stream(s, indent + " ", v.header);
00381 s << indent << "height: ";
00382 Printer<uint32_t>::stream(s, indent + " ", v.height);
00383 s << indent << "width: ";
00384 Printer<uint32_t>::stream(s, indent + " ", v.width);
00385 s << indent << "fields[]" << std::endl;
00386 for (size_t i = 0; i < v.fields.size(); ++i)
00387 {
00388 s << indent << " fields[" << i << "]: ";
00389 s << std::endl;
00390 s << indent;
00391 Printer< ::sensor_msgs::PointField_<ContainerAllocator> >::stream(s, indent + " ", v.fields[i]);
00392 }
00393 s << indent << "is_bigendian: ";
00394 Printer<uint8_t>::stream(s, indent + " ", v.is_bigendian);
00395 s << indent << "point_step: ";
00396 Printer<uint32_t>::stream(s, indent + " ", v.point_step);
00397 s << indent << "row_step: ";
00398 Printer<uint32_t>::stream(s, indent + " ", v.row_step);
00399 s << indent << "data[]" << std::endl;
00400 for (size_t i = 0; i < v.data.size(); ++i)
00401 {
00402 s << indent << " data[" << i << "]: ";
00403 Printer<uint8_t>::stream(s, indent + " ", v.data[i]);
00404 }
00405 s << indent << "is_dense: ";
00406 Printer<uint8_t>::stream(s, indent + " ", v.is_dense);
00407 }
00408 };
00409
00410
00411 }
00412 }
00413
00414 #endif // SENSOR_MSGS_MESSAGE_POINTCLOUD2_H
00415