capstone_finish

Dependencies:   BufferedSerial motor_sn7544

Committer:
Jeonghoon
Date:
Tue Aug 13 05:53:22 2019 +0000
Revision:
3:2a3664dc6634
with ROS;

Who changed what in which revision?

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