catchrobo2022 / Mbed 2 deprecated catchrobo2022_mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers HeightmapConfig.h Source File

HeightmapConfig.h

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