catchrobo2022 / Mbed 2 deprecated catchrobo2022_mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SetDynamicTF.h Source File

SetDynamicTF.h

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