ROS Serial library for Mbed platforms for ROS Indigo Igloo. Check http://wiki.ros.org/rosserial_mbed/ for more information

Dependencies:   BufferedSerial

Dependents:   rosserial_mbed_hello_world_publisher rtos_base_control rosserial_mbed_F64MA ROS-RTOS ... more

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       const char* dot_graph;
00042 
00043     FrameGraphResponse():
00044       dot_graph("")
00045     {
00046     }
00047 
00048     virtual int serialize(unsigned char *outbuffer) const
00049     {
00050       int offset = 0;
00051       uint32_t length_dot_graph = strlen(this->dot_graph);
00052       memcpy(outbuffer + offset, &length_dot_graph, sizeof(uint32_t));
00053       offset += 4;
00054       memcpy(outbuffer + offset, this->dot_graph, length_dot_graph);
00055       offset += length_dot_graph;
00056       return offset;
00057     }
00058 
00059     virtual int deserialize(unsigned char *inbuffer)
00060     {
00061       int offset = 0;
00062       uint32_t length_dot_graph;
00063       memcpy(&length_dot_graph, (inbuffer + offset), sizeof(uint32_t));
00064       offset += 4;
00065       for(unsigned int k= offset; k< offset+length_dot_graph; ++k){
00066           inbuffer[k-1]=inbuffer[k];
00067       }
00068       inbuffer[offset+length_dot_graph-1]=0;
00069       this->dot_graph = (char *)(inbuffer + offset-1);
00070       offset += length_dot_graph;
00071      return offset;
00072     }
00073 
00074     const char * getType(){ return FRAMEGRAPH; };
00075     const char * getMD5(){ return "c4af9ac907e58e906eb0b6e3c58478c0"; };
00076 
00077   };
00078 
00079   class FrameGraph {
00080     public:
00081     typedef FrameGraphRequest Request;
00082     typedef FrameGraphResponse Response;
00083   };
00084 
00085 }
00086 #endif