catchrobo2022 / Mbed 2 deprecated catchrobo2022_mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SimpleHandle.h Source File

SimpleHandle.h

00001 #ifndef _ROS_jsk_recognition_msgs_SimpleHandle_h
00002 #define _ROS_jsk_recognition_msgs_SimpleHandle_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 #include "geometry_msgs/Pose.h"
00010 
00011 namespace jsk_recognition_msgs
00012 {
00013 
00014   class SimpleHandle : public ros::Msg
00015   {
00016     public:
00017       typedef std_msgs::Header _header_type;
00018       _header_type header;
00019       typedef geometry_msgs::Pose _pose_type;
00020       _pose_type pose;
00021       typedef double _handle_width_type;
00022       _handle_width_type handle_width;
00023 
00024     SimpleHandle():
00025       header(),
00026       pose(),
00027       handle_width(0)
00028     {
00029     }
00030 
00031     virtual int serialize(unsigned char *outbuffer) const
00032     {
00033       int offset = 0;
00034       offset += this->header.serialize(outbuffer + offset);
00035       offset += this->pose.serialize(outbuffer + offset);
00036       union {
00037         double real;
00038         uint64_t base;
00039       } u_handle_width;
00040       u_handle_width.real = this->handle_width;
00041       *(outbuffer + offset + 0) = (u_handle_width.base >> (8 * 0)) & 0xFF;
00042       *(outbuffer + offset + 1) = (u_handle_width.base >> (8 * 1)) & 0xFF;
00043       *(outbuffer + offset + 2) = (u_handle_width.base >> (8 * 2)) & 0xFF;
00044       *(outbuffer + offset + 3) = (u_handle_width.base >> (8 * 3)) & 0xFF;
00045       *(outbuffer + offset + 4) = (u_handle_width.base >> (8 * 4)) & 0xFF;
00046       *(outbuffer + offset + 5) = (u_handle_width.base >> (8 * 5)) & 0xFF;
00047       *(outbuffer + offset + 6) = (u_handle_width.base >> (8 * 6)) & 0xFF;
00048       *(outbuffer + offset + 7) = (u_handle_width.base >> (8 * 7)) & 0xFF;
00049       offset += sizeof(this->handle_width);
00050       return offset;
00051     }
00052 
00053     virtual int deserialize(unsigned char *inbuffer)
00054     {
00055       int offset = 0;
00056       offset += this->header.deserialize(inbuffer + offset);
00057       offset += this->pose.deserialize(inbuffer + offset);
00058       union {
00059         double real;
00060         uint64_t base;
00061       } u_handle_width;
00062       u_handle_width.base = 0;
00063       u_handle_width.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00064       u_handle_width.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00065       u_handle_width.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00066       u_handle_width.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00067       u_handle_width.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00068       u_handle_width.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00069       u_handle_width.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00070       u_handle_width.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00071       this->handle_width = u_handle_width.real;
00072       offset += sizeof(this->handle_width);
00073      return offset;
00074     }
00075 
00076     virtual const char * getType(){ return "jsk_recognition_msgs/SimpleHandle"; };
00077     virtual const char * getMD5(){ return "3a87e21f72b9ed7090c46a47617b0740"; };
00078 
00079   };
00080 
00081 }
00082 #endif