ozgur erbulan / ros_lib_indigo

Dependencies:   BufferedSerial

Dependents:   RobotFeedback mobileRobotITU

Fork of ros_lib_indigo by Gary Servin

Committer:
garyservin
Date:
Thu Mar 31 14:22:59 2016 +0000
Revision:
0:fd24f7ca9688
Initial commit, generated based on a clean indigo-desktop-full

Who changed what in which revision?

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