00001
00002 #ifndef STEREO_MSGS_MESSAGE_DISPARITYIMAGE_H
00003 #define STEREO_MSGS_MESSAGE_DISPARITYIMAGE_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/Image.h"
00015 #include "sensor_msgs/RegionOfInterest.h"
00016
00017 namespace stereo_msgs
00018 {
00019 template <class ContainerAllocator>
00020 struct DisparityImage_ : public ros::Message
00021 {
00022 typedef DisparityImage_<ContainerAllocator> Type;
00023
00024 DisparityImage_()
00025 : header()
00026 , image()
00027 , f(0.0)
00028 , T(0.0)
00029 , valid_window()
00030 , min_disparity(0.0)
00031 , max_disparity(0.0)
00032 , delta_d(0.0)
00033 {
00034 }
00035
00036 DisparityImage_(const ContainerAllocator& _alloc)
00037 : header(_alloc)
00038 , image(_alloc)
00039 , f(0.0)
00040 , T(0.0)
00041 , valid_window(_alloc)
00042 , min_disparity(0.0)
00043 , max_disparity(0.0)
00044 , delta_d(0.0)
00045 {
00046 }
00047
00048 typedef ::std_msgs::Header_<ContainerAllocator> _header_type;
00049 ::std_msgs::Header_<ContainerAllocator> header;
00050
00051 typedef ::sensor_msgs::Image_<ContainerAllocator> _image_type;
00052 ::sensor_msgs::Image_<ContainerAllocator> image;
00053
00054 typedef float _f_type;
00055 float f;
00056
00057 typedef float _T_type;
00058 float T;
00059
00060 typedef ::sensor_msgs::RegionOfInterest_<ContainerAllocator> _valid_window_type;
00061 ::sensor_msgs::RegionOfInterest_<ContainerAllocator> valid_window;
00062
00063 typedef float _min_disparity_type;
00064 float min_disparity;
00065
00066 typedef float _max_disparity_type;
00067 float max_disparity;
00068
00069 typedef float _delta_d_type;
00070 float delta_d;
00071
00072
00073 private:
00074 static const char* __s_getDataType_() { return "stereo_msgs/DisparityImage"; }
00075 public:
00076 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00077
00078 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00079
00080 private:
00081 static const char* __s_getMD5Sum_() { return "04a177815f75271039fa21f16acad8c9"; }
00082 public:
00083 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00084
00085 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00086
00087 private:
00088 static const char* __s_getMessageDefinition_() { return "# Separate header for compatibility with current TimeSynchronizer.\n\
00089 # Likely to be removed in a later release, use image.header instead.\n\
00090 Header header\n\
00091 \n\
00092 # Floating point disparity image. The disparities are pre-adjusted for any\n\
00093 # x-offset between the principal points of the two cameras (in the case\n\
00094 # that they are verged). That is: d = x_l - x_r - (cx_l - cx_r)\n\
00095 sensor_msgs/Image image\n\
00096 \n\
00097 # Stereo geometry. For disparity d, the depth from the camera is Z = fT/d.\n\
00098 float32 f # Focal length, pixels\n\
00099 float32 T # Baseline, world units\n\
00100 \n\
00101 # Subwindow of (potentially) valid disparity values.\n\
00102 sensor_msgs/RegionOfInterest valid_window\n\
00103 \n\
00104 # The range of disparities searched.\n\
00105 # In the disparity image, any disparity less than min_disparity is invalid.\n\
00106 # The disparity search range defines the horopter, or 3D volume that the\n\
00107 # stereo algorithm can \"see\". Points with Z outside of:\n\
00108 # Z_min = fT / max_disparity\n\
00109 # Z_max = fT / min_disparity\n\
00110 # could not be found.\n\
00111 float32 min_disparity\n\
00112 float32 max_disparity\n\
00113 \n\
00114 # Smallest allowed disparity increment. The smallest achievable depth range\n\
00115 # resolution is delta_Z = (Z^2/fT)*delta_d.\n\
00116 float32 delta_d\n\
00117 \n\
00118 ================================================================================\n\
00119 MSG: std_msgs/Header\n\
00120 # Standard metadata for higher-level stamped data types.\n\
00121 # This is generally used to communicate timestamped data \n\
00122 # in a particular coordinate frame.\n\
00123 # \n\
00124 # sequence ID: consecutively increasing ID \n\
00125 uint32 seq\n\
00126 #Two-integer timestamp that is expressed as:\n\
00127 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00128 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00129 # time-handling sugar is provided by the client library\n\
00130 time stamp\n\
00131 #Frame this data is associated with\n\
00132 # 0: no frame\n\
00133 # 1: global frame\n\
00134 string frame_id\n\
00135 \n\
00136 ================================================================================\n\
00137 MSG: sensor_msgs/Image\n\
00138 # This message contains an uncompressed image\n\
00139 # (0, 0) is at top-left corner of image\n\
00140 #\n\
00141 \n\
00142 Header header # Header timestamp should be acquisition time of image\n\
00143 # Header frame_id should be optical frame of camera\n\
00144 # origin of frame should be optical center of cameara\n\
00145 # +x should point to the right in the image\n\
00146 # +y should point down in the image\n\
00147 # +z should point into to plane of the image\n\
00148 # If the frame_id here and the frame_id of the CameraInfo\n\
00149 # message associated with the image conflict\n\
00150 # the behavior is undefined\n\
00151 \n\
00152 uint32 height # image height, that is, number of rows\n\
00153 uint32 width # image width, that is, number of columns\n\
00154 \n\
00155 # The legal values for encoding are in file src/image_encodings.cpp\n\
00156 # If you want to standardize a new string format, join\n\
00157 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.\n\
00158 \n\
00159 string encoding # Encoding of pixels -- channel meaning, ordering, size\n\
00160 # taken from the list of strings in src/image_encodings.cpp\n\
00161 \n\
00162 uint8 is_bigendian # is this data bigendian?\n\
00163 uint32 step # Full row length in bytes\n\
00164 uint8[] data # actual matrix data, size is (step * rows)\n\
00165 \n\
00166 ================================================================================\n\
00167 MSG: sensor_msgs/RegionOfInterest\n\
00168 # This message is used to specify a region of interest within an image.\n\
00169 #\n\
00170 # When used to specify the ROI setting of the camera when the image was\n\
00171 # taken, the height and width fields should either match the height and\n\
00172 # width fields for the associated image; or height = width = 0\n\
00173 # indicates that the full resolution image was captured.\n\
00174 \n\
00175 uint32 x_offset # Leftmost pixel of the ROI\n\
00176 # (0 if the ROI includes the left edge of the image)\n\
00177 uint32 y_offset # Topmost pixel of the ROI\n\
00178 # (0 if the ROI includes the top edge of the image)\n\
00179 uint32 height # Height of ROI\n\
00180 uint32 width # Width of ROI\n\
00181 \n\
00182 # True if a distinct rectified ROI should be calculated from the \"raw\"\n\
00183 # ROI in this message. Typically this should be False if the full image\n\
00184 # is captured (ROI not used), and True if a subwindow is captured (ROI\n\
00185 # used).\n\
00186 bool do_rectify\n\
00187 \n\
00188 "; }
00189 public:
00190 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00191
00192 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00193
00194 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00195 {
00196 ros::serialization::OStream stream(write_ptr, 1000000000);
00197 ros::serialization::serialize(stream, header);
00198 ros::serialization::serialize(stream, image);
00199 ros::serialization::serialize(stream, f);
00200 ros::serialization::serialize(stream, T);
00201 ros::serialization::serialize(stream, valid_window);
00202 ros::serialization::serialize(stream, min_disparity);
00203 ros::serialization::serialize(stream, max_disparity);
00204 ros::serialization::serialize(stream, delta_d);
00205 return stream.getData();
00206 }
00207
00208 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00209 {
00210 ros::serialization::IStream stream(read_ptr, 1000000000);
00211 ros::serialization::deserialize(stream, header);
00212 ros::serialization::deserialize(stream, image);
00213 ros::serialization::deserialize(stream, f);
00214 ros::serialization::deserialize(stream, T);
00215 ros::serialization::deserialize(stream, valid_window);
00216 ros::serialization::deserialize(stream, min_disparity);
00217 ros::serialization::deserialize(stream, max_disparity);
00218 ros::serialization::deserialize(stream, delta_d);
00219 return stream.getData();
00220 }
00221
00222 ROS_DEPRECATED virtual uint32_t serializationLength() const
00223 {
00224 uint32_t size = 0;
00225 size += ros::serialization::serializationLength(header);
00226 size += ros::serialization::serializationLength(image);
00227 size += ros::serialization::serializationLength(f);
00228 size += ros::serialization::serializationLength(T);
00229 size += ros::serialization::serializationLength(valid_window);
00230 size += ros::serialization::serializationLength(min_disparity);
00231 size += ros::serialization::serializationLength(max_disparity);
00232 size += ros::serialization::serializationLength(delta_d);
00233 return size;
00234 }
00235
00236 typedef boost::shared_ptr< ::stereo_msgs::DisparityImage_<ContainerAllocator> > Ptr;
00237 typedef boost::shared_ptr< ::stereo_msgs::DisparityImage_<ContainerAllocator> const> ConstPtr;
00238 };
00239 typedef ::stereo_msgs::DisparityImage_<std::allocator<void> > DisparityImage;
00240
00241 typedef boost::shared_ptr< ::stereo_msgs::DisparityImage> DisparityImagePtr;
00242 typedef boost::shared_ptr< ::stereo_msgs::DisparityImage const> DisparityImageConstPtr;
00243
00244
00245 template<typename ContainerAllocator>
00246 std::ostream& operator<<(std::ostream& s, const ::stereo_msgs::DisparityImage_<ContainerAllocator> & v)
00247 {
00248 ros::message_operations::Printer< ::stereo_msgs::DisparityImage_<ContainerAllocator> >::stream(s, "", v);
00249 return s;}
00250
00251 }
00252
00253 namespace ros
00254 {
00255 namespace message_traits
00256 {
00257 template<class ContainerAllocator>
00258 struct MD5Sum< ::stereo_msgs::DisparityImage_<ContainerAllocator> > {
00259 static const char* value()
00260 {
00261 return "04a177815f75271039fa21f16acad8c9";
00262 }
00263
00264 static const char* value(const ::stereo_msgs::DisparityImage_<ContainerAllocator> &) { return value(); }
00265 static const uint64_t static_value1 = 0x04a177815f752710ULL;
00266 static const uint64_t static_value2 = 0x39fa21f16acad8c9ULL;
00267 };
00268
00269 template<class ContainerAllocator>
00270 struct DataType< ::stereo_msgs::DisparityImage_<ContainerAllocator> > {
00271 static const char* value()
00272 {
00273 return "stereo_msgs/DisparityImage";
00274 }
00275
00276 static const char* value(const ::stereo_msgs::DisparityImage_<ContainerAllocator> &) { return value(); }
00277 };
00278
00279 template<class ContainerAllocator>
00280 struct Definition< ::stereo_msgs::DisparityImage_<ContainerAllocator> > {
00281 static const char* value()
00282 {
00283 return "# Separate header for compatibility with current TimeSynchronizer.\n\
00284 # Likely to be removed in a later release, use image.header instead.\n\
00285 Header header\n\
00286 \n\
00287 # Floating point disparity image. The disparities are pre-adjusted for any\n\
00288 # x-offset between the principal points of the two cameras (in the case\n\
00289 # that they are verged). That is: d = x_l - x_r - (cx_l - cx_r)\n\
00290 sensor_msgs/Image image\n\
00291 \n\
00292 # Stereo geometry. For disparity d, the depth from the camera is Z = fT/d.\n\
00293 float32 f # Focal length, pixels\n\
00294 float32 T # Baseline, world units\n\
00295 \n\
00296 # Subwindow of (potentially) valid disparity values.\n\
00297 sensor_msgs/RegionOfInterest valid_window\n\
00298 \n\
00299 # The range of disparities searched.\n\
00300 # In the disparity image, any disparity less than min_disparity is invalid.\n\
00301 # The disparity search range defines the horopter, or 3D volume that the\n\
00302 # stereo algorithm can \"see\". Points with Z outside of:\n\
00303 # Z_min = fT / max_disparity\n\
00304 # Z_max = fT / min_disparity\n\
00305 # could not be found.\n\
00306 float32 min_disparity\n\
00307 float32 max_disparity\n\
00308 \n\
00309 # Smallest allowed disparity increment. The smallest achievable depth range\n\
00310 # resolution is delta_Z = (Z^2/fT)*delta_d.\n\
00311 float32 delta_d\n\
00312 \n\
00313 ================================================================================\n\
00314 MSG: std_msgs/Header\n\
00315 # Standard metadata for higher-level stamped data types.\n\
00316 # This is generally used to communicate timestamped data \n\
00317 # in a particular coordinate frame.\n\
00318 # \n\
00319 # sequence ID: consecutively increasing ID \n\
00320 uint32 seq\n\
00321 #Two-integer timestamp that is expressed as:\n\
00322 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00323 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00324 # time-handling sugar is provided by the client library\n\
00325 time stamp\n\
00326 #Frame this data is associated with\n\
00327 # 0: no frame\n\
00328 # 1: global frame\n\
00329 string frame_id\n\
00330 \n\
00331 ================================================================================\n\
00332 MSG: sensor_msgs/Image\n\
00333 # This message contains an uncompressed image\n\
00334 # (0, 0) is at top-left corner of image\n\
00335 #\n\
00336 \n\
00337 Header header # Header timestamp should be acquisition time of image\n\
00338 # Header frame_id should be optical frame of camera\n\
00339 # origin of frame should be optical center of cameara\n\
00340 # +x should point to the right in the image\n\
00341 # +y should point down in the image\n\
00342 # +z should point into to plane of the image\n\
00343 # If the frame_id here and the frame_id of the CameraInfo\n\
00344 # message associated with the image conflict\n\
00345 # the behavior is undefined\n\
00346 \n\
00347 uint32 height # image height, that is, number of rows\n\
00348 uint32 width # image width, that is, number of columns\n\
00349 \n\
00350 # The legal values for encoding are in file src/image_encodings.cpp\n\
00351 # If you want to standardize a new string format, join\n\
00352 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.\n\
00353 \n\
00354 string encoding # Encoding of pixels -- channel meaning, ordering, size\n\
00355 # taken from the list of strings in src/image_encodings.cpp\n\
00356 \n\
00357 uint8 is_bigendian # is this data bigendian?\n\
00358 uint32 step # Full row length in bytes\n\
00359 uint8[] data # actual matrix data, size is (step * rows)\n\
00360 \n\
00361 ================================================================================\n\
00362 MSG: sensor_msgs/RegionOfInterest\n\
00363 # This message is used to specify a region of interest within an image.\n\
00364 #\n\
00365 # When used to specify the ROI setting of the camera when the image was\n\
00366 # taken, the height and width fields should either match the height and\n\
00367 # width fields for the associated image; or height = width = 0\n\
00368 # indicates that the full resolution image was captured.\n\
00369 \n\
00370 uint32 x_offset # Leftmost pixel of the ROI\n\
00371 # (0 if the ROI includes the left edge of the image)\n\
00372 uint32 y_offset # Topmost pixel of the ROI\n\
00373 # (0 if the ROI includes the top edge of the image)\n\
00374 uint32 height # Height of ROI\n\
00375 uint32 width # Width of ROI\n\
00376 \n\
00377 # True if a distinct rectified ROI should be calculated from the \"raw\"\n\
00378 # ROI in this message. Typically this should be False if the full image\n\
00379 # is captured (ROI not used), and True if a subwindow is captured (ROI\n\
00380 # used).\n\
00381 bool do_rectify\n\
00382 \n\
00383 ";
00384 }
00385
00386 static const char* value(const ::stereo_msgs::DisparityImage_<ContainerAllocator> &) { return value(); }
00387 };
00388
00389 template<class ContainerAllocator> struct HasHeader< ::stereo_msgs::DisparityImage_<ContainerAllocator> > : public TrueType {};
00390 template<class ContainerAllocator> struct HasHeader< const ::stereo_msgs::DisparityImage_<ContainerAllocator> > : public TrueType {};
00391 }
00392 }
00393
00394 namespace ros
00395 {
00396 namespace serialization
00397 {
00398
00399 template<class ContainerAllocator> struct Serializer< ::stereo_msgs::DisparityImage_<ContainerAllocator> >
00400 {
00401 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00402 {
00403 stream.next(m.header);
00404 stream.next(m.image);
00405 stream.next(m.f);
00406 stream.next(m.T);
00407 stream.next(m.valid_window);
00408 stream.next(m.min_disparity);
00409 stream.next(m.max_disparity);
00410 stream.next(m.delta_d);
00411 }
00412
00413 ROS_DECLARE_ALLINONE_SERIALIZER;
00414 };
00415 }
00416 }
00417
00418 namespace ros
00419 {
00420 namespace message_operations
00421 {
00422
00423 template<class ContainerAllocator>
00424 struct Printer< ::stereo_msgs::DisparityImage_<ContainerAllocator> >
00425 {
00426 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::stereo_msgs::DisparityImage_<ContainerAllocator> & v)
00427 {
00428 s << indent << "header: ";
00429 s << std::endl;
00430 Printer< ::std_msgs::Header_<ContainerAllocator> >::stream(s, indent + " ", v.header);
00431 s << indent << "image: ";
00432 s << std::endl;
00433 Printer< ::sensor_msgs::Image_<ContainerAllocator> >::stream(s, indent + " ", v.image);
00434 s << indent << "f: ";
00435 Printer<float>::stream(s, indent + " ", v.f);
00436 s << indent << "T: ";
00437 Printer<float>::stream(s, indent + " ", v.T);
00438 s << indent << "valid_window: ";
00439 s << std::endl;
00440 Printer< ::sensor_msgs::RegionOfInterest_<ContainerAllocator> >::stream(s, indent + " ", v.valid_window);
00441 s << indent << "min_disparity: ";
00442 Printer<float>::stream(s, indent + " ", v.min_disparity);
00443 s << indent << "max_disparity: ";
00444 Printer<float>::stream(s, indent + " ", v.max_disparity);
00445 s << indent << "delta_d: ";
00446 Printer<float>::stream(s, indent + " ", v.delta_d);
00447 }
00448 };
00449
00450
00451 }
00452 }
00453
00454 #endif // STEREO_MSGS_MESSAGE_DISPARITYIMAGE_H
00455