Go to the documentation of this file.00001 #ifndef _ROS_rosabridge_msgs_OdometryCovariances_h
00002 #define _ROS_rosabridge_msgs_OdometryCovariances_h
00003
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008
00009 namespace rosabridge_msgs
00010 {
00011
00012 class OdometryCovariances : public ros::Msg
00013 {
00014 public:
00015 float pose_covariance[36];
00016 float twist_covariance[36];
00017
00018 virtual int serialize(unsigned char *outbuffer) const
00019 {
00020 int offset = 0;
00021 for( uint8_t i = 0; i < 36; i++){
00022 union {
00023 float real;
00024 uint32_t base;
00025 } u_pose_covariancei;
00026 u_pose_covariancei.real = this->pose_covariance[i];
00027 *(outbuffer + offset + 0) = (u_pose_covariancei.base >> (8 * 0)) & 0xFF;
00028 *(outbuffer + offset + 1) = (u_pose_covariancei.base >> (8 * 1)) & 0xFF;
00029 *(outbuffer + offset + 2) = (u_pose_covariancei.base >> (8 * 2)) & 0xFF;
00030 *(outbuffer + offset + 3) = (u_pose_covariancei.base >> (8 * 3)) & 0xFF;
00031 offset += sizeof(this->pose_covariance[i]);
00032 }
00033 for( uint8_t i = 0; i < 36; i++){
00034 union {
00035 float real;
00036 uint32_t base;
00037 } u_twist_covariancei;
00038 u_twist_covariancei.real = this->twist_covariance[i];
00039 *(outbuffer + offset + 0) = (u_twist_covariancei.base >> (8 * 0)) & 0xFF;
00040 *(outbuffer + offset + 1) = (u_twist_covariancei.base >> (8 * 1)) & 0xFF;
00041 *(outbuffer + offset + 2) = (u_twist_covariancei.base >> (8 * 2)) & 0xFF;
00042 *(outbuffer + offset + 3) = (u_twist_covariancei.base >> (8 * 3)) & 0xFF;
00043 offset += sizeof(this->twist_covariance[i]);
00044 }
00045 return offset;
00046 }
00047
00048 virtual int deserialize(unsigned char *inbuffer)
00049 {
00050 int offset = 0;
00051 for( uint8_t i = 0; i < 36; i++){
00052 union {
00053 float real;
00054 uint32_t base;
00055 } u_pose_covariancei;
00056 u_pose_covariancei.base = 0;
00057 u_pose_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00058 u_pose_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00059 u_pose_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00060 u_pose_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00061 this->pose_covariance[i] = u_pose_covariancei.real;
00062 offset += sizeof(this->pose_covariance[i]);
00063 }
00064 for( uint8_t i = 0; i < 36; i++){
00065 union {
00066 float real;
00067 uint32_t base;
00068 } u_twist_covariancei;
00069 u_twist_covariancei.base = 0;
00070 u_twist_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00071 u_twist_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00072 u_twist_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00073 u_twist_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00074 this->twist_covariance[i] = u_twist_covariancei.real;
00075 offset += sizeof(this->twist_covariance[i]);
00076 }
00077 return offset;
00078 }
00079
00080 const char * getType(){ return "rosabridge_msgs/OdometryCovariances"; };
00081 const char * getMD5(){ return "a4b306391e5fe1ada3a3b38b968daf06"; };
00082
00083 };
00084
00085 }
00086 #endif