It has only one change from original one. I added robotfeedback message on it.
Dependents: RobotFeedback mobileRobotITU
Fork of ros_lib_indigo by
sensor_msgs/RegionOfInterest.h@4:80d9bee5079a, 2017-03-04 (annotated)
- Committer:
- randalthor
- Date:
- Sat Mar 04 14:07:56 2017 +0000
- Revision:
- 4:80d9bee5079a
- Parent:
- 0:fd24f7ca9688
fatih
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
garyservin | 0:fd24f7ca9688 | 1 | #ifndef _ROS_sensor_msgs_RegionOfInterest_h |
garyservin | 0:fd24f7ca9688 | 2 | #define _ROS_sensor_msgs_RegionOfInterest_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 sensor_msgs |
garyservin | 0:fd24f7ca9688 | 10 | { |
garyservin | 0:fd24f7ca9688 | 11 | |
garyservin | 0:fd24f7ca9688 | 12 | class RegionOfInterest : public ros::Msg |
garyservin | 0:fd24f7ca9688 | 13 | { |
garyservin | 0:fd24f7ca9688 | 14 | public: |
garyservin | 0:fd24f7ca9688 | 15 | uint32_t x_offset; |
garyservin | 0:fd24f7ca9688 | 16 | uint32_t y_offset; |
garyservin | 0:fd24f7ca9688 | 17 | uint32_t height; |
garyservin | 0:fd24f7ca9688 | 18 | uint32_t width; |
garyservin | 0:fd24f7ca9688 | 19 | bool do_rectify; |
garyservin | 0:fd24f7ca9688 | 20 | |
garyservin | 0:fd24f7ca9688 | 21 | RegionOfInterest(): |
garyservin | 0:fd24f7ca9688 | 22 | x_offset(0), |
garyservin | 0:fd24f7ca9688 | 23 | y_offset(0), |
garyservin | 0:fd24f7ca9688 | 24 | height(0), |
garyservin | 0:fd24f7ca9688 | 25 | width(0), |
garyservin | 0:fd24f7ca9688 | 26 | do_rectify(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 | *(outbuffer + offset + 0) = (this->x_offset >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 34 | *(outbuffer + offset + 1) = (this->x_offset >> (8 * 1)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 35 | *(outbuffer + offset + 2) = (this->x_offset >> (8 * 2)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 36 | *(outbuffer + offset + 3) = (this->x_offset >> (8 * 3)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 37 | offset += sizeof(this->x_offset); |
garyservin | 0:fd24f7ca9688 | 38 | *(outbuffer + offset + 0) = (this->y_offset >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 39 | *(outbuffer + offset + 1) = (this->y_offset >> (8 * 1)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 40 | *(outbuffer + offset + 2) = (this->y_offset >> (8 * 2)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 41 | *(outbuffer + offset + 3) = (this->y_offset >> (8 * 3)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 42 | offset += sizeof(this->y_offset); |
garyservin | 0:fd24f7ca9688 | 43 | *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 44 | *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 45 | *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 46 | *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 47 | offset += sizeof(this->height); |
garyservin | 0:fd24f7ca9688 | 48 | *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 49 | *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 50 | *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 51 | *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 52 | offset += sizeof(this->width); |
garyservin | 0:fd24f7ca9688 | 53 | union { |
garyservin | 0:fd24f7ca9688 | 54 | bool real; |
garyservin | 0:fd24f7ca9688 | 55 | uint8_t base; |
garyservin | 0:fd24f7ca9688 | 56 | } u_do_rectify; |
garyservin | 0:fd24f7ca9688 | 57 | u_do_rectify.real = this->do_rectify; |
garyservin | 0:fd24f7ca9688 | 58 | *(outbuffer + offset + 0) = (u_do_rectify.base >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 59 | offset += sizeof(this->do_rectify); |
garyservin | 0:fd24f7ca9688 | 60 | return offset; |
garyservin | 0:fd24f7ca9688 | 61 | } |
garyservin | 0:fd24f7ca9688 | 62 | |
garyservin | 0:fd24f7ca9688 | 63 | virtual int deserialize(unsigned char *inbuffer) |
garyservin | 0:fd24f7ca9688 | 64 | { |
garyservin | 0:fd24f7ca9688 | 65 | int offset = 0; |
garyservin | 0:fd24f7ca9688 | 66 | this->x_offset = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:fd24f7ca9688 | 67 | this->x_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:fd24f7ca9688 | 68 | this->x_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:fd24f7ca9688 | 69 | this->x_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:fd24f7ca9688 | 70 | offset += sizeof(this->x_offset); |
garyservin | 0:fd24f7ca9688 | 71 | this->y_offset = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:fd24f7ca9688 | 72 | this->y_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:fd24f7ca9688 | 73 | this->y_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:fd24f7ca9688 | 74 | this->y_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:fd24f7ca9688 | 75 | offset += sizeof(this->y_offset); |
garyservin | 0:fd24f7ca9688 | 76 | this->height = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:fd24f7ca9688 | 77 | this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:fd24f7ca9688 | 78 | this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:fd24f7ca9688 | 79 | this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:fd24f7ca9688 | 80 | offset += sizeof(this->height); |
garyservin | 0:fd24f7ca9688 | 81 | this->width = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:fd24f7ca9688 | 82 | this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:fd24f7ca9688 | 83 | this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:fd24f7ca9688 | 84 | this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:fd24f7ca9688 | 85 | offset += sizeof(this->width); |
garyservin | 0:fd24f7ca9688 | 86 | union { |
garyservin | 0:fd24f7ca9688 | 87 | bool real; |
garyservin | 0:fd24f7ca9688 | 88 | uint8_t base; |
garyservin | 0:fd24f7ca9688 | 89 | } u_do_rectify; |
garyservin | 0:fd24f7ca9688 | 90 | u_do_rectify.base = 0; |
garyservin | 0:fd24f7ca9688 | 91 | u_do_rectify.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
garyservin | 0:fd24f7ca9688 | 92 | this->do_rectify = u_do_rectify.real; |
garyservin | 0:fd24f7ca9688 | 93 | offset += sizeof(this->do_rectify); |
garyservin | 0:fd24f7ca9688 | 94 | return offset; |
garyservin | 0:fd24f7ca9688 | 95 | } |
garyservin | 0:fd24f7ca9688 | 96 | |
garyservin | 0:fd24f7ca9688 | 97 | const char * getType(){ return "sensor_msgs/RegionOfInterest"; }; |
garyservin | 0:fd24f7ca9688 | 98 | const char * getMD5(){ return "bdb633039d588fcccb441a4d43ccfe09"; }; |
garyservin | 0:fd24f7ca9688 | 99 | |
garyservin | 0:fd24f7ca9688 | 100 | }; |
garyservin | 0:fd24f7ca9688 | 101 | |
garyservin | 0:fd24f7ca9688 | 102 | } |
garyservin | 0:fd24f7ca9688 | 103 | #endif |