DisparityImage.h
Go to the documentation of this file.
00001 #ifndef _ROS_stereo_msgs_DisparityImage_h
00002 #define _ROS_stereo_msgs_DisparityImage_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "std_msgs/Header.h"
00009 #include "sensor_msgs/Image.h"
00010 #include "sensor_msgs/RegionOfInterest.h"
00011 
00012 namespace stereo_msgs
00013 {
00014 
00015   class DisparityImage : public ros::Msg
00016   {
00017     public:
00018       std_msgs::Header header;
00019       sensor_msgs::Image image;
00020       float f;
00021       float T;
00022       sensor_msgs::RegionOfInterest valid_window;
00023       float min_disparity;
00024       float max_disparity;
00025       float delta_d;
00026 
00027     virtual int serialize(unsigned char *outbuffer) const
00028     {
00029       int offset = 0;
00030       offset += this->header.serialize(outbuffer + offset);
00031       offset += this->image.serialize(outbuffer + offset);
00032       union {
00033         float real;
00034         uint32_t base;
00035       } u_f;
00036       u_f.real = this->f;
00037       *(outbuffer + offset + 0) = (u_f.base >> (8 * 0)) & 0xFF;
00038       *(outbuffer + offset + 1) = (u_f.base >> (8 * 1)) & 0xFF;
00039       *(outbuffer + offset + 2) = (u_f.base >> (8 * 2)) & 0xFF;
00040       *(outbuffer + offset + 3) = (u_f.base >> (8 * 3)) & 0xFF;
00041       offset += sizeof(this->f);
00042       union {
00043         float real;
00044         uint32_t base;
00045       } u_T;
00046       u_T.real = this->T;
00047       *(outbuffer + offset + 0) = (u_T.base >> (8 * 0)) & 0xFF;
00048       *(outbuffer + offset + 1) = (u_T.base >> (8 * 1)) & 0xFF;
00049       *(outbuffer + offset + 2) = (u_T.base >> (8 * 2)) & 0xFF;
00050       *(outbuffer + offset + 3) = (u_T.base >> (8 * 3)) & 0xFF;
00051       offset += sizeof(this->T);
00052       offset += this->valid_window.serialize(outbuffer + offset);
00053       union {
00054         float real;
00055         uint32_t base;
00056       } u_min_disparity;
00057       u_min_disparity.real = this->min_disparity;
00058       *(outbuffer + offset + 0) = (u_min_disparity.base >> (8 * 0)) & 0xFF;
00059       *(outbuffer + offset + 1) = (u_min_disparity.base >> (8 * 1)) & 0xFF;
00060       *(outbuffer + offset + 2) = (u_min_disparity.base >> (8 * 2)) & 0xFF;
00061       *(outbuffer + offset + 3) = (u_min_disparity.base >> (8 * 3)) & 0xFF;
00062       offset += sizeof(this->min_disparity);
00063       union {
00064         float real;
00065         uint32_t base;
00066       } u_max_disparity;
00067       u_max_disparity.real = this->max_disparity;
00068       *(outbuffer + offset + 0) = (u_max_disparity.base >> (8 * 0)) & 0xFF;
00069       *(outbuffer + offset + 1) = (u_max_disparity.base >> (8 * 1)) & 0xFF;
00070       *(outbuffer + offset + 2) = (u_max_disparity.base >> (8 * 2)) & 0xFF;
00071       *(outbuffer + offset + 3) = (u_max_disparity.base >> (8 * 3)) & 0xFF;
00072       offset += sizeof(this->max_disparity);
00073       union {
00074         float real;
00075         uint32_t base;
00076       } u_delta_d;
00077       u_delta_d.real = this->delta_d;
00078       *(outbuffer + offset + 0) = (u_delta_d.base >> (8 * 0)) & 0xFF;
00079       *(outbuffer + offset + 1) = (u_delta_d.base >> (8 * 1)) & 0xFF;
00080       *(outbuffer + offset + 2) = (u_delta_d.base >> (8 * 2)) & 0xFF;
00081       *(outbuffer + offset + 3) = (u_delta_d.base >> (8 * 3)) & 0xFF;
00082       offset += sizeof(this->delta_d);
00083       return offset;
00084     }
00085 
00086     virtual int deserialize(unsigned char *inbuffer)
00087     {
00088       int offset = 0;
00089       offset += this->header.deserialize(inbuffer + offset);
00090       offset += this->image.deserialize(inbuffer + offset);
00091       union {
00092         float real;
00093         uint32_t base;
00094       } u_f;
00095       u_f.base = 0;
00096       u_f.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00097       u_f.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00098       u_f.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00099       u_f.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00100       this->f = u_f.real;
00101       offset += sizeof(this->f);
00102       union {
00103         float real;
00104         uint32_t base;
00105       } u_T;
00106       u_T.base = 0;
00107       u_T.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00108       u_T.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00109       u_T.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00110       u_T.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00111       this->T = u_T.real;
00112       offset += sizeof(this->T);
00113       offset += this->valid_window.deserialize(inbuffer + offset);
00114       union {
00115         float real;
00116         uint32_t base;
00117       } u_min_disparity;
00118       u_min_disparity.base = 0;
00119       u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00120       u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00121       u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00122       u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00123       this->min_disparity = u_min_disparity.real;
00124       offset += sizeof(this->min_disparity);
00125       union {
00126         float real;
00127         uint32_t base;
00128       } u_max_disparity;
00129       u_max_disparity.base = 0;
00130       u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00131       u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00132       u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00133       u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00134       this->max_disparity = u_max_disparity.real;
00135       offset += sizeof(this->max_disparity);
00136       union {
00137         float real;
00138         uint32_t base;
00139       } u_delta_d;
00140       u_delta_d.base = 0;
00141       u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00142       u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00143       u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00144       u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00145       this->delta_d = u_delta_d.real;
00146       offset += sizeof(this->delta_d);
00147      return offset;
00148     }
00149 
00150     const char * getType(){ return "stereo_msgs/DisparityImage"; };
00151     const char * getMD5(){ return "04a177815f75271039fa21f16acad8c9"; };
00152 
00153   };
00154 
00155 }
00156 #endif


ric_mc
Author(s): RoboTiCan
autogenerated on Fri May 20 2016 03:48:55