Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
AccelWithCovariance.h
00001 #ifndef _ROS_geometry_msgs_AccelWithCovariance_h 00002 #define _ROS_geometry_msgs_AccelWithCovariance_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 #include "geometry_msgs/Accel.h" 00009 00010 namespace geometry_msgs 00011 { 00012 00013 class AccelWithCovariance : public ros::Msg 00014 { 00015 public: 00016 typedef geometry_msgs::Accel _accel_type; 00017 _accel_type accel; 00018 double covariance[36]; 00019 00020 AccelWithCovariance(): 00021 accel(), 00022 covariance() 00023 { 00024 } 00025 00026 virtual int serialize(unsigned char *outbuffer) const 00027 { 00028 int offset = 0; 00029 offset += this->accel.serialize(outbuffer + offset); 00030 for( uint32_t i = 0; i < 36; i++){ 00031 union { 00032 double real; 00033 uint64_t base; 00034 } u_covariancei; 00035 u_covariancei.real = this->covariance[i]; 00036 *(outbuffer + offset + 0) = (u_covariancei.base >> (8 * 0)) & 0xFF; 00037 *(outbuffer + offset + 1) = (u_covariancei.base >> (8 * 1)) & 0xFF; 00038 *(outbuffer + offset + 2) = (u_covariancei.base >> (8 * 2)) & 0xFF; 00039 *(outbuffer + offset + 3) = (u_covariancei.base >> (8 * 3)) & 0xFF; 00040 *(outbuffer + offset + 4) = (u_covariancei.base >> (8 * 4)) & 0xFF; 00041 *(outbuffer + offset + 5) = (u_covariancei.base >> (8 * 5)) & 0xFF; 00042 *(outbuffer + offset + 6) = (u_covariancei.base >> (8 * 6)) & 0xFF; 00043 *(outbuffer + offset + 7) = (u_covariancei.base >> (8 * 7)) & 0xFF; 00044 offset += sizeof(this->covariance[i]); 00045 } 00046 return offset; 00047 } 00048 00049 virtual int deserialize(unsigned char *inbuffer) 00050 { 00051 int offset = 0; 00052 offset += this->accel.deserialize(inbuffer + offset); 00053 for( uint32_t i = 0; i < 36; i++){ 00054 union { 00055 double real; 00056 uint64_t base; 00057 } u_covariancei; 00058 u_covariancei.base = 0; 00059 u_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); 00060 u_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); 00061 u_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); 00062 u_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); 00063 u_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); 00064 u_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); 00065 u_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); 00066 u_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); 00067 this->covariance[i] = u_covariancei.real; 00068 offset += sizeof(this->covariance[i]); 00069 } 00070 return offset; 00071 } 00072 00073 const char * getType(){ return "geometry_msgs/AccelWithCovariance"; }; 00074 const char * getMD5(){ return "ad5a718d699c6be72a02b8d6a139f334"; }; 00075 00076 }; 00077 00078 } 00079 #endif
Generated on Wed Jul 13 2022 23:30:17 by
