DatabaseScan.h
Go to the documentation of this file.
00001 #ifndef _ROS_household_objects_database_msgs_DatabaseScan_h
00002 #define _ROS_household_objects_database_msgs_DatabaseScan_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "geometry_msgs/PoseStamped.h"
00009 
00010 namespace household_objects_database_msgs
00011 {
00012 
00013   class DatabaseScan : public ros::Msg
00014   {
00015     public:
00016       int32_t model_id;
00017       const char* bagfile_location;
00018       const char* scan_source;
00019       geometry_msgs::PoseStamped pose;
00020       const char* cloud_topic;
00021 
00022     virtual int serialize(unsigned char *outbuffer) const
00023     {
00024       int offset = 0;
00025       union {
00026         int32_t real;
00027         uint32_t base;
00028       } u_model_id;
00029       u_model_id.real = this->model_id;
00030       *(outbuffer + offset + 0) = (u_model_id.base >> (8 * 0)) & 0xFF;
00031       *(outbuffer + offset + 1) = (u_model_id.base >> (8 * 1)) & 0xFF;
00032       *(outbuffer + offset + 2) = (u_model_id.base >> (8 * 2)) & 0xFF;
00033       *(outbuffer + offset + 3) = (u_model_id.base >> (8 * 3)) & 0xFF;
00034       offset += sizeof(this->model_id);
00035       uint32_t length_bagfile_location = strlen(this->bagfile_location);
00036       memcpy(outbuffer + offset, &length_bagfile_location, sizeof(uint32_t));
00037       offset += 4;
00038       memcpy(outbuffer + offset, this->bagfile_location, length_bagfile_location);
00039       offset += length_bagfile_location;
00040       uint32_t length_scan_source = strlen(this->scan_source);
00041       memcpy(outbuffer + offset, &length_scan_source, sizeof(uint32_t));
00042       offset += 4;
00043       memcpy(outbuffer + offset, this->scan_source, length_scan_source);
00044       offset += length_scan_source;
00045       offset += this->pose.serialize(outbuffer + offset);
00046       uint32_t length_cloud_topic = strlen(this->cloud_topic);
00047       memcpy(outbuffer + offset, &length_cloud_topic, sizeof(uint32_t));
00048       offset += 4;
00049       memcpy(outbuffer + offset, this->cloud_topic, length_cloud_topic);
00050       offset += length_cloud_topic;
00051       return offset;
00052     }
00053 
00054     virtual int deserialize(unsigned char *inbuffer)
00055     {
00056       int offset = 0;
00057       union {
00058         int32_t real;
00059         uint32_t base;
00060       } u_model_id;
00061       u_model_id.base = 0;
00062       u_model_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00063       u_model_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00064       u_model_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00065       u_model_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00066       this->model_id = u_model_id.real;
00067       offset += sizeof(this->model_id);
00068       uint32_t length_bagfile_location;
00069       memcpy(&length_bagfile_location, (inbuffer + offset), sizeof(uint32_t));
00070       offset += 4;
00071       for(unsigned int k= offset; k< offset+length_bagfile_location; ++k){
00072           inbuffer[k-1]=inbuffer[k];
00073       }
00074       inbuffer[offset+length_bagfile_location-1]=0;
00075       this->bagfile_location = (char *)(inbuffer + offset-1);
00076       offset += length_bagfile_location;
00077       uint32_t length_scan_source;
00078       memcpy(&length_scan_source, (inbuffer + offset), sizeof(uint32_t));
00079       offset += 4;
00080       for(unsigned int k= offset; k< offset+length_scan_source; ++k){
00081           inbuffer[k-1]=inbuffer[k];
00082       }
00083       inbuffer[offset+length_scan_source-1]=0;
00084       this->scan_source = (char *)(inbuffer + offset-1);
00085       offset += length_scan_source;
00086       offset += this->pose.deserialize(inbuffer + offset);
00087       uint32_t length_cloud_topic;
00088       memcpy(&length_cloud_topic, (inbuffer + offset), sizeof(uint32_t));
00089       offset += 4;
00090       for(unsigned int k= offset; k< offset+length_cloud_topic; ++k){
00091           inbuffer[k-1]=inbuffer[k];
00092       }
00093       inbuffer[offset+length_cloud_topic-1]=0;
00094       this->cloud_topic = (char *)(inbuffer + offset-1);
00095       offset += length_cloud_topic;
00096      return offset;
00097     }
00098 
00099     const char * getType(){ return "household_objects_database_msgs/DatabaseScan"; };
00100     const char * getMD5(){ return "7edb7abec4973143a801c25c336b4bb1"; };
00101 
00102   };
00103 
00104 }
00105 #endif


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