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