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:
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_SERVICE_GetMapROI_h
garyservin 0:fd24f7ca9688 2 #define _ROS_SERVICE_GetMapROI_h
garyservin 0:fd24f7ca9688 3 #include <stdint.h>
garyservin 0:fd24f7ca9688 4 #include <string.h>
garyservin 0:fd24f7ca9688 5 #include <stdlib.h>
garyservin 0:fd24f7ca9688 6 #include "ros/msg.h"
garyservin 0:fd24f7ca9688 7 #include "nav_msgs/OccupancyGrid.h"
garyservin 0:fd24f7ca9688 8
garyservin 0:fd24f7ca9688 9 namespace map_msgs
garyservin 0:fd24f7ca9688 10 {
garyservin 0:fd24f7ca9688 11
garyservin 0:fd24f7ca9688 12 static const char GETMAPROI[] = "map_msgs/GetMapROI";
garyservin 0:fd24f7ca9688 13
garyservin 0:fd24f7ca9688 14 class GetMapROIRequest : public ros::Msg
garyservin 0:fd24f7ca9688 15 {
garyservin 0:fd24f7ca9688 16 public:
garyservin 0:fd24f7ca9688 17 double x;
garyservin 0:fd24f7ca9688 18 double y;
garyservin 0:fd24f7ca9688 19 double l_x;
garyservin 0:fd24f7ca9688 20 double l_y;
garyservin 0:fd24f7ca9688 21
garyservin 0:fd24f7ca9688 22 GetMapROIRequest():
garyservin 0:fd24f7ca9688 23 x(0),
garyservin 0:fd24f7ca9688 24 y(0),
garyservin 0:fd24f7ca9688 25 l_x(0),
garyservin 0:fd24f7ca9688 26 l_y(0)
garyservin 0:fd24f7ca9688 27 {
garyservin 0:fd24f7ca9688 28 }
garyservin 0:fd24f7ca9688 29
garyservin 0:fd24f7ca9688 30 virtual int serialize(unsigned char *outbuffer) const
garyservin 0:fd24f7ca9688 31 {
garyservin 0:fd24f7ca9688 32 int offset = 0;
garyservin 0:fd24f7ca9688 33 union {
garyservin 0:fd24f7ca9688 34 double real;
garyservin 0:fd24f7ca9688 35 uint64_t base;
garyservin 0:fd24f7ca9688 36 } u_x;
garyservin 0:fd24f7ca9688 37 u_x.real = this->x;
garyservin 0:fd24f7ca9688 38 *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF;
garyservin 0:fd24f7ca9688 39 *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF;
garyservin 0:fd24f7ca9688 40 *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF;
garyservin 0:fd24f7ca9688 41 *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF;
garyservin 0:fd24f7ca9688 42 *(outbuffer + offset + 4) = (u_x.base >> (8 * 4)) & 0xFF;
garyservin 0:fd24f7ca9688 43 *(outbuffer + offset + 5) = (u_x.base >> (8 * 5)) & 0xFF;
garyservin 0:fd24f7ca9688 44 *(outbuffer + offset + 6) = (u_x.base >> (8 * 6)) & 0xFF;
garyservin 0:fd24f7ca9688 45 *(outbuffer + offset + 7) = (u_x.base >> (8 * 7)) & 0xFF;
garyservin 0:fd24f7ca9688 46 offset += sizeof(this->x);
garyservin 0:fd24f7ca9688 47 union {
garyservin 0:fd24f7ca9688 48 double real;
garyservin 0:fd24f7ca9688 49 uint64_t base;
garyservin 0:fd24f7ca9688 50 } u_y;
garyservin 0:fd24f7ca9688 51 u_y.real = this->y;
garyservin 0:fd24f7ca9688 52 *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF;
garyservin 0:fd24f7ca9688 53 *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF;
garyservin 0:fd24f7ca9688 54 *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF;
garyservin 0:fd24f7ca9688 55 *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF;
garyservin 0:fd24f7ca9688 56 *(outbuffer + offset + 4) = (u_y.base >> (8 * 4)) & 0xFF;
garyservin 0:fd24f7ca9688 57 *(outbuffer + offset + 5) = (u_y.base >> (8 * 5)) & 0xFF;
garyservin 0:fd24f7ca9688 58 *(outbuffer + offset + 6) = (u_y.base >> (8 * 6)) & 0xFF;
garyservin 0:fd24f7ca9688 59 *(outbuffer + offset + 7) = (u_y.base >> (8 * 7)) & 0xFF;
garyservin 0:fd24f7ca9688 60 offset += sizeof(this->y);
garyservin 0:fd24f7ca9688 61 union {
garyservin 0:fd24f7ca9688 62 double real;
garyservin 0:fd24f7ca9688 63 uint64_t base;
garyservin 0:fd24f7ca9688 64 } u_l_x;
garyservin 0:fd24f7ca9688 65 u_l_x.real = this->l_x;
garyservin 0:fd24f7ca9688 66 *(outbuffer + offset + 0) = (u_l_x.base >> (8 * 0)) & 0xFF;
garyservin 0:fd24f7ca9688 67 *(outbuffer + offset + 1) = (u_l_x.base >> (8 * 1)) & 0xFF;
garyservin 0:fd24f7ca9688 68 *(outbuffer + offset + 2) = (u_l_x.base >> (8 * 2)) & 0xFF;
garyservin 0:fd24f7ca9688 69 *(outbuffer + offset + 3) = (u_l_x.base >> (8 * 3)) & 0xFF;
garyservin 0:fd24f7ca9688 70 *(outbuffer + offset + 4) = (u_l_x.base >> (8 * 4)) & 0xFF;
garyservin 0:fd24f7ca9688 71 *(outbuffer + offset + 5) = (u_l_x.base >> (8 * 5)) & 0xFF;
garyservin 0:fd24f7ca9688 72 *(outbuffer + offset + 6) = (u_l_x.base >> (8 * 6)) & 0xFF;
garyservin 0:fd24f7ca9688 73 *(outbuffer + offset + 7) = (u_l_x.base >> (8 * 7)) & 0xFF;
garyservin 0:fd24f7ca9688 74 offset += sizeof(this->l_x);
garyservin 0:fd24f7ca9688 75 union {
garyservin 0:fd24f7ca9688 76 double real;
garyservin 0:fd24f7ca9688 77 uint64_t base;
garyservin 0:fd24f7ca9688 78 } u_l_y;
garyservin 0:fd24f7ca9688 79 u_l_y.real = this->l_y;
garyservin 0:fd24f7ca9688 80 *(outbuffer + offset + 0) = (u_l_y.base >> (8 * 0)) & 0xFF;
garyservin 0:fd24f7ca9688 81 *(outbuffer + offset + 1) = (u_l_y.base >> (8 * 1)) & 0xFF;
garyservin 0:fd24f7ca9688 82 *(outbuffer + offset + 2) = (u_l_y.base >> (8 * 2)) & 0xFF;
garyservin 0:fd24f7ca9688 83 *(outbuffer + offset + 3) = (u_l_y.base >> (8 * 3)) & 0xFF;
garyservin 0:fd24f7ca9688 84 *(outbuffer + offset + 4) = (u_l_y.base >> (8 * 4)) & 0xFF;
garyservin 0:fd24f7ca9688 85 *(outbuffer + offset + 5) = (u_l_y.base >> (8 * 5)) & 0xFF;
garyservin 0:fd24f7ca9688 86 *(outbuffer + offset + 6) = (u_l_y.base >> (8 * 6)) & 0xFF;
garyservin 0:fd24f7ca9688 87 *(outbuffer + offset + 7) = (u_l_y.base >> (8 * 7)) & 0xFF;
garyservin 0:fd24f7ca9688 88 offset += sizeof(this->l_y);
garyservin 0:fd24f7ca9688 89 return offset;
garyservin 0:fd24f7ca9688 90 }
garyservin 0:fd24f7ca9688 91
garyservin 0:fd24f7ca9688 92 virtual int deserialize(unsigned char *inbuffer)
garyservin 0:fd24f7ca9688 93 {
garyservin 0:fd24f7ca9688 94 int offset = 0;
garyservin 0:fd24f7ca9688 95 union {
garyservin 0:fd24f7ca9688 96 double real;
garyservin 0:fd24f7ca9688 97 uint64_t base;
garyservin 0:fd24f7ca9688 98 } u_x;
garyservin 0:fd24f7ca9688 99 u_x.base = 0;
garyservin 0:fd24f7ca9688 100 u_x.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:fd24f7ca9688 101 u_x.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:fd24f7ca9688 102 u_x.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:fd24f7ca9688 103 u_x.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:fd24f7ca9688 104 u_x.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:fd24f7ca9688 105 u_x.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:fd24f7ca9688 106 u_x.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:fd24f7ca9688 107 u_x.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:fd24f7ca9688 108 this->x = u_x.real;
garyservin 0:fd24f7ca9688 109 offset += sizeof(this->x);
garyservin 0:fd24f7ca9688 110 union {
garyservin 0:fd24f7ca9688 111 double real;
garyservin 0:fd24f7ca9688 112 uint64_t base;
garyservin 0:fd24f7ca9688 113 } u_y;
garyservin 0:fd24f7ca9688 114 u_y.base = 0;
garyservin 0:fd24f7ca9688 115 u_y.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:fd24f7ca9688 116 u_y.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:fd24f7ca9688 117 u_y.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:fd24f7ca9688 118 u_y.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:fd24f7ca9688 119 u_y.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:fd24f7ca9688 120 u_y.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:fd24f7ca9688 121 u_y.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:fd24f7ca9688 122 u_y.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:fd24f7ca9688 123 this->y = u_y.real;
garyservin 0:fd24f7ca9688 124 offset += sizeof(this->y);
garyservin 0:fd24f7ca9688 125 union {
garyservin 0:fd24f7ca9688 126 double real;
garyservin 0:fd24f7ca9688 127 uint64_t base;
garyservin 0:fd24f7ca9688 128 } u_l_x;
garyservin 0:fd24f7ca9688 129 u_l_x.base = 0;
garyservin 0:fd24f7ca9688 130 u_l_x.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:fd24f7ca9688 131 u_l_x.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:fd24f7ca9688 132 u_l_x.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:fd24f7ca9688 133 u_l_x.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:fd24f7ca9688 134 u_l_x.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:fd24f7ca9688 135 u_l_x.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:fd24f7ca9688 136 u_l_x.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:fd24f7ca9688 137 u_l_x.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:fd24f7ca9688 138 this->l_x = u_l_x.real;
garyservin 0:fd24f7ca9688 139 offset += sizeof(this->l_x);
garyservin 0:fd24f7ca9688 140 union {
garyservin 0:fd24f7ca9688 141 double real;
garyservin 0:fd24f7ca9688 142 uint64_t base;
garyservin 0:fd24f7ca9688 143 } u_l_y;
garyservin 0:fd24f7ca9688 144 u_l_y.base = 0;
garyservin 0:fd24f7ca9688 145 u_l_y.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:fd24f7ca9688 146 u_l_y.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:fd24f7ca9688 147 u_l_y.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:fd24f7ca9688 148 u_l_y.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:fd24f7ca9688 149 u_l_y.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:fd24f7ca9688 150 u_l_y.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:fd24f7ca9688 151 u_l_y.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:fd24f7ca9688 152 u_l_y.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:fd24f7ca9688 153 this->l_y = u_l_y.real;
garyservin 0:fd24f7ca9688 154 offset += sizeof(this->l_y);
garyservin 0:fd24f7ca9688 155 return offset;
garyservin 0:fd24f7ca9688 156 }
garyservin 0:fd24f7ca9688 157
garyservin 0:fd24f7ca9688 158 const char * getType(){ return GETMAPROI; };
garyservin 0:fd24f7ca9688 159 const char * getMD5(){ return "43c2ff8f45af555c0eaf070c401e9a47"; };
garyservin 0:fd24f7ca9688 160
garyservin 0:fd24f7ca9688 161 };
garyservin 0:fd24f7ca9688 162
garyservin 0:fd24f7ca9688 163 class GetMapROIResponse : public ros::Msg
garyservin 0:fd24f7ca9688 164 {
garyservin 0:fd24f7ca9688 165 public:
garyservin 0:fd24f7ca9688 166 nav_msgs::OccupancyGrid sub_map;
garyservin 0:fd24f7ca9688 167
garyservin 0:fd24f7ca9688 168 GetMapROIResponse():
garyservin 0:fd24f7ca9688 169 sub_map()
garyservin 0:fd24f7ca9688 170 {
garyservin 0:fd24f7ca9688 171 }
garyservin 0:fd24f7ca9688 172
garyservin 0:fd24f7ca9688 173 virtual int serialize(unsigned char *outbuffer) const
garyservin 0:fd24f7ca9688 174 {
garyservin 0:fd24f7ca9688 175 int offset = 0;
garyservin 0:fd24f7ca9688 176 offset += this->sub_map.serialize(outbuffer + offset);
garyservin 0:fd24f7ca9688 177 return offset;
garyservin 0:fd24f7ca9688 178 }
garyservin 0:fd24f7ca9688 179
garyservin 0:fd24f7ca9688 180 virtual int deserialize(unsigned char *inbuffer)
garyservin 0:fd24f7ca9688 181 {
garyservin 0:fd24f7ca9688 182 int offset = 0;
garyservin 0:fd24f7ca9688 183 offset += this->sub_map.deserialize(inbuffer + offset);
garyservin 0:fd24f7ca9688 184 return offset;
garyservin 0:fd24f7ca9688 185 }
garyservin 0:fd24f7ca9688 186
garyservin 0:fd24f7ca9688 187 const char * getType(){ return GETMAPROI; };
garyservin 0:fd24f7ca9688 188 const char * getMD5(){ return "4d1986519c00d81967d2891a606b234c"; };
garyservin 0:fd24f7ca9688 189
garyservin 0:fd24f7ca9688 190 };
garyservin 0:fd24f7ca9688 191
garyservin 0:fd24f7ca9688 192 class GetMapROI {
garyservin 0:fd24f7ca9688 193 public:
garyservin 0:fd24f7ca9688 194 typedef GetMapROIRequest Request;
garyservin 0:fd24f7ca9688 195 typedef GetMapROIResponse Response;
garyservin 0:fd24f7ca9688 196 };
garyservin 0:fd24f7ca9688 197
garyservin 0:fd24f7ca9688 198 }
garyservin 0:fd24f7ca9688 199 #endif