catchrobo2022 / Mbed 2 deprecated catchrobo2022_mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PassthroughDuration.h Source File

PassthroughDuration.h

00001 #ifndef _ROS_SERVICE_PassthroughDuration_h
00002 #define _ROS_SERVICE_PassthroughDuration_h
00003 #include <stdint.h>
00004 #include <string.h>
00005 #include <stdlib.h>
00006 #include "ros/msg.h"
00007 #include "ros/duration.h"
00008 
00009 namespace jsk_topic_tools
00010 {
00011 
00012 static const char PASSTHROUGHDURATION[] = "jsk_topic_tools/PassthroughDuration";
00013 
00014   class PassthroughDurationRequest : public ros::Msg
00015   {
00016     public:
00017       typedef ros::Duration _duration_type;
00018       _duration_type duration;
00019 
00020     PassthroughDurationRequest():
00021       duration()
00022     {
00023     }
00024 
00025     virtual int serialize(unsigned char *outbuffer) const
00026     {
00027       int offset = 0;
00028       *(outbuffer + offset + 0) = (this->duration.sec >> (8 * 0)) & 0xFF;
00029       *(outbuffer + offset + 1) = (this->duration.sec >> (8 * 1)) & 0xFF;
00030       *(outbuffer + offset + 2) = (this->duration.sec >> (8 * 2)) & 0xFF;
00031       *(outbuffer + offset + 3) = (this->duration.sec >> (8 * 3)) & 0xFF;
00032       offset += sizeof(this->duration.sec);
00033       *(outbuffer + offset + 0) = (this->duration.nsec >> (8 * 0)) & 0xFF;
00034       *(outbuffer + offset + 1) = (this->duration.nsec >> (8 * 1)) & 0xFF;
00035       *(outbuffer + offset + 2) = (this->duration.nsec >> (8 * 2)) & 0xFF;
00036       *(outbuffer + offset + 3) = (this->duration.nsec >> (8 * 3)) & 0xFF;
00037       offset += sizeof(this->duration.nsec);
00038       return offset;
00039     }
00040 
00041     virtual int deserialize(unsigned char *inbuffer)
00042     {
00043       int offset = 0;
00044       this->duration.sec =  ((uint32_t) (*(inbuffer + offset)));
00045       this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00046       this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00047       this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00048       offset += sizeof(this->duration.sec);
00049       this->duration.nsec =  ((uint32_t) (*(inbuffer + offset)));
00050       this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00051       this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00052       this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00053       offset += sizeof(this->duration.nsec);
00054      return offset;
00055     }
00056 
00057     virtual const char * getType(){ return PASSTHROUGHDURATION; };
00058     virtual const char * getMD5(){ return "2aa5b5d494c682527e9e9161e1fa58ac"; };
00059 
00060   };
00061 
00062   class PassthroughDurationResponse : public ros::Msg
00063   {
00064     public:
00065 
00066     PassthroughDurationResponse()
00067     {
00068     }
00069 
00070     virtual int serialize(unsigned char *outbuffer) const
00071     {
00072       int offset = 0;
00073       return offset;
00074     }
00075 
00076     virtual int deserialize(unsigned char *inbuffer)
00077     {
00078       int offset = 0;
00079      return offset;
00080     }
00081 
00082     virtual const char * getType(){ return PASSTHROUGHDURATION; };
00083     virtual const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; };
00084 
00085   };
00086 
00087   class PassthroughDuration {
00088     public:
00089     typedef PassthroughDurationRequest Request;
00090     typedef PassthroughDurationResponse Response;
00091   };
00092 
00093 }
00094 #endif