This program is porting rosserial_arduino for mbed http://www.ros.org/wiki/rosserial_arduino This program supported the revision of 169 of rosserial.

Dependencies:  

Dependents:   rosserial_mbed robot_S2

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     virtual int serialize(unsigned char *outbuffer) const
00018     {
00019       int offset = 0;
00020       return offset;
00021     }
00022 
00023     virtual int deserialize(unsigned char *inbuffer)
00024     {
00025       int offset = 0;
00026      return offset;
00027     }
00028 
00029     virtual const char * getType(){ return FRAMEGRAPH; };
00030     virtual const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; };
00031 
00032   };
00033 
00034   class FrameGraphResponse : public ros::Msg
00035   {
00036     public:
00037       char * dot_graph;
00038 
00039     virtual int serialize(unsigned char *outbuffer) const
00040     {
00041       int offset = 0;
00042       uint32_t * length_dot_graph = (uint32_t *)(outbuffer + offset);
00043       *length_dot_graph = strlen( (const char*) this->dot_graph);
00044       offset += 4;
00045       memcpy(outbuffer + offset, this->dot_graph, *length_dot_graph);
00046       offset += *length_dot_graph;
00047       return offset;
00048     }
00049 
00050     virtual int deserialize(unsigned char *inbuffer)
00051     {
00052       int offset = 0;
00053       uint32_t length_dot_graph = *(uint32_t *)(inbuffer + offset);
00054       offset += 4;
00055       for(unsigned int k= offset; k< offset+length_dot_graph; ++k){
00056           inbuffer[k-1]=inbuffer[k];
00057       }
00058       inbuffer[offset+length_dot_graph-1]=0;
00059       this->dot_graph = (char *)(inbuffer + offset-1);
00060       offset += length_dot_graph;
00061      return offset;
00062     }
00063 
00064     virtual const char * getType(){ return FRAMEGRAPH; };
00065     virtual const char * getMD5(){ return "c4af9ac907e58e906eb0b6e3c58478c0"; };
00066 
00067   };
00068 
00069   class FrameGraph {
00070     public:
00071     typedef FrameGraphRequest Request;
00072     typedef FrameGraphResponse Response;
00073   };
00074 
00075 }
00076 #endif