catchrobo2022 / Mbed 2 deprecated catchrobo2022_mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BoolStamped.h Source File

BoolStamped.h

00001 #ifndef _ROS_jsk_recognition_msgs_BoolStamped_h
00002 #define _ROS_jsk_recognition_msgs_BoolStamped_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 BoolStamped : public ros::Msg
00014   {
00015     public:
00016       typedef std_msgs::Header _header_type;
00017       _header_type header;
00018       typedef bool _data_type;
00019       _data_type data;
00020 
00021     BoolStamped():
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         bool real;
00033         uint8_t base;
00034       } u_data;
00035       u_data.real = this->data;
00036       *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF;
00037       offset += sizeof(this->data);
00038       return offset;
00039     }
00040 
00041     virtual int deserialize(unsigned char *inbuffer)
00042     {
00043       int offset = 0;
00044       offset += this->header.deserialize(inbuffer + offset);
00045       union {
00046         bool real;
00047         uint8_t base;
00048       } u_data;
00049       u_data.base = 0;
00050       u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00051       this->data = u_data.real;
00052       offset += sizeof(this->data);
00053      return offset;
00054     }
00055 
00056     virtual const char * getType(){ return "jsk_recognition_msgs/BoolStamped"; };
00057     virtual const char * getMD5(){ return "542e22b190dc8e6eb476d50dda88feb7"; };
00058 
00059   };
00060 
00061 }
00062 #endif