Working towards recieving twists

Dependencies:   BufferedSerial

Fork of ros_lib_kinetic by Gary Servin

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers FrameGraph.h Source File

FrameGraph.h

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