This is a fork from the original, including a small change in the buffer size of the hardware interface (increased to 2048) and decreasing the number of publishers and subscribers to 5. Besides, the library about the message Adc.h was modified so as to increase the number of available Adc channels to be read ( from 6 to 7 ) For this modification, a change in checksum was required

Dependencies:   BufferedSerial

Fork of ros_lib_kinetic by Gary Servin

Committer:
jacobepfl1692
Date:
Tue Oct 17 18:49:03 2017 +0000
Revision:
2:9114cc24ddcf
Parent:
0:9e9b7db60fd5
I increased the channels of the ADC to 6 (hence change in checksum) because my application needed it (STM32f407V6)

Who changed what in which revision?

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