catchrobo2022 / Mbed 2 deprecated catchrobo2022_mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MarkerDimensions.h Source File

MarkerDimensions.h

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