ObjectRecognitionGoal.h
Go to the documentation of this file.
00001 #ifndef _ROS_object_recognition_msgs_ObjectRecognitionGoal_h
00002 #define _ROS_object_recognition_msgs_ObjectRecognitionGoal_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 
00009 namespace object_recognition_msgs
00010 {
00011 
00012   class ObjectRecognitionGoal : public ros::Msg
00013   {
00014     public:
00015       bool use_roi;
00016       uint8_t filter_limits_length;
00017       float st_filter_limits;
00018       float * filter_limits;
00019 
00020     virtual int serialize(unsigned char *outbuffer) const
00021     {
00022       int offset = 0;
00023       union {
00024         bool real;
00025         uint8_t base;
00026       } u_use_roi;
00027       u_use_roi.real = this->use_roi;
00028       *(outbuffer + offset + 0) = (u_use_roi.base >> (8 * 0)) & 0xFF;
00029       offset += sizeof(this->use_roi);
00030       *(outbuffer + offset++) = filter_limits_length;
00031       *(outbuffer + offset++) = 0;
00032       *(outbuffer + offset++) = 0;
00033       *(outbuffer + offset++) = 0;
00034       for( uint8_t i = 0; i < filter_limits_length; i++){
00035       union {
00036         float real;
00037         uint32_t base;
00038       } u_filter_limitsi;
00039       u_filter_limitsi.real = this->filter_limits[i];
00040       *(outbuffer + offset + 0) = (u_filter_limitsi.base >> (8 * 0)) & 0xFF;
00041       *(outbuffer + offset + 1) = (u_filter_limitsi.base >> (8 * 1)) & 0xFF;
00042       *(outbuffer + offset + 2) = (u_filter_limitsi.base >> (8 * 2)) & 0xFF;
00043       *(outbuffer + offset + 3) = (u_filter_limitsi.base >> (8 * 3)) & 0xFF;
00044       offset += sizeof(this->filter_limits[i]);
00045       }
00046       return offset;
00047     }
00048 
00049     virtual int deserialize(unsigned char *inbuffer)
00050     {
00051       int offset = 0;
00052       union {
00053         bool real;
00054         uint8_t base;
00055       } u_use_roi;
00056       u_use_roi.base = 0;
00057       u_use_roi.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00058       this->use_roi = u_use_roi.real;
00059       offset += sizeof(this->use_roi);
00060       uint8_t filter_limits_lengthT = *(inbuffer + offset++);
00061       if(filter_limits_lengthT > filter_limits_length)
00062         this->filter_limits = (float*)realloc(this->filter_limits, filter_limits_lengthT * sizeof(float));
00063       offset += 3;
00064       filter_limits_length = filter_limits_lengthT;
00065       for( uint8_t i = 0; i < filter_limits_length; i++){
00066       union {
00067         float real;
00068         uint32_t base;
00069       } u_st_filter_limits;
00070       u_st_filter_limits.base = 0;
00071       u_st_filter_limits.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00072       u_st_filter_limits.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00073       u_st_filter_limits.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00074       u_st_filter_limits.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00075       this->st_filter_limits = u_st_filter_limits.real;
00076       offset += sizeof(this->st_filter_limits);
00077         memcpy( &(this->filter_limits[i]), &(this->st_filter_limits), sizeof(float));
00078       }
00079      return offset;
00080     }
00081 
00082     const char * getType(){ return "object_recognition_msgs/ObjectRecognitionGoal"; };
00083     const char * getMD5(){ return "49bea2f03a1bba0ad05926e01e3525fa"; };
00084 
00085   };
00086 
00087 }
00088 #endif


ric_mc
Author(s): RoboTiCan
autogenerated on Thu Aug 27 2015 14:39:50