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


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