Go to the documentation of this file.00001 #ifndef _ROS_lizi_lizi_raw_h
00002 #define _ROS_lizi_lizi_raw_h
00003
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008
00009 namespace lizi
00010 {
00011
00012 class lizi_raw : public ros::Msg
00013 {
00014 public:
00015 float qw;
00016 float qx;
00017 float qy;
00018 float qz;
00019 int32_t left_ticks;
00020 int32_t right_ticks;
00021 float left_urf;
00022 float rear_urf;
00023 float right_urf;
00024
00025 virtual int serialize(unsigned char *outbuffer) const
00026 {
00027 int offset = 0;
00028 union {
00029 float real;
00030 uint32_t base;
00031 } u_qw;
00032 u_qw.real = this->qw;
00033 *(outbuffer + offset + 0) = (u_qw.base >> (8 * 0)) & 0xFF;
00034 *(outbuffer + offset + 1) = (u_qw.base >> (8 * 1)) & 0xFF;
00035 *(outbuffer + offset + 2) = (u_qw.base >> (8 * 2)) & 0xFF;
00036 *(outbuffer + offset + 3) = (u_qw.base >> (8 * 3)) & 0xFF;
00037 offset += sizeof(this->qw);
00038 union {
00039 float real;
00040 uint32_t base;
00041 } u_qx;
00042 u_qx.real = this->qx;
00043 *(outbuffer + offset + 0) = (u_qx.base >> (8 * 0)) & 0xFF;
00044 *(outbuffer + offset + 1) = (u_qx.base >> (8 * 1)) & 0xFF;
00045 *(outbuffer + offset + 2) = (u_qx.base >> (8 * 2)) & 0xFF;
00046 *(outbuffer + offset + 3) = (u_qx.base >> (8 * 3)) & 0xFF;
00047 offset += sizeof(this->qx);
00048 union {
00049 float real;
00050 uint32_t base;
00051 } u_qy;
00052 u_qy.real = this->qy;
00053 *(outbuffer + offset + 0) = (u_qy.base >> (8 * 0)) & 0xFF;
00054 *(outbuffer + offset + 1) = (u_qy.base >> (8 * 1)) & 0xFF;
00055 *(outbuffer + offset + 2) = (u_qy.base >> (8 * 2)) & 0xFF;
00056 *(outbuffer + offset + 3) = (u_qy.base >> (8 * 3)) & 0xFF;
00057 offset += sizeof(this->qy);
00058 union {
00059 float real;
00060 uint32_t base;
00061 } u_qz;
00062 u_qz.real = this->qz;
00063 *(outbuffer + offset + 0) = (u_qz.base >> (8 * 0)) & 0xFF;
00064 *(outbuffer + offset + 1) = (u_qz.base >> (8 * 1)) & 0xFF;
00065 *(outbuffer + offset + 2) = (u_qz.base >> (8 * 2)) & 0xFF;
00066 *(outbuffer + offset + 3) = (u_qz.base >> (8 * 3)) & 0xFF;
00067 offset += sizeof(this->qz);
00068 union {
00069 int32_t real;
00070 uint32_t base;
00071 } u_left_ticks;
00072 u_left_ticks.real = this->left_ticks;
00073 *(outbuffer + offset + 0) = (u_left_ticks.base >> (8 * 0)) & 0xFF;
00074 *(outbuffer + offset + 1) = (u_left_ticks.base >> (8 * 1)) & 0xFF;
00075 *(outbuffer + offset + 2) = (u_left_ticks.base >> (8 * 2)) & 0xFF;
00076 *(outbuffer + offset + 3) = (u_left_ticks.base >> (8 * 3)) & 0xFF;
00077 offset += sizeof(this->left_ticks);
00078 union {
00079 int32_t real;
00080 uint32_t base;
00081 } u_right_ticks;
00082 u_right_ticks.real = this->right_ticks;
00083 *(outbuffer + offset + 0) = (u_right_ticks.base >> (8 * 0)) & 0xFF;
00084 *(outbuffer + offset + 1) = (u_right_ticks.base >> (8 * 1)) & 0xFF;
00085 *(outbuffer + offset + 2) = (u_right_ticks.base >> (8 * 2)) & 0xFF;
00086 *(outbuffer + offset + 3) = (u_right_ticks.base >> (8 * 3)) & 0xFF;
00087 offset += sizeof(this->right_ticks);
00088 union {
00089 float real;
00090 uint32_t base;
00091 } u_left_urf;
00092 u_left_urf.real = this->left_urf;
00093 *(outbuffer + offset + 0) = (u_left_urf.base >> (8 * 0)) & 0xFF;
00094 *(outbuffer + offset + 1) = (u_left_urf.base >> (8 * 1)) & 0xFF;
00095 *(outbuffer + offset + 2) = (u_left_urf.base >> (8 * 2)) & 0xFF;
00096 *(outbuffer + offset + 3) = (u_left_urf.base >> (8 * 3)) & 0xFF;
00097 offset += sizeof(this->left_urf);
00098 union {
00099 float real;
00100 uint32_t base;
00101 } u_rear_urf;
00102 u_rear_urf.real = this->rear_urf;
00103 *(outbuffer + offset + 0) = (u_rear_urf.base >> (8 * 0)) & 0xFF;
00104 *(outbuffer + offset + 1) = (u_rear_urf.base >> (8 * 1)) & 0xFF;
00105 *(outbuffer + offset + 2) = (u_rear_urf.base >> (8 * 2)) & 0xFF;
00106 *(outbuffer + offset + 3) = (u_rear_urf.base >> (8 * 3)) & 0xFF;
00107 offset += sizeof(this->rear_urf);
00108 union {
00109 float real;
00110 uint32_t base;
00111 } u_right_urf;
00112 u_right_urf.real = this->right_urf;
00113 *(outbuffer + offset + 0) = (u_right_urf.base >> (8 * 0)) & 0xFF;
00114 *(outbuffer + offset + 1) = (u_right_urf.base >> (8 * 1)) & 0xFF;
00115 *(outbuffer + offset + 2) = (u_right_urf.base >> (8 * 2)) & 0xFF;
00116 *(outbuffer + offset + 3) = (u_right_urf.base >> (8 * 3)) & 0xFF;
00117 offset += sizeof(this->right_urf);
00118 return offset;
00119 }
00120
00121 virtual int deserialize(unsigned char *inbuffer)
00122 {
00123 int offset = 0;
00124 union {
00125 float real;
00126 uint32_t base;
00127 } u_qw;
00128 u_qw.base = 0;
00129 u_qw.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00130 u_qw.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00131 u_qw.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00132 u_qw.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00133 this->qw = u_qw.real;
00134 offset += sizeof(this->qw);
00135 union {
00136 float real;
00137 uint32_t base;
00138 } u_qx;
00139 u_qx.base = 0;
00140 u_qx.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00141 u_qx.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00142 u_qx.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00143 u_qx.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00144 this->qx = u_qx.real;
00145 offset += sizeof(this->qx);
00146 union {
00147 float real;
00148 uint32_t base;
00149 } u_qy;
00150 u_qy.base = 0;
00151 u_qy.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00152 u_qy.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00153 u_qy.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00154 u_qy.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00155 this->qy = u_qy.real;
00156 offset += sizeof(this->qy);
00157 union {
00158 float real;
00159 uint32_t base;
00160 } u_qz;
00161 u_qz.base = 0;
00162 u_qz.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00163 u_qz.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00164 u_qz.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00165 u_qz.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00166 this->qz = u_qz.real;
00167 offset += sizeof(this->qz);
00168 union {
00169 int32_t real;
00170 uint32_t base;
00171 } u_left_ticks;
00172 u_left_ticks.base = 0;
00173 u_left_ticks.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00174 u_left_ticks.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00175 u_left_ticks.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00176 u_left_ticks.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00177 this->left_ticks = u_left_ticks.real;
00178 offset += sizeof(this->left_ticks);
00179 union {
00180 int32_t real;
00181 uint32_t base;
00182 } u_right_ticks;
00183 u_right_ticks.base = 0;
00184 u_right_ticks.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00185 u_right_ticks.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00186 u_right_ticks.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00187 u_right_ticks.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00188 this->right_ticks = u_right_ticks.real;
00189 offset += sizeof(this->right_ticks);
00190 union {
00191 float real;
00192 uint32_t base;
00193 } u_left_urf;
00194 u_left_urf.base = 0;
00195 u_left_urf.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00196 u_left_urf.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00197 u_left_urf.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00198 u_left_urf.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00199 this->left_urf = u_left_urf.real;
00200 offset += sizeof(this->left_urf);
00201 union {
00202 float real;
00203 uint32_t base;
00204 } u_rear_urf;
00205 u_rear_urf.base = 0;
00206 u_rear_urf.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00207 u_rear_urf.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00208 u_rear_urf.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00209 u_rear_urf.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00210 this->rear_urf = u_rear_urf.real;
00211 offset += sizeof(this->rear_urf);
00212 union {
00213 float real;
00214 uint32_t base;
00215 } u_right_urf;
00216 u_right_urf.base = 0;
00217 u_right_urf.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00218 u_right_urf.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00219 u_right_urf.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00220 u_right_urf.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00221 this->right_urf = u_right_urf.real;
00222 offset += sizeof(this->right_urf);
00223 return offset;
00224 }
00225
00226 const char * getType(){ return "lizi/lizi_raw"; };
00227 const char * getMD5(){ return "d3fede5537f79f19050f2e81db4deb6d"; };
00228
00229 };
00230
00231 }
00232 #endif