PointIndices.h
Go to the documentation of this file.
00001 #ifndef _ROS_pcl_msgs_PointIndices_h
00002 #define _ROS_pcl_msgs_PointIndices_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 
00010 namespace pcl_msgs
00011 {
00012 
00013   class PointIndices : public ros::Msg
00014   {
00015     public:
00016       std_msgs::Header header;
00017       uint8_t indices_length;
00018       int32_t st_indices;
00019       int32_t * indices;
00020 
00021     virtual int serialize(unsigned char *outbuffer) const
00022     {
00023       int offset = 0;
00024       offset += this->header.serialize(outbuffer + offset);
00025       *(outbuffer + offset++) = indices_length;
00026       *(outbuffer + offset++) = 0;
00027       *(outbuffer + offset++) = 0;
00028       *(outbuffer + offset++) = 0;
00029       for( uint8_t i = 0; i < indices_length; i++){
00030       union {
00031         int32_t real;
00032         uint32_t base;
00033       } u_indicesi;
00034       u_indicesi.real = this->indices[i];
00035       *(outbuffer + offset + 0) = (u_indicesi.base >> (8 * 0)) & 0xFF;
00036       *(outbuffer + offset + 1) = (u_indicesi.base >> (8 * 1)) & 0xFF;
00037       *(outbuffer + offset + 2) = (u_indicesi.base >> (8 * 2)) & 0xFF;
00038       *(outbuffer + offset + 3) = (u_indicesi.base >> (8 * 3)) & 0xFF;
00039       offset += sizeof(this->indices[i]);
00040       }
00041       return offset;
00042     }
00043 
00044     virtual int deserialize(unsigned char *inbuffer)
00045     {
00046       int offset = 0;
00047       offset += this->header.deserialize(inbuffer + offset);
00048       uint8_t indices_lengthT = *(inbuffer + offset++);
00049       if(indices_lengthT > indices_length)
00050         this->indices = (int32_t*)realloc(this->indices, indices_lengthT * sizeof(int32_t));
00051       offset += 3;
00052       indices_length = indices_lengthT;
00053       for( uint8_t i = 0; i < indices_length; i++){
00054       union {
00055         int32_t real;
00056         uint32_t base;
00057       } u_st_indices;
00058       u_st_indices.base = 0;
00059       u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00060       u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00061       u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00062       u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00063       this->st_indices = u_st_indices.real;
00064       offset += sizeof(this->st_indices);
00065         memcpy( &(this->indices[i]), &(this->st_indices), sizeof(int32_t));
00066       }
00067      return offset;
00068     }
00069 
00070     const char * getType(){ return "pcl_msgs/PointIndices"; };
00071     const char * getMD5(){ return "458c7998b7eaf99908256472e273b3d4"; };
00072 
00073   };
00074 
00075 }
00076 #endif


lizi_arduino
Author(s): RoboTiCan
autogenerated on Wed Aug 26 2015 12:24:22