KeyPoint.h
Go to the documentation of this file.
00001 #ifndef _ROS_rtabmap_KeyPoint_h
00002 #define _ROS_rtabmap_KeyPoint_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 
00009 namespace rtabmap
00010 {
00011 
00012   class KeyPoint : public ros::Msg
00013   {
00014     public:
00015       float ptx;
00016       float pty;
00017       float size;
00018       float angle;
00019       float response;
00020       int32_t octave;
00021       int32_t class_id;
00022 
00023     virtual int serialize(unsigned char *outbuffer) const
00024     {
00025       int offset = 0;
00026       union {
00027         float real;
00028         uint32_t base;
00029       } u_ptx;
00030       u_ptx.real = this->ptx;
00031       *(outbuffer + offset + 0) = (u_ptx.base >> (8 * 0)) & 0xFF;
00032       *(outbuffer + offset + 1) = (u_ptx.base >> (8 * 1)) & 0xFF;
00033       *(outbuffer + offset + 2) = (u_ptx.base >> (8 * 2)) & 0xFF;
00034       *(outbuffer + offset + 3) = (u_ptx.base >> (8 * 3)) & 0xFF;
00035       offset += sizeof(this->ptx);
00036       union {
00037         float real;
00038         uint32_t base;
00039       } u_pty;
00040       u_pty.real = this->pty;
00041       *(outbuffer + offset + 0) = (u_pty.base >> (8 * 0)) & 0xFF;
00042       *(outbuffer + offset + 1) = (u_pty.base >> (8 * 1)) & 0xFF;
00043       *(outbuffer + offset + 2) = (u_pty.base >> (8 * 2)) & 0xFF;
00044       *(outbuffer + offset + 3) = (u_pty.base >> (8 * 3)) & 0xFF;
00045       offset += sizeof(this->pty);
00046       union {
00047         float real;
00048         uint32_t base;
00049       } u_size;
00050       u_size.real = this->size;
00051       *(outbuffer + offset + 0) = (u_size.base >> (8 * 0)) & 0xFF;
00052       *(outbuffer + offset + 1) = (u_size.base >> (8 * 1)) & 0xFF;
00053       *(outbuffer + offset + 2) = (u_size.base >> (8 * 2)) & 0xFF;
00054       *(outbuffer + offset + 3) = (u_size.base >> (8 * 3)) & 0xFF;
00055       offset += sizeof(this->size);
00056       union {
00057         float real;
00058         uint32_t base;
00059       } u_angle;
00060       u_angle.real = this->angle;
00061       *(outbuffer + offset + 0) = (u_angle.base >> (8 * 0)) & 0xFF;
00062       *(outbuffer + offset + 1) = (u_angle.base >> (8 * 1)) & 0xFF;
00063       *(outbuffer + offset + 2) = (u_angle.base >> (8 * 2)) & 0xFF;
00064       *(outbuffer + offset + 3) = (u_angle.base >> (8 * 3)) & 0xFF;
00065       offset += sizeof(this->angle);
00066       union {
00067         float real;
00068         uint32_t base;
00069       } u_response;
00070       u_response.real = this->response;
00071       *(outbuffer + offset + 0) = (u_response.base >> (8 * 0)) & 0xFF;
00072       *(outbuffer + offset + 1) = (u_response.base >> (8 * 1)) & 0xFF;
00073       *(outbuffer + offset + 2) = (u_response.base >> (8 * 2)) & 0xFF;
00074       *(outbuffer + offset + 3) = (u_response.base >> (8 * 3)) & 0xFF;
00075       offset += sizeof(this->response);
00076       union {
00077         int32_t real;
00078         uint32_t base;
00079       } u_octave;
00080       u_octave.real = this->octave;
00081       *(outbuffer + offset + 0) = (u_octave.base >> (8 * 0)) & 0xFF;
00082       *(outbuffer + offset + 1) = (u_octave.base >> (8 * 1)) & 0xFF;
00083       *(outbuffer + offset + 2) = (u_octave.base >> (8 * 2)) & 0xFF;
00084       *(outbuffer + offset + 3) = (u_octave.base >> (8 * 3)) & 0xFF;
00085       offset += sizeof(this->octave);
00086       union {
00087         int32_t real;
00088         uint32_t base;
00089       } u_class_id;
00090       u_class_id.real = this->class_id;
00091       *(outbuffer + offset + 0) = (u_class_id.base >> (8 * 0)) & 0xFF;
00092       *(outbuffer + offset + 1) = (u_class_id.base >> (8 * 1)) & 0xFF;
00093       *(outbuffer + offset + 2) = (u_class_id.base >> (8 * 2)) & 0xFF;
00094       *(outbuffer + offset + 3) = (u_class_id.base >> (8 * 3)) & 0xFF;
00095       offset += sizeof(this->class_id);
00096       return offset;
00097     }
00098 
00099     virtual int deserialize(unsigned char *inbuffer)
00100     {
00101       int offset = 0;
00102       union {
00103         float real;
00104         uint32_t base;
00105       } u_ptx;
00106       u_ptx.base = 0;
00107       u_ptx.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00108       u_ptx.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00109       u_ptx.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00110       u_ptx.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00111       this->ptx = u_ptx.real;
00112       offset += sizeof(this->ptx);
00113       union {
00114         float real;
00115         uint32_t base;
00116       } u_pty;
00117       u_pty.base = 0;
00118       u_pty.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00119       u_pty.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00120       u_pty.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00121       u_pty.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00122       this->pty = u_pty.real;
00123       offset += sizeof(this->pty);
00124       union {
00125         float real;
00126         uint32_t base;
00127       } u_size;
00128       u_size.base = 0;
00129       u_size.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00130       u_size.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00131       u_size.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00132       u_size.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00133       this->size = u_size.real;
00134       offset += sizeof(this->size);
00135       union {
00136         float real;
00137         uint32_t base;
00138       } u_angle;
00139       u_angle.base = 0;
00140       u_angle.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00141       u_angle.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00142       u_angle.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00143       u_angle.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00144       this->angle = u_angle.real;
00145       offset += sizeof(this->angle);
00146       union {
00147         float real;
00148         uint32_t base;
00149       } u_response;
00150       u_response.base = 0;
00151       u_response.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00152       u_response.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00153       u_response.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00154       u_response.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00155       this->response = u_response.real;
00156       offset += sizeof(this->response);
00157       union {
00158         int32_t real;
00159         uint32_t base;
00160       } u_octave;
00161       u_octave.base = 0;
00162       u_octave.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00163       u_octave.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00164       u_octave.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00165       u_octave.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00166       this->octave = u_octave.real;
00167       offset += sizeof(this->octave);
00168       union {
00169         int32_t real;
00170         uint32_t base;
00171       } u_class_id;
00172       u_class_id.base = 0;
00173       u_class_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00174       u_class_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00175       u_class_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00176       u_class_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00177       this->class_id = u_class_id.real;
00178       offset += sizeof(this->class_id);
00179      return offset;
00180     }
00181 
00182     const char * getType(){ return "rtabmap/KeyPoint"; };
00183     const char * getMD5(){ return "0ff91e51ebaf0c97a102580aaab50951"; };
00184 
00185   };
00186 
00187 }
00188 #endif


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