Just changed OUTPUT_SIZE and INPUT_SIZE in ros/node_handle.h

Dependencies:   BufferedSerial

Dependents:   WRS2020_mecanum_node

Committer:
sgrsn
Date:
Mon Nov 02 09:00:01 2020 +0000
Revision:
2:5d429be7d0aa
Parent:
0:04ac6be8229a
Change INPUT_SIZE and OUTPUT_SIZE on node_handle.h to pub sub

Who changed what in which revision?

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