Go to the documentation of this file.00001 #ifndef _ROS_SERVICE_SaveScan_h
00002 #define _ROS_SERVICE_SaveScan_h
00003 #include <stdint.h>
00004 #include <string.h>
00005 #include <stdlib.h>
00006 #include "ros/msg.h"
00007 #include "geometry_msgs/PoseStamped.h"
00008 #include "household_objects_database_msgs/DatabaseReturnCode.h"
00009
00010 namespace household_objects_database_msgs
00011 {
00012
00013 static const char SAVESCAN[] = "household_objects_database_msgs/SaveScan";
00014
00015 class SaveScanRequest : public ros::Msg
00016 {
00017 public:
00018 int32_t scaled_model_id;
00019 geometry_msgs::PoseStamped ground_truth_pose;
00020 const char* bagfile_location;
00021 const char* scan_source;
00022 const char* cloud_topic;
00023
00024 virtual int serialize(unsigned char *outbuffer) const
00025 {
00026 int offset = 0;
00027 union {
00028 int32_t real;
00029 uint32_t base;
00030 } u_scaled_model_id;
00031 u_scaled_model_id.real = this->scaled_model_id;
00032 *(outbuffer + offset + 0) = (u_scaled_model_id.base >> (8 * 0)) & 0xFF;
00033 *(outbuffer + offset + 1) = (u_scaled_model_id.base >> (8 * 1)) & 0xFF;
00034 *(outbuffer + offset + 2) = (u_scaled_model_id.base >> (8 * 2)) & 0xFF;
00035 *(outbuffer + offset + 3) = (u_scaled_model_id.base >> (8 * 3)) & 0xFF;
00036 offset += sizeof(this->scaled_model_id);
00037 offset += this->ground_truth_pose.serialize(outbuffer + offset);
00038 uint32_t length_bagfile_location = strlen(this->bagfile_location);
00039 memcpy(outbuffer + offset, &length_bagfile_location, sizeof(uint32_t));
00040 offset += 4;
00041 memcpy(outbuffer + offset, this->bagfile_location, length_bagfile_location);
00042 offset += length_bagfile_location;
00043 uint32_t length_scan_source = strlen(this->scan_source);
00044 memcpy(outbuffer + offset, &length_scan_source, sizeof(uint32_t));
00045 offset += 4;
00046 memcpy(outbuffer + offset, this->scan_source, length_scan_source);
00047 offset += length_scan_source;
00048 uint32_t length_cloud_topic = strlen(this->cloud_topic);
00049 memcpy(outbuffer + offset, &length_cloud_topic, sizeof(uint32_t));
00050 offset += 4;
00051 memcpy(outbuffer + offset, this->cloud_topic, length_cloud_topic);
00052 offset += length_cloud_topic;
00053 return offset;
00054 }
00055
00056 virtual int deserialize(unsigned char *inbuffer)
00057 {
00058 int offset = 0;
00059 union {
00060 int32_t real;
00061 uint32_t base;
00062 } u_scaled_model_id;
00063 u_scaled_model_id.base = 0;
00064 u_scaled_model_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00065 u_scaled_model_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00066 u_scaled_model_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00067 u_scaled_model_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00068 this->scaled_model_id = u_scaled_model_id.real;
00069 offset += sizeof(this->scaled_model_id);
00070 offset += this->ground_truth_pose.deserialize(inbuffer + offset);
00071 uint32_t length_bagfile_location;
00072 memcpy(&length_bagfile_location, (inbuffer + offset), sizeof(uint32_t));
00073 offset += 4;
00074 for(unsigned int k= offset; k< offset+length_bagfile_location; ++k){
00075 inbuffer[k-1]=inbuffer[k];
00076 }
00077 inbuffer[offset+length_bagfile_location-1]=0;
00078 this->bagfile_location = (char *)(inbuffer + offset-1);
00079 offset += length_bagfile_location;
00080 uint32_t length_scan_source;
00081 memcpy(&length_scan_source, (inbuffer + offset), sizeof(uint32_t));
00082 offset += 4;
00083 for(unsigned int k= offset; k< offset+length_scan_source; ++k){
00084 inbuffer[k-1]=inbuffer[k];
00085 }
00086 inbuffer[offset+length_scan_source-1]=0;
00087 this->scan_source = (char *)(inbuffer + offset-1);
00088 offset += length_scan_source;
00089 uint32_t length_cloud_topic;
00090 memcpy(&length_cloud_topic, (inbuffer + offset), sizeof(uint32_t));
00091 offset += 4;
00092 for(unsigned int k= offset; k< offset+length_cloud_topic; ++k){
00093 inbuffer[k-1]=inbuffer[k];
00094 }
00095 inbuffer[offset+length_cloud_topic-1]=0;
00096 this->cloud_topic = (char *)(inbuffer + offset-1);
00097 offset += length_cloud_topic;
00098 return offset;
00099 }
00100
00101 const char * getType(){ return SAVESCAN; };
00102 const char * getMD5(){ return "492f49d320aa26325df5fb078c297fa5"; };
00103
00104 };
00105
00106 class SaveScanResponse : public ros::Msg
00107 {
00108 public:
00109 household_objects_database_msgs::DatabaseReturnCode return_code;
00110
00111 virtual int serialize(unsigned char *outbuffer) const
00112 {
00113 int offset = 0;
00114 offset += this->return_code.serialize(outbuffer + offset);
00115 return offset;
00116 }
00117
00118 virtual int deserialize(unsigned char *inbuffer)
00119 {
00120 int offset = 0;
00121 offset += this->return_code.deserialize(inbuffer + offset);
00122 return offset;
00123 }
00124
00125 const char * getType(){ return SAVESCAN; };
00126 const char * getMD5(){ return "b49fccceeb56b964ed23601916a24082"; };
00127
00128 };
00129
00130 class SaveScan {
00131 public:
00132 typedef SaveScanRequest Request;
00133 typedef SaveScanResponse Response;
00134 };
00135
00136 }
00137 #endif