catchrobo2022 / Mbed 2 deprecated catchrobo2022_mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DissocTF.h Source File

DissocTF.h

00001 #ifndef _ROS_SERVICE_DissocTF_h
00002 #define _ROS_SERVICE_DissocTF_h
00003 #include <stdint.h>
00004 #include <string.h>
00005 #include <stdlib.h>
00006 #include "ros/msg.h"
00007 #include "std_msgs/Header.h"
00008 
00009 namespace dynamic_tf_publisher
00010 {
00011 
00012 static const char DISSOCTF[] = "dynamic_tf_publisher/DissocTF";
00013 
00014   class DissocTFRequest : public ros::Msg
00015   {
00016     public:
00017       typedef std_msgs::Header _header_type;
00018       _header_type header;
00019       typedef const char* _frame_id_type;
00020       _frame_id_type frame_id;
00021 
00022     DissocTFRequest():
00023       header(),
00024       frame_id("")
00025     {
00026     }
00027 
00028     virtual int serialize(unsigned char *outbuffer) const
00029     {
00030       int offset = 0;
00031       offset += this->header.serialize(outbuffer + offset);
00032       uint32_t length_frame_id = strlen(this->frame_id);
00033       varToArr(outbuffer + offset, length_frame_id);
00034       offset += 4;
00035       memcpy(outbuffer + offset, this->frame_id, length_frame_id);
00036       offset += length_frame_id;
00037       return offset;
00038     }
00039 
00040     virtual int deserialize(unsigned char *inbuffer)
00041     {
00042       int offset = 0;
00043       offset += this->header.deserialize(inbuffer + offset);
00044       uint32_t length_frame_id;
00045       arrToVar(length_frame_id, (inbuffer + offset));
00046       offset += 4;
00047       for(unsigned int k= offset; k< offset+length_frame_id; ++k){
00048           inbuffer[k-1]=inbuffer[k];
00049       }
00050       inbuffer[offset+length_frame_id-1]=0;
00051       this->frame_id = (char *)(inbuffer + offset-1);
00052       offset += length_frame_id;
00053      return offset;
00054     }
00055 
00056     virtual const char * getType(){ return DISSOCTF; };
00057     virtual const char * getMD5(){ return "5fa93cf9f65be2325fa0008ddcc90131"; };
00058 
00059   };
00060 
00061   class DissocTFResponse : public ros::Msg
00062   {
00063     public:
00064 
00065     DissocTFResponse()
00066     {
00067     }
00068 
00069     virtual int serialize(unsigned char *outbuffer) const
00070     {
00071       int offset = 0;
00072       return offset;
00073     }
00074 
00075     virtual int deserialize(unsigned char *inbuffer)
00076     {
00077       int offset = 0;
00078      return offset;
00079     }
00080 
00081     virtual const char * getType(){ return DISSOCTF; };
00082     virtual const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; };
00083 
00084   };
00085 
00086   class DissocTF {
00087     public:
00088     typedef DissocTFRequest Request;
00089     typedef DissocTFResponse Response;
00090   };
00091 
00092 }
00093 #endif