Go to the documentation of this file.00001 #ifndef _ROS_rosabridge_msgs_ImuCovariances_h
00002 #define _ROS_rosabridge_msgs_ImuCovariances_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 ImuCovariances : public ros::Msg
00013 {
00014 public:
00015 float orientation_covariance[9];
00016 float angular_velocity_covariance[9];
00017 float linear_acceleration_covariance[9];
00018
00019 virtual int serialize(unsigned char *outbuffer) const
00020 {
00021 int offset = 0;
00022 for( uint8_t i = 0; i < 9; i++){
00023 union {
00024 float real;
00025 uint32_t base;
00026 } u_orientation_covariancei;
00027 u_orientation_covariancei.real = this->orientation_covariance[i];
00028 *(outbuffer + offset + 0) = (u_orientation_covariancei.base >> (8 * 0)) & 0xFF;
00029 *(outbuffer + offset + 1) = (u_orientation_covariancei.base >> (8 * 1)) & 0xFF;
00030 *(outbuffer + offset + 2) = (u_orientation_covariancei.base >> (8 * 2)) & 0xFF;
00031 *(outbuffer + offset + 3) = (u_orientation_covariancei.base >> (8 * 3)) & 0xFF;
00032 offset += sizeof(this->orientation_covariance[i]);
00033 }
00034 for( uint8_t i = 0; i < 9; i++){
00035 union {
00036 float real;
00037 uint32_t base;
00038 } u_angular_velocity_covariancei;
00039 u_angular_velocity_covariancei.real = this->angular_velocity_covariance[i];
00040 *(outbuffer + offset + 0) = (u_angular_velocity_covariancei.base >> (8 * 0)) & 0xFF;
00041 *(outbuffer + offset + 1) = (u_angular_velocity_covariancei.base >> (8 * 1)) & 0xFF;
00042 *(outbuffer + offset + 2) = (u_angular_velocity_covariancei.base >> (8 * 2)) & 0xFF;
00043 *(outbuffer + offset + 3) = (u_angular_velocity_covariancei.base >> (8 * 3)) & 0xFF;
00044 offset += sizeof(this->angular_velocity_covariance[i]);
00045 }
00046 for( uint8_t i = 0; i < 9; i++){
00047 union {
00048 float real;
00049 uint32_t base;
00050 } u_linear_acceleration_covariancei;
00051 u_linear_acceleration_covariancei.real = this->linear_acceleration_covariance[i];
00052 *(outbuffer + offset + 0) = (u_linear_acceleration_covariancei.base >> (8 * 0)) & 0xFF;
00053 *(outbuffer + offset + 1) = (u_linear_acceleration_covariancei.base >> (8 * 1)) & 0xFF;
00054 *(outbuffer + offset + 2) = (u_linear_acceleration_covariancei.base >> (8 * 2)) & 0xFF;
00055 *(outbuffer + offset + 3) = (u_linear_acceleration_covariancei.base >> (8 * 3)) & 0xFF;
00056 offset += sizeof(this->linear_acceleration_covariance[i]);
00057 }
00058 return offset;
00059 }
00060
00061 virtual int deserialize(unsigned char *inbuffer)
00062 {
00063 int offset = 0;
00064 for( uint8_t i = 0; i < 9; i++){
00065 union {
00066 float real;
00067 uint32_t base;
00068 } u_orientation_covariancei;
00069 u_orientation_covariancei.base = 0;
00070 u_orientation_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00071 u_orientation_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00072 u_orientation_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00073 u_orientation_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00074 this->orientation_covariance[i] = u_orientation_covariancei.real;
00075 offset += sizeof(this->orientation_covariance[i]);
00076 }
00077 for( uint8_t i = 0; i < 9; i++){
00078 union {
00079 float real;
00080 uint32_t base;
00081 } u_angular_velocity_covariancei;
00082 u_angular_velocity_covariancei.base = 0;
00083 u_angular_velocity_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00084 u_angular_velocity_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00085 u_angular_velocity_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00086 u_angular_velocity_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00087 this->angular_velocity_covariance[i] = u_angular_velocity_covariancei.real;
00088 offset += sizeof(this->angular_velocity_covariance[i]);
00089 }
00090 for( uint8_t i = 0; i < 9; i++){
00091 union {
00092 float real;
00093 uint32_t base;
00094 } u_linear_acceleration_covariancei;
00095 u_linear_acceleration_covariancei.base = 0;
00096 u_linear_acceleration_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00097 u_linear_acceleration_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00098 u_linear_acceleration_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00099 u_linear_acceleration_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00100 this->linear_acceleration_covariance[i] = u_linear_acceleration_covariancei.real;
00101 offset += sizeof(this->linear_acceleration_covariance[i]);
00102 }
00103 return offset;
00104 }
00105
00106 const char * getType(){ return "rosabridge_msgs/ImuCovariances"; };
00107 const char * getMD5(){ return "abc17e56a180069d18f7856848657acb"; };
00108
00109 };
00110
00111 }
00112 #endif