hairo

Dependencies:   mbed BufferedSerial

Committer:
tknara
Date:
Tue Dec 04 00:14:32 2018 +0000
Revision:
4:bcdd99711326
Parent:
0:9e9b7db60fd5
test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
garyservin 0:9e9b7db60fd5 1 #ifndef _ROS_sensor_msgs_NavSatFix_h
garyservin 0:9e9b7db60fd5 2 #define _ROS_sensor_msgs_NavSatFix_h
garyservin 0:9e9b7db60fd5 3
garyservin 0:9e9b7db60fd5 4 #include <stdint.h>
garyservin 0:9e9b7db60fd5 5 #include <string.h>
garyservin 0:9e9b7db60fd5 6 #include <stdlib.h>
garyservin 0:9e9b7db60fd5 7 #include "ros/msg.h"
garyservin 0:9e9b7db60fd5 8 #include "std_msgs/Header.h"
garyservin 0:9e9b7db60fd5 9 #include "sensor_msgs/NavSatStatus.h"
garyservin 0:9e9b7db60fd5 10
garyservin 0:9e9b7db60fd5 11 namespace sensor_msgs
garyservin 0:9e9b7db60fd5 12 {
garyservin 0:9e9b7db60fd5 13
garyservin 0:9e9b7db60fd5 14 class NavSatFix : public ros::Msg
garyservin 0:9e9b7db60fd5 15 {
garyservin 0:9e9b7db60fd5 16 public:
garyservin 0:9e9b7db60fd5 17 typedef std_msgs::Header _header_type;
garyservin 0:9e9b7db60fd5 18 _header_type header;
garyservin 0:9e9b7db60fd5 19 typedef sensor_msgs::NavSatStatus _status_type;
garyservin 0:9e9b7db60fd5 20 _status_type status;
garyservin 0:9e9b7db60fd5 21 typedef double _latitude_type;
garyservin 0:9e9b7db60fd5 22 _latitude_type latitude;
garyservin 0:9e9b7db60fd5 23 typedef double _longitude_type;
garyservin 0:9e9b7db60fd5 24 _longitude_type longitude;
garyservin 0:9e9b7db60fd5 25 typedef double _altitude_type;
garyservin 0:9e9b7db60fd5 26 _altitude_type altitude;
garyservin 0:9e9b7db60fd5 27 double position_covariance[9];
garyservin 0:9e9b7db60fd5 28 typedef uint8_t _position_covariance_type_type;
garyservin 0:9e9b7db60fd5 29 _position_covariance_type_type position_covariance_type;
garyservin 0:9e9b7db60fd5 30 enum { COVARIANCE_TYPE_UNKNOWN = 0 };
garyservin 0:9e9b7db60fd5 31 enum { COVARIANCE_TYPE_APPROXIMATED = 1 };
garyservin 0:9e9b7db60fd5 32 enum { COVARIANCE_TYPE_DIAGONAL_KNOWN = 2 };
garyservin 0:9e9b7db60fd5 33 enum { COVARIANCE_TYPE_KNOWN = 3 };
garyservin 0:9e9b7db60fd5 34
garyservin 0:9e9b7db60fd5 35 NavSatFix():
garyservin 0:9e9b7db60fd5 36 header(),
garyservin 0:9e9b7db60fd5 37 status(),
garyservin 0:9e9b7db60fd5 38 latitude(0),
garyservin 0:9e9b7db60fd5 39 longitude(0),
garyservin 0:9e9b7db60fd5 40 altitude(0),
garyservin 0:9e9b7db60fd5 41 position_covariance(),
garyservin 0:9e9b7db60fd5 42 position_covariance_type(0)
garyservin 0:9e9b7db60fd5 43 {
garyservin 0:9e9b7db60fd5 44 }
garyservin 0:9e9b7db60fd5 45
garyservin 0:9e9b7db60fd5 46 virtual int serialize(unsigned char *outbuffer) const
garyservin 0:9e9b7db60fd5 47 {
garyservin 0:9e9b7db60fd5 48 int offset = 0;
garyservin 0:9e9b7db60fd5 49 offset += this->header.serialize(outbuffer + offset);
garyservin 0:9e9b7db60fd5 50 offset += this->status.serialize(outbuffer + offset);
garyservin 0:9e9b7db60fd5 51 union {
garyservin 0:9e9b7db60fd5 52 double real;
garyservin 0:9e9b7db60fd5 53 uint64_t base;
garyservin 0:9e9b7db60fd5 54 } u_latitude;
garyservin 0:9e9b7db60fd5 55 u_latitude.real = this->latitude;
garyservin 0:9e9b7db60fd5 56 *(outbuffer + offset + 0) = (u_latitude.base >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 57 *(outbuffer + offset + 1) = (u_latitude.base >> (8 * 1)) & 0xFF;
garyservin 0:9e9b7db60fd5 58 *(outbuffer + offset + 2) = (u_latitude.base >> (8 * 2)) & 0xFF;
garyservin 0:9e9b7db60fd5 59 *(outbuffer + offset + 3) = (u_latitude.base >> (8 * 3)) & 0xFF;
garyservin 0:9e9b7db60fd5 60 *(outbuffer + offset + 4) = (u_latitude.base >> (8 * 4)) & 0xFF;
garyservin 0:9e9b7db60fd5 61 *(outbuffer + offset + 5) = (u_latitude.base >> (8 * 5)) & 0xFF;
garyservin 0:9e9b7db60fd5 62 *(outbuffer + offset + 6) = (u_latitude.base >> (8 * 6)) & 0xFF;
garyservin 0:9e9b7db60fd5 63 *(outbuffer + offset + 7) = (u_latitude.base >> (8 * 7)) & 0xFF;
garyservin 0:9e9b7db60fd5 64 offset += sizeof(this->latitude);
garyservin 0:9e9b7db60fd5 65 union {
garyservin 0:9e9b7db60fd5 66 double real;
garyservin 0:9e9b7db60fd5 67 uint64_t base;
garyservin 0:9e9b7db60fd5 68 } u_longitude;
garyservin 0:9e9b7db60fd5 69 u_longitude.real = this->longitude;
garyservin 0:9e9b7db60fd5 70 *(outbuffer + offset + 0) = (u_longitude.base >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 71 *(outbuffer + offset + 1) = (u_longitude.base >> (8 * 1)) & 0xFF;
garyservin 0:9e9b7db60fd5 72 *(outbuffer + offset + 2) = (u_longitude.base >> (8 * 2)) & 0xFF;
garyservin 0:9e9b7db60fd5 73 *(outbuffer + offset + 3) = (u_longitude.base >> (8 * 3)) & 0xFF;
garyservin 0:9e9b7db60fd5 74 *(outbuffer + offset + 4) = (u_longitude.base >> (8 * 4)) & 0xFF;
garyservin 0:9e9b7db60fd5 75 *(outbuffer + offset + 5) = (u_longitude.base >> (8 * 5)) & 0xFF;
garyservin 0:9e9b7db60fd5 76 *(outbuffer + offset + 6) = (u_longitude.base >> (8 * 6)) & 0xFF;
garyservin 0:9e9b7db60fd5 77 *(outbuffer + offset + 7) = (u_longitude.base >> (8 * 7)) & 0xFF;
garyservin 0:9e9b7db60fd5 78 offset += sizeof(this->longitude);
garyservin 0:9e9b7db60fd5 79 union {
garyservin 0:9e9b7db60fd5 80 double real;
garyservin 0:9e9b7db60fd5 81 uint64_t base;
garyservin 0:9e9b7db60fd5 82 } u_altitude;
garyservin 0:9e9b7db60fd5 83 u_altitude.real = this->altitude;
garyservin 0:9e9b7db60fd5 84 *(outbuffer + offset + 0) = (u_altitude.base >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 85 *(outbuffer + offset + 1) = (u_altitude.base >> (8 * 1)) & 0xFF;
garyservin 0:9e9b7db60fd5 86 *(outbuffer + offset + 2) = (u_altitude.base >> (8 * 2)) & 0xFF;
garyservin 0:9e9b7db60fd5 87 *(outbuffer + offset + 3) = (u_altitude.base >> (8 * 3)) & 0xFF;
garyservin 0:9e9b7db60fd5 88 *(outbuffer + offset + 4) = (u_altitude.base >> (8 * 4)) & 0xFF;
garyservin 0:9e9b7db60fd5 89 *(outbuffer + offset + 5) = (u_altitude.base >> (8 * 5)) & 0xFF;
garyservin 0:9e9b7db60fd5 90 *(outbuffer + offset + 6) = (u_altitude.base >> (8 * 6)) & 0xFF;
garyservin 0:9e9b7db60fd5 91 *(outbuffer + offset + 7) = (u_altitude.base >> (8 * 7)) & 0xFF;
garyservin 0:9e9b7db60fd5 92 offset += sizeof(this->altitude);
garyservin 0:9e9b7db60fd5 93 for( uint32_t i = 0; i < 9; i++){
garyservin 0:9e9b7db60fd5 94 union {
garyservin 0:9e9b7db60fd5 95 double real;
garyservin 0:9e9b7db60fd5 96 uint64_t base;
garyservin 0:9e9b7db60fd5 97 } u_position_covariancei;
garyservin 0:9e9b7db60fd5 98 u_position_covariancei.real = this->position_covariance[i];
garyservin 0:9e9b7db60fd5 99 *(outbuffer + offset + 0) = (u_position_covariancei.base >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 100 *(outbuffer + offset + 1) = (u_position_covariancei.base >> (8 * 1)) & 0xFF;
garyservin 0:9e9b7db60fd5 101 *(outbuffer + offset + 2) = (u_position_covariancei.base >> (8 * 2)) & 0xFF;
garyservin 0:9e9b7db60fd5 102 *(outbuffer + offset + 3) = (u_position_covariancei.base >> (8 * 3)) & 0xFF;
garyservin 0:9e9b7db60fd5 103 *(outbuffer + offset + 4) = (u_position_covariancei.base >> (8 * 4)) & 0xFF;
garyservin 0:9e9b7db60fd5 104 *(outbuffer + offset + 5) = (u_position_covariancei.base >> (8 * 5)) & 0xFF;
garyservin 0:9e9b7db60fd5 105 *(outbuffer + offset + 6) = (u_position_covariancei.base >> (8 * 6)) & 0xFF;
garyservin 0:9e9b7db60fd5 106 *(outbuffer + offset + 7) = (u_position_covariancei.base >> (8 * 7)) & 0xFF;
garyservin 0:9e9b7db60fd5 107 offset += sizeof(this->position_covariance[i]);
garyservin 0:9e9b7db60fd5 108 }
garyservin 0:9e9b7db60fd5 109 *(outbuffer + offset + 0) = (this->position_covariance_type >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 110 offset += sizeof(this->position_covariance_type);
garyservin 0:9e9b7db60fd5 111 return offset;
garyservin 0:9e9b7db60fd5 112 }
garyservin 0:9e9b7db60fd5 113
garyservin 0:9e9b7db60fd5 114 virtual int deserialize(unsigned char *inbuffer)
garyservin 0:9e9b7db60fd5 115 {
garyservin 0:9e9b7db60fd5 116 int offset = 0;
garyservin 0:9e9b7db60fd5 117 offset += this->header.deserialize(inbuffer + offset);
garyservin 0:9e9b7db60fd5 118 offset += this->status.deserialize(inbuffer + offset);
garyservin 0:9e9b7db60fd5 119 union {
garyservin 0:9e9b7db60fd5 120 double real;
garyservin 0:9e9b7db60fd5 121 uint64_t base;
garyservin 0:9e9b7db60fd5 122 } u_latitude;
garyservin 0:9e9b7db60fd5 123 u_latitude.base = 0;
garyservin 0:9e9b7db60fd5 124 u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:9e9b7db60fd5 125 u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:9e9b7db60fd5 126 u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:9e9b7db60fd5 127 u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:9e9b7db60fd5 128 u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:9e9b7db60fd5 129 u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:9e9b7db60fd5 130 u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:9e9b7db60fd5 131 u_latitude.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:9e9b7db60fd5 132 this->latitude = u_latitude.real;
garyservin 0:9e9b7db60fd5 133 offset += sizeof(this->latitude);
garyservin 0:9e9b7db60fd5 134 union {
garyservin 0:9e9b7db60fd5 135 double real;
garyservin 0:9e9b7db60fd5 136 uint64_t base;
garyservin 0:9e9b7db60fd5 137 } u_longitude;
garyservin 0:9e9b7db60fd5 138 u_longitude.base = 0;
garyservin 0:9e9b7db60fd5 139 u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:9e9b7db60fd5 140 u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:9e9b7db60fd5 141 u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:9e9b7db60fd5 142 u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:9e9b7db60fd5 143 u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:9e9b7db60fd5 144 u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:9e9b7db60fd5 145 u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:9e9b7db60fd5 146 u_longitude.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:9e9b7db60fd5 147 this->longitude = u_longitude.real;
garyservin 0:9e9b7db60fd5 148 offset += sizeof(this->longitude);
garyservin 0:9e9b7db60fd5 149 union {
garyservin 0:9e9b7db60fd5 150 double real;
garyservin 0:9e9b7db60fd5 151 uint64_t base;
garyservin 0:9e9b7db60fd5 152 } u_altitude;
garyservin 0:9e9b7db60fd5 153 u_altitude.base = 0;
garyservin 0:9e9b7db60fd5 154 u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:9e9b7db60fd5 155 u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:9e9b7db60fd5 156 u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:9e9b7db60fd5 157 u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:9e9b7db60fd5 158 u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:9e9b7db60fd5 159 u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:9e9b7db60fd5 160 u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:9e9b7db60fd5 161 u_altitude.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:9e9b7db60fd5 162 this->altitude = u_altitude.real;
garyservin 0:9e9b7db60fd5 163 offset += sizeof(this->altitude);
garyservin 0:9e9b7db60fd5 164 for( uint32_t i = 0; i < 9; i++){
garyservin 0:9e9b7db60fd5 165 union {
garyservin 0:9e9b7db60fd5 166 double real;
garyservin 0:9e9b7db60fd5 167 uint64_t base;
garyservin 0:9e9b7db60fd5 168 } u_position_covariancei;
garyservin 0:9e9b7db60fd5 169 u_position_covariancei.base = 0;
garyservin 0:9e9b7db60fd5 170 u_position_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:9e9b7db60fd5 171 u_position_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:9e9b7db60fd5 172 u_position_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:9e9b7db60fd5 173 u_position_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:9e9b7db60fd5 174 u_position_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:9e9b7db60fd5 175 u_position_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:9e9b7db60fd5 176 u_position_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:9e9b7db60fd5 177 u_position_covariancei.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:9e9b7db60fd5 178 this->position_covariance[i] = u_position_covariancei.real;
garyservin 0:9e9b7db60fd5 179 offset += sizeof(this->position_covariance[i]);
garyservin 0:9e9b7db60fd5 180 }
garyservin 0:9e9b7db60fd5 181 this->position_covariance_type = ((uint8_t) (*(inbuffer + offset)));
garyservin 0:9e9b7db60fd5 182 offset += sizeof(this->position_covariance_type);
garyservin 0:9e9b7db60fd5 183 return offset;
garyservin 0:9e9b7db60fd5 184 }
garyservin 0:9e9b7db60fd5 185
garyservin 0:9e9b7db60fd5 186 const char * getType(){ return "sensor_msgs/NavSatFix"; };
garyservin 0:9e9b7db60fd5 187 const char * getMD5(){ return "2d3a8cd499b9b4a0249fb98fd05cfa48"; };
garyservin 0:9e9b7db60fd5 188
garyservin 0:9e9b7db60fd5 189 };
garyservin 0:9e9b7db60fd5 190
garyservin 0:9e9b7db60fd5 191 }
garyservin 0:9e9b7db60fd5 192 #endif