catchrobo2022 / Mbed 2 deprecated catchrobo2022_mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Circle2D.h Source File

Circle2D.h

00001 #ifndef _ROS_jsk_recognition_msgs_Circle2D_h
00002 #define _ROS_jsk_recognition_msgs_Circle2D_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "std_msgs/Header.h"
00009 
00010 namespace jsk_recognition_msgs
00011 {
00012 
00013   class Circle2D : public ros::Msg
00014   {
00015     public:
00016       typedef std_msgs::Header _header_type;
00017       _header_type header;
00018       typedef double _radius_type;
00019       _radius_type radius;
00020       typedef double _x_type;
00021       _x_type x;
00022       typedef double _y_type;
00023       _y_type y;
00024 
00025     Circle2D():
00026       header(),
00027       radius(0),
00028       x(0),
00029       y(0)
00030     {
00031     }
00032 
00033     virtual int serialize(unsigned char *outbuffer) const
00034     {
00035       int offset = 0;
00036       offset += this->header.serialize(outbuffer + offset);
00037       union {
00038         double real;
00039         uint64_t base;
00040       } u_radius;
00041       u_radius.real = this->radius;
00042       *(outbuffer + offset + 0) = (u_radius.base >> (8 * 0)) & 0xFF;
00043       *(outbuffer + offset + 1) = (u_radius.base >> (8 * 1)) & 0xFF;
00044       *(outbuffer + offset + 2) = (u_radius.base >> (8 * 2)) & 0xFF;
00045       *(outbuffer + offset + 3) = (u_radius.base >> (8 * 3)) & 0xFF;
00046       *(outbuffer + offset + 4) = (u_radius.base >> (8 * 4)) & 0xFF;
00047       *(outbuffer + offset + 5) = (u_radius.base >> (8 * 5)) & 0xFF;
00048       *(outbuffer + offset + 6) = (u_radius.base >> (8 * 6)) & 0xFF;
00049       *(outbuffer + offset + 7) = (u_radius.base >> (8 * 7)) & 0xFF;
00050       offset += sizeof(this->radius);
00051       union {
00052         double real;
00053         uint64_t base;
00054       } u_x;
00055       u_x.real = this->x;
00056       *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF;
00057       *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF;
00058       *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF;
00059       *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF;
00060       *(outbuffer + offset + 4) = (u_x.base >> (8 * 4)) & 0xFF;
00061       *(outbuffer + offset + 5) = (u_x.base >> (8 * 5)) & 0xFF;
00062       *(outbuffer + offset + 6) = (u_x.base >> (8 * 6)) & 0xFF;
00063       *(outbuffer + offset + 7) = (u_x.base >> (8 * 7)) & 0xFF;
00064       offset += sizeof(this->x);
00065       union {
00066         double real;
00067         uint64_t base;
00068       } u_y;
00069       u_y.real = this->y;
00070       *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF;
00071       *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF;
00072       *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF;
00073       *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF;
00074       *(outbuffer + offset + 4) = (u_y.base >> (8 * 4)) & 0xFF;
00075       *(outbuffer + offset + 5) = (u_y.base >> (8 * 5)) & 0xFF;
00076       *(outbuffer + offset + 6) = (u_y.base >> (8 * 6)) & 0xFF;
00077       *(outbuffer + offset + 7) = (u_y.base >> (8 * 7)) & 0xFF;
00078       offset += sizeof(this->y);
00079       return offset;
00080     }
00081 
00082     virtual int deserialize(unsigned char *inbuffer)
00083     {
00084       int offset = 0;
00085       offset += this->header.deserialize(inbuffer + offset);
00086       union {
00087         double real;
00088         uint64_t base;
00089       } u_radius;
00090       u_radius.base = 0;
00091       u_radius.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00092       u_radius.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00093       u_radius.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00094       u_radius.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00095       u_radius.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00096       u_radius.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00097       u_radius.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00098       u_radius.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00099       this->radius = u_radius.real;
00100       offset += sizeof(this->radius);
00101       union {
00102         double real;
00103         uint64_t base;
00104       } u_x;
00105       u_x.base = 0;
00106       u_x.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00107       u_x.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00108       u_x.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00109       u_x.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00110       u_x.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00111       u_x.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00112       u_x.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00113       u_x.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00114       this->x = u_x.real;
00115       offset += sizeof(this->x);
00116       union {
00117         double real;
00118         uint64_t base;
00119       } u_y;
00120       u_y.base = 0;
00121       u_y.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00122       u_y.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00123       u_y.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00124       u_y.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00125       u_y.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00126       u_y.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00127       u_y.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00128       u_y.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00129       this->y = u_y.real;
00130       offset += sizeof(this->y);
00131      return offset;
00132     }
00133 
00134     virtual const char * getType(){ return "jsk_recognition_msgs/Circle2D"; };
00135     virtual const char * getMD5(){ return "2337fe90a715387bfdc3cf4b7fa2391e"; };
00136 
00137   };
00138 
00139 }
00140 #endif