AveragingFeedback.h
Go to the documentation of this file.
00001 #ifndef _ROS_actionlib_tutorials_AveragingFeedback_h
00002 #define _ROS_actionlib_tutorials_AveragingFeedback_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 
00009 namespace actionlib_tutorials
00010 {
00011 
00012   class AveragingFeedback : public ros::Msg
00013   {
00014     public:
00015       int32_t sample;
00016       float data;
00017       float mean;
00018       float std_dev;
00019 
00020     virtual int serialize(unsigned char *outbuffer) const
00021     {
00022       int offset = 0;
00023       union {
00024         int32_t real;
00025         uint32_t base;
00026       } u_sample;
00027       u_sample.real = this->sample;
00028       *(outbuffer + offset + 0) = (u_sample.base >> (8 * 0)) & 0xFF;
00029       *(outbuffer + offset + 1) = (u_sample.base >> (8 * 1)) & 0xFF;
00030       *(outbuffer + offset + 2) = (u_sample.base >> (8 * 2)) & 0xFF;
00031       *(outbuffer + offset + 3) = (u_sample.base >> (8 * 3)) & 0xFF;
00032       offset += sizeof(this->sample);
00033       union {
00034         float real;
00035         uint32_t base;
00036       } u_data;
00037       u_data.real = this->data;
00038       *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF;
00039       *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF;
00040       *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF;
00041       *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF;
00042       offset += sizeof(this->data);
00043       union {
00044         float real;
00045         uint32_t base;
00046       } u_mean;
00047       u_mean.real = this->mean;
00048       *(outbuffer + offset + 0) = (u_mean.base >> (8 * 0)) & 0xFF;
00049       *(outbuffer + offset + 1) = (u_mean.base >> (8 * 1)) & 0xFF;
00050       *(outbuffer + offset + 2) = (u_mean.base >> (8 * 2)) & 0xFF;
00051       *(outbuffer + offset + 3) = (u_mean.base >> (8 * 3)) & 0xFF;
00052       offset += sizeof(this->mean);
00053       union {
00054         float real;
00055         uint32_t base;
00056       } u_std_dev;
00057       u_std_dev.real = this->std_dev;
00058       *(outbuffer + offset + 0) = (u_std_dev.base >> (8 * 0)) & 0xFF;
00059       *(outbuffer + offset + 1) = (u_std_dev.base >> (8 * 1)) & 0xFF;
00060       *(outbuffer + offset + 2) = (u_std_dev.base >> (8 * 2)) & 0xFF;
00061       *(outbuffer + offset + 3) = (u_std_dev.base >> (8 * 3)) & 0xFF;
00062       offset += sizeof(this->std_dev);
00063       return offset;
00064     }
00065 
00066     virtual int deserialize(unsigned char *inbuffer)
00067     {
00068       int offset = 0;
00069       union {
00070         int32_t real;
00071         uint32_t base;
00072       } u_sample;
00073       u_sample.base = 0;
00074       u_sample.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00075       u_sample.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00076       u_sample.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00077       u_sample.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00078       this->sample = u_sample.real;
00079       offset += sizeof(this->sample);
00080       union {
00081         float real;
00082         uint32_t base;
00083       } u_data;
00084       u_data.base = 0;
00085       u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00086       u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00087       u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00088       u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00089       this->data = u_data.real;
00090       offset += sizeof(this->data);
00091       union {
00092         float real;
00093         uint32_t base;
00094       } u_mean;
00095       u_mean.base = 0;
00096       u_mean.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00097       u_mean.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00098       u_mean.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00099       u_mean.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00100       this->mean = u_mean.real;
00101       offset += sizeof(this->mean);
00102       union {
00103         float real;
00104         uint32_t base;
00105       } u_std_dev;
00106       u_std_dev.base = 0;
00107       u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00108       u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00109       u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00110       u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00111       this->std_dev = u_std_dev.real;
00112       offset += sizeof(this->std_dev);
00113      return offset;
00114     }
00115 
00116     const char * getType(){ return "actionlib_tutorials/AveragingFeedback"; };
00117     const char * getMD5(){ return "9e8dfc53c2f2a032ca33fa80ec46fd4f"; };
00118 
00119   };
00120 
00121 }
00122 #endif


lizi_arduino
Author(s): RoboTiCan
autogenerated on Wed Aug 26 2015 12:24:22