catchrobo2022 / Mbed 2 deprecated catchrobo2022_mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Touch.h Source File

Touch.h

00001 #ifndef _ROS_jsk_gui_msgs_Touch_h
00002 #define _ROS_jsk_gui_msgs_Touch_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 
00009 namespace jsk_gui_msgs
00010 {
00011 
00012   class Touch : public ros::Msg
00013   {
00014     public:
00015       typedef int64_t _finger_id_type;
00016       _finger_id_type finger_id;
00017       typedef double _x_type;
00018       _x_type x;
00019       typedef double _y_type;
00020       _y_type y;
00021       typedef int64_t _image_width_type;
00022       _image_width_type image_width;
00023       typedef int64_t _image_height_type;
00024       _image_height_type image_height;
00025 
00026     Touch():
00027       finger_id(0),
00028       x(0),
00029       y(0),
00030       image_width(0),
00031       image_height(0)
00032     {
00033     }
00034 
00035     virtual int serialize(unsigned char *outbuffer) const
00036     {
00037       int offset = 0;
00038       union {
00039         int64_t real;
00040         uint64_t base;
00041       } u_finger_id;
00042       u_finger_id.real = this->finger_id;
00043       *(outbuffer + offset + 0) = (u_finger_id.base >> (8 * 0)) & 0xFF;
00044       *(outbuffer + offset + 1) = (u_finger_id.base >> (8 * 1)) & 0xFF;
00045       *(outbuffer + offset + 2) = (u_finger_id.base >> (8 * 2)) & 0xFF;
00046       *(outbuffer + offset + 3) = (u_finger_id.base >> (8 * 3)) & 0xFF;
00047       *(outbuffer + offset + 4) = (u_finger_id.base >> (8 * 4)) & 0xFF;
00048       *(outbuffer + offset + 5) = (u_finger_id.base >> (8 * 5)) & 0xFF;
00049       *(outbuffer + offset + 6) = (u_finger_id.base >> (8 * 6)) & 0xFF;
00050       *(outbuffer + offset + 7) = (u_finger_id.base >> (8 * 7)) & 0xFF;
00051       offset += sizeof(this->finger_id);
00052       union {
00053         double real;
00054         uint64_t base;
00055       } u_x;
00056       u_x.real = this->x;
00057       *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF;
00058       *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF;
00059       *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF;
00060       *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF;
00061       *(outbuffer + offset + 4) = (u_x.base >> (8 * 4)) & 0xFF;
00062       *(outbuffer + offset + 5) = (u_x.base >> (8 * 5)) & 0xFF;
00063       *(outbuffer + offset + 6) = (u_x.base >> (8 * 6)) & 0xFF;
00064       *(outbuffer + offset + 7) = (u_x.base >> (8 * 7)) & 0xFF;
00065       offset += sizeof(this->x);
00066       union {
00067         double real;
00068         uint64_t base;
00069       } u_y;
00070       u_y.real = this->y;
00071       *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF;
00072       *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF;
00073       *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF;
00074       *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF;
00075       *(outbuffer + offset + 4) = (u_y.base >> (8 * 4)) & 0xFF;
00076       *(outbuffer + offset + 5) = (u_y.base >> (8 * 5)) & 0xFF;
00077       *(outbuffer + offset + 6) = (u_y.base >> (8 * 6)) & 0xFF;
00078       *(outbuffer + offset + 7) = (u_y.base >> (8 * 7)) & 0xFF;
00079       offset += sizeof(this->y);
00080       union {
00081         int64_t real;
00082         uint64_t base;
00083       } u_image_width;
00084       u_image_width.real = this->image_width;
00085       *(outbuffer + offset + 0) = (u_image_width.base >> (8 * 0)) & 0xFF;
00086       *(outbuffer + offset + 1) = (u_image_width.base >> (8 * 1)) & 0xFF;
00087       *(outbuffer + offset + 2) = (u_image_width.base >> (8 * 2)) & 0xFF;
00088       *(outbuffer + offset + 3) = (u_image_width.base >> (8 * 3)) & 0xFF;
00089       *(outbuffer + offset + 4) = (u_image_width.base >> (8 * 4)) & 0xFF;
00090       *(outbuffer + offset + 5) = (u_image_width.base >> (8 * 5)) & 0xFF;
00091       *(outbuffer + offset + 6) = (u_image_width.base >> (8 * 6)) & 0xFF;
00092       *(outbuffer + offset + 7) = (u_image_width.base >> (8 * 7)) & 0xFF;
00093       offset += sizeof(this->image_width);
00094       union {
00095         int64_t real;
00096         uint64_t base;
00097       } u_image_height;
00098       u_image_height.real = this->image_height;
00099       *(outbuffer + offset + 0) = (u_image_height.base >> (8 * 0)) & 0xFF;
00100       *(outbuffer + offset + 1) = (u_image_height.base >> (8 * 1)) & 0xFF;
00101       *(outbuffer + offset + 2) = (u_image_height.base >> (8 * 2)) & 0xFF;
00102       *(outbuffer + offset + 3) = (u_image_height.base >> (8 * 3)) & 0xFF;
00103       *(outbuffer + offset + 4) = (u_image_height.base >> (8 * 4)) & 0xFF;
00104       *(outbuffer + offset + 5) = (u_image_height.base >> (8 * 5)) & 0xFF;
00105       *(outbuffer + offset + 6) = (u_image_height.base >> (8 * 6)) & 0xFF;
00106       *(outbuffer + offset + 7) = (u_image_height.base >> (8 * 7)) & 0xFF;
00107       offset += sizeof(this->image_height);
00108       return offset;
00109     }
00110 
00111     virtual int deserialize(unsigned char *inbuffer)
00112     {
00113       int offset = 0;
00114       union {
00115         int64_t real;
00116         uint64_t base;
00117       } u_finger_id;
00118       u_finger_id.base = 0;
00119       u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00120       u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00121       u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00122       u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00123       u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00124       u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00125       u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00126       u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00127       this->finger_id = u_finger_id.real;
00128       offset += sizeof(this->finger_id);
00129       union {
00130         double real;
00131         uint64_t base;
00132       } u_x;
00133       u_x.base = 0;
00134       u_x.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00135       u_x.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00136       u_x.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00137       u_x.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00138       u_x.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00139       u_x.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00140       u_x.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00141       u_x.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00142       this->x = u_x.real;
00143       offset += sizeof(this->x);
00144       union {
00145         double real;
00146         uint64_t base;
00147       } u_y;
00148       u_y.base = 0;
00149       u_y.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00150       u_y.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00151       u_y.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00152       u_y.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00153       u_y.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00154       u_y.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00155       u_y.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00156       u_y.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00157       this->y = u_y.real;
00158       offset += sizeof(this->y);
00159       union {
00160         int64_t real;
00161         uint64_t base;
00162       } u_image_width;
00163       u_image_width.base = 0;
00164       u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00165       u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00166       u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00167       u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00168       u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00169       u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00170       u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00171       u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00172       this->image_width = u_image_width.real;
00173       offset += sizeof(this->image_width);
00174       union {
00175         int64_t real;
00176         uint64_t base;
00177       } u_image_height;
00178       u_image_height.base = 0;
00179       u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00180       u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00181       u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00182       u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00183       u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00184       u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00185       u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00186       u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00187       this->image_height = u_image_height.real;
00188       offset += sizeof(this->image_height);
00189      return offset;
00190     }
00191 
00192     virtual const char * getType(){ return "jsk_gui_msgs/Touch"; };
00193     virtual const char * getMD5(){ return "d96a284d39fcc410f375ac68fd380177"; };
00194 
00195   };
00196 
00197 }
00198 #endif