It has only one change from original one. I added robotfeedback message on it.

Dependencies:   BufferedSerial

Dependents:   RobotFeedback mobileRobotITU

Fork of ros_lib_indigo by Gary Servin

Committer:
randalthor
Date:
Sat Mar 04 14:07:56 2017 +0000
Revision:
4:80d9bee5079a
Parent:
0:fd24f7ca9688
fatih

Who changed what in which revision?

UserRevisionLine numberNew contents of line
garyservin 0:fd24f7ca9688 1 #ifndef _ROS_map_msgs_ProjectedMapInfo_h
garyservin 0:fd24f7ca9688 2 #define _ROS_map_msgs_ProjectedMapInfo_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
garyservin 0:fd24f7ca9688 9 namespace map_msgs
garyservin 0:fd24f7ca9688 10 {
garyservin 0:fd24f7ca9688 11
garyservin 0:fd24f7ca9688 12 class ProjectedMapInfo : public ros::Msg
garyservin 0:fd24f7ca9688 13 {
garyservin 0:fd24f7ca9688 14 public:
garyservin 0:fd24f7ca9688 15 const char* frame_id;
garyservin 0:fd24f7ca9688 16 double x;
garyservin 0:fd24f7ca9688 17 double y;
garyservin 0:fd24f7ca9688 18 double width;
garyservin 0:fd24f7ca9688 19 double height;
garyservin 0:fd24f7ca9688 20 double min_z;
garyservin 0:fd24f7ca9688 21 double max_z;
garyservin 0:fd24f7ca9688 22
garyservin 0:fd24f7ca9688 23 ProjectedMapInfo():
garyservin 0:fd24f7ca9688 24 frame_id(""),
garyservin 0:fd24f7ca9688 25 x(0),
garyservin 0:fd24f7ca9688 26 y(0),
garyservin 0:fd24f7ca9688 27 width(0),
garyservin 0:fd24f7ca9688 28 height(0),
garyservin 0:fd24f7ca9688 29 min_z(0),
garyservin 0:fd24f7ca9688 30 max_z(0)
garyservin 0:fd24f7ca9688 31 {
garyservin 0:fd24f7ca9688 32 }
garyservin 0:fd24f7ca9688 33
garyservin 0:fd24f7ca9688 34 virtual int serialize(unsigned char *outbuffer) const
garyservin 0:fd24f7ca9688 35 {
garyservin 0:fd24f7ca9688 36 int offset = 0;
garyservin 0:fd24f7ca9688 37 uint32_t length_frame_id = strlen(this->frame_id);
garyservin 0:fd24f7ca9688 38 memcpy(outbuffer + offset, &length_frame_id, sizeof(uint32_t));
garyservin 0:fd24f7ca9688 39 offset += 4;
garyservin 0:fd24f7ca9688 40 memcpy(outbuffer + offset, this->frame_id, length_frame_id);
garyservin 0:fd24f7ca9688 41 offset += length_frame_id;
garyservin 0:fd24f7ca9688 42 union {
garyservin 0:fd24f7ca9688 43 double real;
garyservin 0:fd24f7ca9688 44 uint64_t base;
garyservin 0:fd24f7ca9688 45 } u_x;
garyservin 0:fd24f7ca9688 46 u_x.real = this->x;
garyservin 0:fd24f7ca9688 47 *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF;
garyservin 0:fd24f7ca9688 48 *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF;
garyservin 0:fd24f7ca9688 49 *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF;
garyservin 0:fd24f7ca9688 50 *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF;
garyservin 0:fd24f7ca9688 51 *(outbuffer + offset + 4) = (u_x.base >> (8 * 4)) & 0xFF;
garyservin 0:fd24f7ca9688 52 *(outbuffer + offset + 5) = (u_x.base >> (8 * 5)) & 0xFF;
garyservin 0:fd24f7ca9688 53 *(outbuffer + offset + 6) = (u_x.base >> (8 * 6)) & 0xFF;
garyservin 0:fd24f7ca9688 54 *(outbuffer + offset + 7) = (u_x.base >> (8 * 7)) & 0xFF;
garyservin 0:fd24f7ca9688 55 offset += sizeof(this->x);
garyservin 0:fd24f7ca9688 56 union {
garyservin 0:fd24f7ca9688 57 double real;
garyservin 0:fd24f7ca9688 58 uint64_t base;
garyservin 0:fd24f7ca9688 59 } u_y;
garyservin 0:fd24f7ca9688 60 u_y.real = this->y;
garyservin 0:fd24f7ca9688 61 *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF;
garyservin 0:fd24f7ca9688 62 *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF;
garyservin 0:fd24f7ca9688 63 *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF;
garyservin 0:fd24f7ca9688 64 *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF;
garyservin 0:fd24f7ca9688 65 *(outbuffer + offset + 4) = (u_y.base >> (8 * 4)) & 0xFF;
garyservin 0:fd24f7ca9688 66 *(outbuffer + offset + 5) = (u_y.base >> (8 * 5)) & 0xFF;
garyservin 0:fd24f7ca9688 67 *(outbuffer + offset + 6) = (u_y.base >> (8 * 6)) & 0xFF;
garyservin 0:fd24f7ca9688 68 *(outbuffer + offset + 7) = (u_y.base >> (8 * 7)) & 0xFF;
garyservin 0:fd24f7ca9688 69 offset += sizeof(this->y);
garyservin 0:fd24f7ca9688 70 union {
garyservin 0:fd24f7ca9688 71 double real;
garyservin 0:fd24f7ca9688 72 uint64_t base;
garyservin 0:fd24f7ca9688 73 } u_width;
garyservin 0:fd24f7ca9688 74 u_width.real = this->width;
garyservin 0:fd24f7ca9688 75 *(outbuffer + offset + 0) = (u_width.base >> (8 * 0)) & 0xFF;
garyservin 0:fd24f7ca9688 76 *(outbuffer + offset + 1) = (u_width.base >> (8 * 1)) & 0xFF;
garyservin 0:fd24f7ca9688 77 *(outbuffer + offset + 2) = (u_width.base >> (8 * 2)) & 0xFF;
garyservin 0:fd24f7ca9688 78 *(outbuffer + offset + 3) = (u_width.base >> (8 * 3)) & 0xFF;
garyservin 0:fd24f7ca9688 79 *(outbuffer + offset + 4) = (u_width.base >> (8 * 4)) & 0xFF;
garyservin 0:fd24f7ca9688 80 *(outbuffer + offset + 5) = (u_width.base >> (8 * 5)) & 0xFF;
garyservin 0:fd24f7ca9688 81 *(outbuffer + offset + 6) = (u_width.base >> (8 * 6)) & 0xFF;
garyservin 0:fd24f7ca9688 82 *(outbuffer + offset + 7) = (u_width.base >> (8 * 7)) & 0xFF;
garyservin 0:fd24f7ca9688 83 offset += sizeof(this->width);
garyservin 0:fd24f7ca9688 84 union {
garyservin 0:fd24f7ca9688 85 double real;
garyservin 0:fd24f7ca9688 86 uint64_t base;
garyservin 0:fd24f7ca9688 87 } u_height;
garyservin 0:fd24f7ca9688 88 u_height.real = this->height;
garyservin 0:fd24f7ca9688 89 *(outbuffer + offset + 0) = (u_height.base >> (8 * 0)) & 0xFF;
garyservin 0:fd24f7ca9688 90 *(outbuffer + offset + 1) = (u_height.base >> (8 * 1)) & 0xFF;
garyservin 0:fd24f7ca9688 91 *(outbuffer + offset + 2) = (u_height.base >> (8 * 2)) & 0xFF;
garyservin 0:fd24f7ca9688 92 *(outbuffer + offset + 3) = (u_height.base >> (8 * 3)) & 0xFF;
garyservin 0:fd24f7ca9688 93 *(outbuffer + offset + 4) = (u_height.base >> (8 * 4)) & 0xFF;
garyservin 0:fd24f7ca9688 94 *(outbuffer + offset + 5) = (u_height.base >> (8 * 5)) & 0xFF;
garyservin 0:fd24f7ca9688 95 *(outbuffer + offset + 6) = (u_height.base >> (8 * 6)) & 0xFF;
garyservin 0:fd24f7ca9688 96 *(outbuffer + offset + 7) = (u_height.base >> (8 * 7)) & 0xFF;
garyservin 0:fd24f7ca9688 97 offset += sizeof(this->height);
garyservin 0:fd24f7ca9688 98 union {
garyservin 0:fd24f7ca9688 99 double real;
garyservin 0:fd24f7ca9688 100 uint64_t base;
garyservin 0:fd24f7ca9688 101 } u_min_z;
garyservin 0:fd24f7ca9688 102 u_min_z.real = this->min_z;
garyservin 0:fd24f7ca9688 103 *(outbuffer + offset + 0) = (u_min_z.base >> (8 * 0)) & 0xFF;
garyservin 0:fd24f7ca9688 104 *(outbuffer + offset + 1) = (u_min_z.base >> (8 * 1)) & 0xFF;
garyservin 0:fd24f7ca9688 105 *(outbuffer + offset + 2) = (u_min_z.base >> (8 * 2)) & 0xFF;
garyservin 0:fd24f7ca9688 106 *(outbuffer + offset + 3) = (u_min_z.base >> (8 * 3)) & 0xFF;
garyservin 0:fd24f7ca9688 107 *(outbuffer + offset + 4) = (u_min_z.base >> (8 * 4)) & 0xFF;
garyservin 0:fd24f7ca9688 108 *(outbuffer + offset + 5) = (u_min_z.base >> (8 * 5)) & 0xFF;
garyservin 0:fd24f7ca9688 109 *(outbuffer + offset + 6) = (u_min_z.base >> (8 * 6)) & 0xFF;
garyservin 0:fd24f7ca9688 110 *(outbuffer + offset + 7) = (u_min_z.base >> (8 * 7)) & 0xFF;
garyservin 0:fd24f7ca9688 111 offset += sizeof(this->min_z);
garyservin 0:fd24f7ca9688 112 union {
garyservin 0:fd24f7ca9688 113 double real;
garyservin 0:fd24f7ca9688 114 uint64_t base;
garyservin 0:fd24f7ca9688 115 } u_max_z;
garyservin 0:fd24f7ca9688 116 u_max_z.real = this->max_z;
garyservin 0:fd24f7ca9688 117 *(outbuffer + offset + 0) = (u_max_z.base >> (8 * 0)) & 0xFF;
garyservin 0:fd24f7ca9688 118 *(outbuffer + offset + 1) = (u_max_z.base >> (8 * 1)) & 0xFF;
garyservin 0:fd24f7ca9688 119 *(outbuffer + offset + 2) = (u_max_z.base >> (8 * 2)) & 0xFF;
garyservin 0:fd24f7ca9688 120 *(outbuffer + offset + 3) = (u_max_z.base >> (8 * 3)) & 0xFF;
garyservin 0:fd24f7ca9688 121 *(outbuffer + offset + 4) = (u_max_z.base >> (8 * 4)) & 0xFF;
garyservin 0:fd24f7ca9688 122 *(outbuffer + offset + 5) = (u_max_z.base >> (8 * 5)) & 0xFF;
garyservin 0:fd24f7ca9688 123 *(outbuffer + offset + 6) = (u_max_z.base >> (8 * 6)) & 0xFF;
garyservin 0:fd24f7ca9688 124 *(outbuffer + offset + 7) = (u_max_z.base >> (8 * 7)) & 0xFF;
garyservin 0:fd24f7ca9688 125 offset += sizeof(this->max_z);
garyservin 0:fd24f7ca9688 126 return offset;
garyservin 0:fd24f7ca9688 127 }
garyservin 0:fd24f7ca9688 128
garyservin 0:fd24f7ca9688 129 virtual int deserialize(unsigned char *inbuffer)
garyservin 0:fd24f7ca9688 130 {
garyservin 0:fd24f7ca9688 131 int offset = 0;
garyservin 0:fd24f7ca9688 132 uint32_t length_frame_id;
garyservin 0:fd24f7ca9688 133 memcpy(&length_frame_id, (inbuffer + offset), sizeof(uint32_t));
garyservin 0:fd24f7ca9688 134 offset += 4;
garyservin 0:fd24f7ca9688 135 for(unsigned int k= offset; k< offset+length_frame_id; ++k){
garyservin 0:fd24f7ca9688 136 inbuffer[k-1]=inbuffer[k];
garyservin 0:fd24f7ca9688 137 }
garyservin 0:fd24f7ca9688 138 inbuffer[offset+length_frame_id-1]=0;
garyservin 0:fd24f7ca9688 139 this->frame_id = (char *)(inbuffer + offset-1);
garyservin 0:fd24f7ca9688 140 offset += length_frame_id;
garyservin 0:fd24f7ca9688 141 union {
garyservin 0:fd24f7ca9688 142 double real;
garyservin 0:fd24f7ca9688 143 uint64_t base;
garyservin 0:fd24f7ca9688 144 } u_x;
garyservin 0:fd24f7ca9688 145 u_x.base = 0;
garyservin 0:fd24f7ca9688 146 u_x.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:fd24f7ca9688 147 u_x.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:fd24f7ca9688 148 u_x.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:fd24f7ca9688 149 u_x.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:fd24f7ca9688 150 u_x.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:fd24f7ca9688 151 u_x.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:fd24f7ca9688 152 u_x.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:fd24f7ca9688 153 u_x.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:fd24f7ca9688 154 this->x = u_x.real;
garyservin 0:fd24f7ca9688 155 offset += sizeof(this->x);
garyservin 0:fd24f7ca9688 156 union {
garyservin 0:fd24f7ca9688 157 double real;
garyservin 0:fd24f7ca9688 158 uint64_t base;
garyservin 0:fd24f7ca9688 159 } u_y;
garyservin 0:fd24f7ca9688 160 u_y.base = 0;
garyservin 0:fd24f7ca9688 161 u_y.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:fd24f7ca9688 162 u_y.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:fd24f7ca9688 163 u_y.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:fd24f7ca9688 164 u_y.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:fd24f7ca9688 165 u_y.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:fd24f7ca9688 166 u_y.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:fd24f7ca9688 167 u_y.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:fd24f7ca9688 168 u_y.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:fd24f7ca9688 169 this->y = u_y.real;
garyservin 0:fd24f7ca9688 170 offset += sizeof(this->y);
garyservin 0:fd24f7ca9688 171 union {
garyservin 0:fd24f7ca9688 172 double real;
garyservin 0:fd24f7ca9688 173 uint64_t base;
garyservin 0:fd24f7ca9688 174 } u_width;
garyservin 0:fd24f7ca9688 175 u_width.base = 0;
garyservin 0:fd24f7ca9688 176 u_width.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:fd24f7ca9688 177 u_width.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:fd24f7ca9688 178 u_width.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:fd24f7ca9688 179 u_width.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:fd24f7ca9688 180 u_width.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:fd24f7ca9688 181 u_width.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:fd24f7ca9688 182 u_width.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:fd24f7ca9688 183 u_width.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:fd24f7ca9688 184 this->width = u_width.real;
garyservin 0:fd24f7ca9688 185 offset += sizeof(this->width);
garyservin 0:fd24f7ca9688 186 union {
garyservin 0:fd24f7ca9688 187 double real;
garyservin 0:fd24f7ca9688 188 uint64_t base;
garyservin 0:fd24f7ca9688 189 } u_height;
garyservin 0:fd24f7ca9688 190 u_height.base = 0;
garyservin 0:fd24f7ca9688 191 u_height.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:fd24f7ca9688 192 u_height.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:fd24f7ca9688 193 u_height.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:fd24f7ca9688 194 u_height.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:fd24f7ca9688 195 u_height.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:fd24f7ca9688 196 u_height.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:fd24f7ca9688 197 u_height.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:fd24f7ca9688 198 u_height.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:fd24f7ca9688 199 this->height = u_height.real;
garyservin 0:fd24f7ca9688 200 offset += sizeof(this->height);
garyservin 0:fd24f7ca9688 201 union {
garyservin 0:fd24f7ca9688 202 double real;
garyservin 0:fd24f7ca9688 203 uint64_t base;
garyservin 0:fd24f7ca9688 204 } u_min_z;
garyservin 0:fd24f7ca9688 205 u_min_z.base = 0;
garyservin 0:fd24f7ca9688 206 u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:fd24f7ca9688 207 u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:fd24f7ca9688 208 u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:fd24f7ca9688 209 u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:fd24f7ca9688 210 u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:fd24f7ca9688 211 u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:fd24f7ca9688 212 u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:fd24f7ca9688 213 u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:fd24f7ca9688 214 this->min_z = u_min_z.real;
garyservin 0:fd24f7ca9688 215 offset += sizeof(this->min_z);
garyservin 0:fd24f7ca9688 216 union {
garyservin 0:fd24f7ca9688 217 double real;
garyservin 0:fd24f7ca9688 218 uint64_t base;
garyservin 0:fd24f7ca9688 219 } u_max_z;
garyservin 0:fd24f7ca9688 220 u_max_z.base = 0;
garyservin 0:fd24f7ca9688 221 u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:fd24f7ca9688 222 u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:fd24f7ca9688 223 u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:fd24f7ca9688 224 u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:fd24f7ca9688 225 u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:fd24f7ca9688 226 u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:fd24f7ca9688 227 u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:fd24f7ca9688 228 u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:fd24f7ca9688 229 this->max_z = u_max_z.real;
garyservin 0:fd24f7ca9688 230 offset += sizeof(this->max_z);
garyservin 0:fd24f7ca9688 231 return offset;
garyservin 0:fd24f7ca9688 232 }
garyservin 0:fd24f7ca9688 233
garyservin 0:fd24f7ca9688 234 const char * getType(){ return "map_msgs/ProjectedMapInfo"; };
garyservin 0:fd24f7ca9688 235 const char * getMD5(){ return "2dc10595ae94de23f22f8a6d2a0eef7a"; };
garyservin 0:fd24f7ca9688 236
garyservin 0:fd24f7ca9688 237 };
garyservin 0:fd24f7ca9688 238
garyservin 0:fd24f7ca9688 239 }
garyservin 0:fd24f7ca9688 240 #endif