TeleportAbsolute.h
Go to the documentation of this file.
00001 #ifndef _ROS_SERVICE_TeleportAbsolute_h
00002 #define _ROS_SERVICE_TeleportAbsolute_h
00003 #include <stdint.h>
00004 #include <string.h>
00005 #include <stdlib.h>
00006 #include "ros/msg.h"
00007 
00008 namespace turtlesim
00009 {
00010 
00011 static const char TELEPORTABSOLUTE[] = "turtlesim/TeleportAbsolute";
00012 
00013   class TeleportAbsoluteRequest : public ros::Msg
00014   {
00015     public:
00016       float x;
00017       float y;
00018       float theta;
00019 
00020     virtual int serialize(unsigned char *outbuffer) const
00021     {
00022       int offset = 0;
00023       union {
00024         float real;
00025         uint32_t base;
00026       } u_x;
00027       u_x.real = this->x;
00028       *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF;
00029       *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF;
00030       *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF;
00031       *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF;
00032       offset += sizeof(this->x);
00033       union {
00034         float real;
00035         uint32_t base;
00036       } u_y;
00037       u_y.real = this->y;
00038       *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF;
00039       *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF;
00040       *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF;
00041       *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF;
00042       offset += sizeof(this->y);
00043       union {
00044         float real;
00045         uint32_t base;
00046       } u_theta;
00047       u_theta.real = this->theta;
00048       *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF;
00049       *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF;
00050       *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF;
00051       *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF;
00052       offset += sizeof(this->theta);
00053       return offset;
00054     }
00055 
00056     virtual int deserialize(unsigned char *inbuffer)
00057     {
00058       int offset = 0;
00059       union {
00060         float real;
00061         uint32_t base;
00062       } u_x;
00063       u_x.base = 0;
00064       u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00065       u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00066       u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00067       u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00068       this->x = u_x.real;
00069       offset += sizeof(this->x);
00070       union {
00071         float real;
00072         uint32_t base;
00073       } u_y;
00074       u_y.base = 0;
00075       u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00076       u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00077       u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00078       u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00079       this->y = u_y.real;
00080       offset += sizeof(this->y);
00081       union {
00082         float real;
00083         uint32_t base;
00084       } u_theta;
00085       u_theta.base = 0;
00086       u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00087       u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00088       u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00089       u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00090       this->theta = u_theta.real;
00091       offset += sizeof(this->theta);
00092      return offset;
00093     }
00094 
00095     const char * getType(){ return TELEPORTABSOLUTE; };
00096     const char * getMD5(){ return "a130bc60ee6513855dc62ea83fcc5b20"; };
00097 
00098   };
00099 
00100   class TeleportAbsoluteResponse : public ros::Msg
00101   {
00102     public:
00103 
00104     virtual int serialize(unsigned char *outbuffer) const
00105     {
00106       int offset = 0;
00107       return offset;
00108     }
00109 
00110     virtual int deserialize(unsigned char *inbuffer)
00111     {
00112       int offset = 0;
00113      return offset;
00114     }
00115 
00116     const char * getType(){ return TELEPORTABSOLUTE; };
00117     const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; };
00118 
00119   };
00120 
00121   class TeleportAbsolute {
00122     public:
00123     typedef TeleportAbsoluteRequest Request;
00124     typedef TeleportAbsoluteResponse Response;
00125   };
00126 
00127 }
00128 #endif


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