kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
MapMetaData.h
Go to the documentation of this file.
1 #ifndef _ROS_nav_msgs_MapMetaData_h
2 #define _ROS_nav_msgs_MapMetaData_h
3 
4 #include <stdint.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include "ros/msg.h"
8 #include "ros/time.h"
9 #include "geometry_msgs/Pose.h"
10 
11 namespace nav_msgs
12 {
13 
14  class MapMetaData : public ros::Msg
15  {
16  public:
18  float resolution;
19  uint32_t width;
20  uint32_t height;
22 
24  map_load_time(),
25  resolution(0),
26  width(0),
27  height(0),
28  origin()
29  {
30  }
31 
32  virtual int serialize(unsigned char *outbuffer) const
33  {
34  int offset = 0;
35  *(outbuffer + offset + 0) = (this->map_load_time.sec >> (8 * 0)) & 0xFF;
36  *(outbuffer + offset + 1) = (this->map_load_time.sec >> (8 * 1)) & 0xFF;
37  *(outbuffer + offset + 2) = (this->map_load_time.sec >> (8 * 2)) & 0xFF;
38  *(outbuffer + offset + 3) = (this->map_load_time.sec >> (8 * 3)) & 0xFF;
39  offset += sizeof(this->map_load_time.sec);
40  *(outbuffer + offset + 0) = (this->map_load_time.nsec >> (8 * 0)) & 0xFF;
41  *(outbuffer + offset + 1) = (this->map_load_time.nsec >> (8 * 1)) & 0xFF;
42  *(outbuffer + offset + 2) = (this->map_load_time.nsec >> (8 * 2)) & 0xFF;
43  *(outbuffer + offset + 3) = (this->map_load_time.nsec >> (8 * 3)) & 0xFF;
44  offset += sizeof(this->map_load_time.nsec);
45  union {
46  float real;
47  uint32_t base;
48  } u_resolution;
49  u_resolution.real = this->resolution;
50  *(outbuffer + offset + 0) = (u_resolution.base >> (8 * 0)) & 0xFF;
51  *(outbuffer + offset + 1) = (u_resolution.base >> (8 * 1)) & 0xFF;
52  *(outbuffer + offset + 2) = (u_resolution.base >> (8 * 2)) & 0xFF;
53  *(outbuffer + offset + 3) = (u_resolution.base >> (8 * 3)) & 0xFF;
54  offset += sizeof(this->resolution);
55  *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF;
56  *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF;
57  *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF;
58  *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF;
59  offset += sizeof(this->width);
60  *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF;
61  *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF;
62  *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF;
63  *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF;
64  offset += sizeof(this->height);
65  offset += this->origin.serialize(outbuffer + offset);
66  return offset;
67  }
68 
69  virtual int deserialize(unsigned char *inbuffer)
70  {
71  int offset = 0;
72  this->map_load_time.sec = ((uint32_t) (*(inbuffer + offset)));
73  this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
74  this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
75  this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
76  offset += sizeof(this->map_load_time.sec);
77  this->map_load_time.nsec = ((uint32_t) (*(inbuffer + offset)));
78  this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
79  this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
80  this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
81  offset += sizeof(this->map_load_time.nsec);
82  union {
83  float real;
84  uint32_t base;
85  } u_resolution;
86  u_resolution.base = 0;
87  u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
88  u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
89  u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
90  u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
91  this->resolution = u_resolution.real;
92  offset += sizeof(this->resolution);
93  this->width = ((uint32_t) (*(inbuffer + offset)));
94  this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
95  this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
96  this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
97  offset += sizeof(this->width);
98  this->height = ((uint32_t) (*(inbuffer + offset)));
99  this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
100  this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
101  this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
102  offset += sizeof(this->height);
103  offset += this->origin.deserialize(inbuffer + offset);
104  return offset;
105  }
106 
107  const char * getType(){ return "nav_msgs/MapMetaData"; };
108  const char * getMD5(){ return "10cfc8a2818024d3248802c00c95f11b"; };
109 
110  };
111 
112 }
113 #endif
uint32_t nsec
Definition: time.h:50
uint32_t sec
Definition: time.h:50
Definition: time.h:47
const char * getType()
Definition: MapMetaData.h:107
geometry_msgs::Pose origin
Definition: MapMetaData.h:21
MapMetaData()
Definition: MapMetaData.h:23
virtual int serialize(unsigned char *outbuffer) const
Definition: Pose.h:26
ros::Time map_load_time
Definition: MapMetaData.h:17
virtual int deserialize(unsigned char *inbuffer)
Definition: Pose.h:34
virtual int deserialize(unsigned char *inbuffer)
Definition: MapMetaData.h:69
Definition: MapMetaData.h:14
uint32_t width
Definition: MapMetaData.h:19
uint32_t height
Definition: MapMetaData.h:20
Definition: Pose.h:14
virtual int serialize(unsigned char *outbuffer) const
Definition: MapMetaData.h:32
float resolution
Definition: MapMetaData.h:18
Definition: msg.h:43
const char * getMD5()
Definition: MapMetaData.h:108