catchrobo2022 / Mbed 2 deprecated catchrobo2022_mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Int32Stamped.h Source File

Int32Stamped.h

00001 #ifndef _ROS_jsk_recognition_msgs_Int32Stamped_h
00002 #define _ROS_jsk_recognition_msgs_Int32Stamped_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "std_msgs/Header.h"
00009 
00010 namespace jsk_recognition_msgs
00011 {
00012 
00013   class Int32Stamped : public ros::Msg
00014   {
00015     public:
00016       typedef std_msgs::Header _header_type;
00017       _header_type header;
00018       typedef int32_t _data_type;
00019       _data_type data;
00020 
00021     Int32Stamped():
00022       header(),
00023       data(0)
00024     {
00025     }
00026 
00027     virtual int serialize(unsigned char *outbuffer) const
00028     {
00029       int offset = 0;
00030       offset += this->header.serialize(outbuffer + offset);
00031       union {
00032         int32_t real;
00033         uint32_t base;
00034       } u_data;
00035       u_data.real = this->data;
00036       *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF;
00037       *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF;
00038       *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF;
00039       *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF;
00040       offset += sizeof(this->data);
00041       return offset;
00042     }
00043 
00044     virtual int deserialize(unsigned char *inbuffer)
00045     {
00046       int offset = 0;
00047       offset += this->header.deserialize(inbuffer + offset);
00048       union {
00049         int32_t real;
00050         uint32_t base;
00051       } u_data;
00052       u_data.base = 0;
00053       u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00054       u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00055       u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00056       u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00057       this->data = u_data.real;
00058       offset += sizeof(this->data);
00059      return offset;
00060     }
00061 
00062     virtual const char * getType(){ return "jsk_recognition_msgs/Int32Stamped"; };
00063     virtual const char * getMD5(){ return "e7344a45486eefa24d2f337265df37ce"; };
00064 
00065   };
00066 
00067 }
00068 #endif