nucho / Mbed 2 deprecated rosserial_mbed

Dependencies:   rosserial_mbed_lib mbed Servo

Committer:
nucho
Date:
Sat Nov 12 23:53:04 2011 +0000
Revision:
3:dff241b66f84
Parent:
0:06fc856e99ca
This program supported the revision of 167 of rosserial.

Who changed what in which revision?

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