41#ifndef YARP_ROSMSG_stereo_msgs_DisparityImage_h
42#define YARP_ROSMSG_stereo_msgs_DisparityImage_h
102 max_disparity = 0.0f;
111 if (!header.
read(connection)) {
116 if (!image.read(connection)) {
127 if (!valid_window.read(connection)) {
152 if (!header.
read(connection)) {
157 if (!image.read(connection)) {
168 if (!valid_window.read(connection)) {
187 return (connection.
isBareMode() ? readBare(connection)
188 : readBottle(connection));
194 if (!header.
write(connection)) {
199 if (!image.write(connection)) {
210 if (!valid_window.write(connection)) {
232 if (!header.
write(connection)) {
237 if (!image.write(connection)) {
250 if (!valid_window.write(connection)) {
273 return (connection.
isBareMode() ? writeBare(connection)
274 : writeBottle(connection));
283 static constexpr const char* typeName =
"stereo_msgs/DisparityImage";
286 static constexpr const char* typeChecksum =
"04a177815f75271039fa21f16acad8c9";
289 static constexpr const char* typeText =
"\
290# Separate header for compatibility with current TimeSynchronizer.\n\
291# Likely to be removed in a later release, use image.header instead.\n\
294# Floating point disparity image. The disparities are pre-adjusted for any\n\
295# x-offset between the principal points of the two cameras (in the case\n\
296# that they are verged). That is: d = x_l - x_r - (cx_l - cx_r)\n\
297sensor_msgs/Image image\n\
299# Stereo geometry. For disparity d, the depth from the camera is Z = fT/d.\n\
300float32 f # Focal length, pixels\n\
301float32 T # Baseline, world units\n\
303# Subwindow of (potentially) valid disparity values.\n\
304sensor_msgs/RegionOfInterest valid_window\n\
306# The range of disparities searched.\n\
307# In the disparity image, any disparity less than min_disparity is invalid.\n\
308# The disparity search range defines the horopter, or 3D volume that the\n\
309# stereo algorithm can \"see\". Points with Z outside of:\n\
310# Z_min = fT / max_disparity\n\
311# Z_max = fT / min_disparity\n\
312# could not be found.\n\
313float32 min_disparity\n\
314float32 max_disparity\n\
316# Smallest allowed disparity increment. The smallest achievable depth range\n\
317# resolution is delta_Z = (Z^2/fT)*delta_d.\n\
320================================================================================\n\
321MSG: std_msgs/Header\n\
322# Standard metadata for higher-level stamped data types.\n\
323# This is generally used to communicate timestamped data \n\
324# in a particular coordinate frame.\n\
326# sequence ID: consecutively increasing ID \n\
328#Two-integer timestamp that is expressed as:\n\
329# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n\
330# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n\
331# time-handling sugar is provided by the client library\n\
333#Frame this data is associated with\n\
338================================================================================\n\
339MSG: sensor_msgs/Image\n\
340# This message contains an uncompressed image\n\
341# (0, 0) is at top-left corner of image\n\
344Header header # Header timestamp should be acquisition time of image\n\
345 # Header frame_id should be optical frame of camera\n\
346 # origin of frame should be optical center of cameara\n\
347 # +x should point to the right in the image\n\
348 # +y should point down in the image\n\
349 # +z should point into to plane of the image\n\
350 # If the frame_id here and the frame_id of the CameraInfo\n\
351 # message associated with the image conflict\n\
352 # the behavior is undefined\n\
354uint32 height # image height, that is, number of rows\n\
355uint32 width # image width, that is, number of columns\n\
357# The legal values for encoding are in file src/image_encodings.cpp\n\
358# If you want to standardize a new string format, join\n\
359# ros-users@lists.sourceforge.net and send an email proposing a new encoding.\n\
361string encoding # Encoding of pixels -- channel meaning, ordering, size\n\
362 # taken from the list of strings in include/sensor_msgs/image_encodings.h\n\
364uint8 is_bigendian # is this data bigendian?\n\
365uint32 step # Full row length in bytes\n\
366uint8[] data # actual matrix data, size is (step * rows)\n\
368================================================================================\n\
369MSG: sensor_msgs/RegionOfInterest\n\
370# This message is used to specify a region of interest within an image.\n\
372# When used to specify the ROI setting of the camera when the image was\n\
373# taken, the height and width fields should either match the height and\n\
374# width fields for the associated image; or height = width = 0\n\
375# indicates that the full resolution image was captured.\n\
377uint32 x_offset # Leftmost pixel of the ROI\n\
378 # (0 if the ROI includes the left edge of the image)\n\
379uint32 y_offset # Topmost pixel of the ROI\n\
380 # (0 if the ROI includes the top edge of the image)\n\
381uint32 height # Height of ROI\n\
382uint32 width # Width of ROI\n\
384# True if a distinct rectified ROI should be calculated from the \"raw\"\n\
385# ROI in this message. Typically this should be False if the full image\n\
386# is captured (ROI not used), and True if a subwindow is captured (ROI\n\
#define BOTTLE_TAG_FLOAT32
An interface for reading from a network connection.
virtual bool isBareMode() const =0
Check if the connection is bare mode.
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
virtual yarp::conf::float32_t expectFloat32()=0
Read a 32-bit floating point number from the network connection.
virtual bool isError() const =0
An interface for writing to a network connection.
virtual bool isError() const =0
virtual bool isBareMode() const =0
Check if the connection is bare mode.
virtual void appendFloat32(yarp::conf::float32_t data)=0
Send a representation of a 32-bit floating point number to the network connection.
virtual bool convertTextMode()=0
Converts a standard description in binary into a textual description, if the connection is in text-mo...
virtual void appendInt32(std::int32_t data)=0
Send a representation of a 32-bit integer to the network connection.
static Type byName(const char *name)
Type & addProperty(const char *key, const Value &val)
A single value (typically within a Bottle).
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
virtual bool read(yarp::os::idl::WireReader &reader)
virtual bool write(const yarp::os::idl::WireWriter &writer) const
IDL-friendly connection reader.
yarp::conf::float32_t expectFloat32()
yarp::rosmsg::sensor_msgs::RegionOfInterest RegionOfInterest
yarp::rosmsg::sensor_msgs::Image Image
yarp::rosmsg::stereo_msgs::DisparityImage DisparityImage
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
The main, catch-all namespace for YARP.