ImuCovariances.h
Go to the documentation of this file.
1 #ifndef _ROS_rosabridge_msgs_ImuCovariances_h
2 #define _ROS_rosabridge_msgs_ImuCovariances_h
3 
4 #include <stdint.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include "ros/msg.h"
8 
9 namespace rosabridge_msgs
10 {
11 
12  class ImuCovariances : public ros::Msg
13  {
14  public:
18 
19  virtual int serialize(unsigned char *outbuffer) const
20  {
21  int offset = 0;
22  for( uint8_t i = 0; i < 9; i++){
23  union {
24  float real;
25  uint32_t base;
26  } u_orientation_covariancei;
27  u_orientation_covariancei.real = this->orientation_covariance[i];
28  *(outbuffer + offset + 0) = (u_orientation_covariancei.base >> (8 * 0)) & 0xFF;
29  *(outbuffer + offset + 1) = (u_orientation_covariancei.base >> (8 * 1)) & 0xFF;
30  *(outbuffer + offset + 2) = (u_orientation_covariancei.base >> (8 * 2)) & 0xFF;
31  *(outbuffer + offset + 3) = (u_orientation_covariancei.base >> (8 * 3)) & 0xFF;
32  offset += sizeof(this->orientation_covariance[i]);
33  }
34  for( uint8_t i = 0; i < 9; i++){
35  union {
36  float real;
37  uint32_t base;
38  } u_angular_velocity_covariancei;
39  u_angular_velocity_covariancei.real = this->angular_velocity_covariance[i];
40  *(outbuffer + offset + 0) = (u_angular_velocity_covariancei.base >> (8 * 0)) & 0xFF;
41  *(outbuffer + offset + 1) = (u_angular_velocity_covariancei.base >> (8 * 1)) & 0xFF;
42  *(outbuffer + offset + 2) = (u_angular_velocity_covariancei.base >> (8 * 2)) & 0xFF;
43  *(outbuffer + offset + 3) = (u_angular_velocity_covariancei.base >> (8 * 3)) & 0xFF;
44  offset += sizeof(this->angular_velocity_covariance[i]);
45  }
46  for( uint8_t i = 0; i < 9; i++){
47  union {
48  float real;
49  uint32_t base;
50  } u_linear_acceleration_covariancei;
51  u_linear_acceleration_covariancei.real = this->linear_acceleration_covariance[i];
52  *(outbuffer + offset + 0) = (u_linear_acceleration_covariancei.base >> (8 * 0)) & 0xFF;
53  *(outbuffer + offset + 1) = (u_linear_acceleration_covariancei.base >> (8 * 1)) & 0xFF;
54  *(outbuffer + offset + 2) = (u_linear_acceleration_covariancei.base >> (8 * 2)) & 0xFF;
55  *(outbuffer + offset + 3) = (u_linear_acceleration_covariancei.base >> (8 * 3)) & 0xFF;
56  offset += sizeof(this->linear_acceleration_covariance[i]);
57  }
58  return offset;
59  }
60 
61  virtual int deserialize(unsigned char *inbuffer)
62  {
63  int offset = 0;
64  for( uint8_t i = 0; i < 9; i++){
65  union {
66  float real;
67  uint32_t base;
68  } u_orientation_covariancei;
69  u_orientation_covariancei.base = 0;
70  u_orientation_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
71  u_orientation_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
72  u_orientation_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
73  u_orientation_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
74  this->orientation_covariance[i] = u_orientation_covariancei.real;
75  offset += sizeof(this->orientation_covariance[i]);
76  }
77  for( uint8_t i = 0; i < 9; i++){
78  union {
79  float real;
80  uint32_t base;
81  } u_angular_velocity_covariancei;
82  u_angular_velocity_covariancei.base = 0;
83  u_angular_velocity_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
84  u_angular_velocity_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
85  u_angular_velocity_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
86  u_angular_velocity_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
87  this->angular_velocity_covariance[i] = u_angular_velocity_covariancei.real;
88  offset += sizeof(this->angular_velocity_covariance[i]);
89  }
90  for( uint8_t i = 0; i < 9; i++){
91  union {
92  float real;
93  uint32_t base;
94  } u_linear_acceleration_covariancei;
95  u_linear_acceleration_covariancei.base = 0;
96  u_linear_acceleration_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
97  u_linear_acceleration_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
98  u_linear_acceleration_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
99  u_linear_acceleration_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
100  this->linear_acceleration_covariance[i] = u_linear_acceleration_covariancei.real;
101  offset += sizeof(this->linear_acceleration_covariance[i]);
102  }
103  return offset;
104  }
105 
106  const char * getType(){ return "rosabridge_msgs/ImuCovariances"; };
107  const char * getMD5(){ return "abc17e56a180069d18f7856848657acb"; };
108 
109  };
110 
111 }
112 #endif
virtual int serialize(unsigned char *outbuffer) const
virtual int deserialize(unsigned char *inbuffer)


rosabridge_arduino
Author(s): Chad Attermann
autogenerated on Sat Apr 10 2021 02:37:49