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 SetPen.h Source File

SetPen.h

00001 #ifndef _ROS_SERVICE_SetPen_h
00002 #define _ROS_SERVICE_SetPen_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 SETPEN[] = "turtlesim/SetPen";
00012 
00013   class SetPenRequest : public ros::Msg
00014   {
00015     public:
00016       typedef uint8_t _r_type;
00017       _r_type r;
00018       typedef uint8_t _g_type;
00019       _g_type g;
00020       typedef uint8_t _b_type;
00021       _b_type b;
00022       typedef uint8_t _width_type;
00023       _width_type width;
00024       typedef uint8_t _off_type;
00025       _off_type off;
00026 
00027     SetPenRequest():
00028       r(0),
00029       g(0),
00030       b(0),
00031       width(0),
00032       off(0)
00033     {
00034     }
00035 
00036     virtual int serialize(unsigned char *outbuffer) const
00037     {
00038       int offset = 0;
00039       *(outbuffer + offset + 0) = (this->r >> (8 * 0)) & 0xFF;
00040       offset += sizeof(this->r);
00041       *(outbuffer + offset + 0) = (this->g >> (8 * 0)) & 0xFF;
00042       offset += sizeof(this->g);
00043       *(outbuffer + offset + 0) = (this->b >> (8 * 0)) & 0xFF;
00044       offset += sizeof(this->b);
00045       *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF;
00046       offset += sizeof(this->width);
00047       *(outbuffer + offset + 0) = (this->off >> (8 * 0)) & 0xFF;
00048       offset += sizeof(this->off);
00049       return offset;
00050     }
00051 
00052     virtual int deserialize(unsigned char *inbuffer)
00053     {
00054       int offset = 0;
00055       this->r =  ((uint8_t) (*(inbuffer + offset)));
00056       offset += sizeof(this->r);
00057       this->g =  ((uint8_t) (*(inbuffer + offset)));
00058       offset += sizeof(this->g);
00059       this->b =  ((uint8_t) (*(inbuffer + offset)));
00060       offset += sizeof(this->b);
00061       this->width =  ((uint8_t) (*(inbuffer + offset)));
00062       offset += sizeof(this->width);
00063       this->off =  ((uint8_t) (*(inbuffer + offset)));
00064       offset += sizeof(this->off);
00065      return offset;
00066     }
00067 
00068     const char * getType(){ return SETPEN; };
00069     const char * getMD5(){ return "9f452acce566bf0c0954594f69a8e41b"; };
00070 
00071   };
00072 
00073   class SetPenResponse : public ros::Msg
00074   {
00075     public:
00076 
00077     SetPenResponse()
00078     {
00079     }
00080 
00081     virtual int serialize(unsigned char *outbuffer) const
00082     {
00083       int offset = 0;
00084       return offset;
00085     }
00086 
00087     virtual int deserialize(unsigned char *inbuffer)
00088     {
00089       int offset = 0;
00090      return offset;
00091     }
00092 
00093     const char * getType(){ return SETPEN; };
00094     const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; };
00095 
00096   };
00097 
00098   class SetPen {
00099     public:
00100     typedef SetPenRequest Request;
00101     typedef SetPenResponse Response;
00102   };
00103 
00104 }
00105 #endif