Working towards recieving twists

Dependencies:   BufferedSerial

Fork of ros_lib_kinetic by Gary Servin

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BadTwoInts.h Source File

BadTwoInts.h

00001 #ifndef _ROS_SERVICE_BadTwoInts_h
00002 #define _ROS_SERVICE_BadTwoInts_h
00003 #include <stdint.h>
00004 #include <string.h>
00005 #include <stdlib.h>
00006 #include "ros/msg.h"
00007 
00008 namespace rospy_tutorials
00009 {
00010 
00011 static const char BADTWOINTS[] = "rospy_tutorials/BadTwoInts";
00012 
00013   class BadTwoIntsRequest : public ros::Msg
00014   {
00015     public:
00016       typedef int64_t _a_type;
00017       _a_type a;
00018       typedef int32_t _b_type;
00019       _b_type b;
00020 
00021     BadTwoIntsRequest():
00022       a(0),
00023       b(0)
00024     {
00025     }
00026 
00027     virtual int serialize(unsigned char *outbuffer) const
00028     {
00029       int offset = 0;
00030       union {
00031         int64_t real;
00032         uint64_t base;
00033       } u_a;
00034       u_a.real = this->a;
00035       *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF;
00036       *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF;
00037       *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF;
00038       *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF;
00039       *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF;
00040       *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF;
00041       *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF;
00042       *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF;
00043       offset += sizeof(this->a);
00044       union {
00045         int32_t real;
00046         uint32_t base;
00047       } u_b;
00048       u_b.real = this->b;
00049       *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF;
00050       *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF;
00051       *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF;
00052       *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF;
00053       offset += sizeof(this->b);
00054       return offset;
00055     }
00056 
00057     virtual int deserialize(unsigned char *inbuffer)
00058     {
00059       int offset = 0;
00060       union {
00061         int64_t real;
00062         uint64_t base;
00063       } u_a;
00064       u_a.base = 0;
00065       u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00066       u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00067       u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00068       u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00069       u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00070       u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00071       u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00072       u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00073       this->a = u_a.real;
00074       offset += sizeof(this->a);
00075       union {
00076         int32_t real;
00077         uint32_t base;
00078       } u_b;
00079       u_b.base = 0;
00080       u_b.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00081       u_b.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00082       u_b.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00083       u_b.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00084       this->b = u_b.real;
00085       offset += sizeof(this->b);
00086      return offset;
00087     }
00088 
00089     const char * getType(){ return BADTWOINTS; };
00090     const char * getMD5(){ return "29bb5c7dea8bf822f53e94b0ee5a3a56"; };
00091 
00092   };
00093 
00094   class BadTwoIntsResponse : public ros::Msg
00095   {
00096     public:
00097       typedef int32_t _sum_type;
00098       _sum_type sum;
00099 
00100     BadTwoIntsResponse():
00101       sum(0)
00102     {
00103     }
00104 
00105     virtual int serialize(unsigned char *outbuffer) const
00106     {
00107       int offset = 0;
00108       union {
00109         int32_t real;
00110         uint32_t base;
00111       } u_sum;
00112       u_sum.real = this->sum;
00113       *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF;
00114       *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF;
00115       *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF;
00116       *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF;
00117       offset += sizeof(this->sum);
00118       return offset;
00119     }
00120 
00121     virtual int deserialize(unsigned char *inbuffer)
00122     {
00123       int offset = 0;
00124       union {
00125         int32_t real;
00126         uint32_t base;
00127       } u_sum;
00128       u_sum.base = 0;
00129       u_sum.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00130       u_sum.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00131       u_sum.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00132       u_sum.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00133       this->sum = u_sum.real;
00134       offset += sizeof(this->sum);
00135      return offset;
00136     }
00137 
00138     const char * getType(){ return BADTWOINTS; };
00139     const char * getMD5(){ return "0ba699c25c9418c0366f3595c0c8e8ec"; };
00140 
00141   };
00142 
00143   class BadTwoInts {
00144     public:
00145     typedef BadTwoIntsRequest Request;
00146     typedef BadTwoIntsResponse Response;
00147   };
00148 
00149 }
00150 #endif