capstone_finish

Dependencies:   BufferedSerial motor_sn7544

Committer:
Jeonghoon
Date:
Tue Aug 13 05:53:22 2019 +0000
Revision:
3:2a3664dc6634
with ROS;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jeonghoon 3:2a3664dc6634 1 #ifndef _ROS_sensor_msgs_CameraInfo_h
Jeonghoon 3:2a3664dc6634 2 #define _ROS_sensor_msgs_CameraInfo_h
Jeonghoon 3:2a3664dc6634 3
Jeonghoon 3:2a3664dc6634 4 #include <stdint.h>
Jeonghoon 3:2a3664dc6634 5 #include <string.h>
Jeonghoon 3:2a3664dc6634 6 #include <stdlib.h>
Jeonghoon 3:2a3664dc6634 7 #include "ros/msg.h"
Jeonghoon 3:2a3664dc6634 8 #include "std_msgs/Header.h"
Jeonghoon 3:2a3664dc6634 9 #include "sensor_msgs/RegionOfInterest.h"
Jeonghoon 3:2a3664dc6634 10
Jeonghoon 3:2a3664dc6634 11 namespace sensor_msgs
Jeonghoon 3:2a3664dc6634 12 {
Jeonghoon 3:2a3664dc6634 13
Jeonghoon 3:2a3664dc6634 14 class CameraInfo : public ros::Msg
Jeonghoon 3:2a3664dc6634 15 {
Jeonghoon 3:2a3664dc6634 16 public:
Jeonghoon 3:2a3664dc6634 17 typedef std_msgs::Header _header_type;
Jeonghoon 3:2a3664dc6634 18 _header_type header;
Jeonghoon 3:2a3664dc6634 19 typedef uint32_t _height_type;
Jeonghoon 3:2a3664dc6634 20 _height_type height;
Jeonghoon 3:2a3664dc6634 21 typedef uint32_t _width_type;
Jeonghoon 3:2a3664dc6634 22 _width_type width;
Jeonghoon 3:2a3664dc6634 23 typedef const char* _distortion_model_type;
Jeonghoon 3:2a3664dc6634 24 _distortion_model_type distortion_model;
Jeonghoon 3:2a3664dc6634 25 uint32_t D_length;
Jeonghoon 3:2a3664dc6634 26 typedef double _D_type;
Jeonghoon 3:2a3664dc6634 27 _D_type st_D;
Jeonghoon 3:2a3664dc6634 28 _D_type * D;
Jeonghoon 3:2a3664dc6634 29 double K[9];
Jeonghoon 3:2a3664dc6634 30 double R[9];
Jeonghoon 3:2a3664dc6634 31 double P[12];
Jeonghoon 3:2a3664dc6634 32 typedef uint32_t _binning_x_type;
Jeonghoon 3:2a3664dc6634 33 _binning_x_type binning_x;
Jeonghoon 3:2a3664dc6634 34 typedef uint32_t _binning_y_type;
Jeonghoon 3:2a3664dc6634 35 _binning_y_type binning_y;
Jeonghoon 3:2a3664dc6634 36 typedef sensor_msgs::RegionOfInterest _roi_type;
Jeonghoon 3:2a3664dc6634 37 _roi_type roi;
Jeonghoon 3:2a3664dc6634 38
Jeonghoon 3:2a3664dc6634 39 CameraInfo():
Jeonghoon 3:2a3664dc6634 40 header(),
Jeonghoon 3:2a3664dc6634 41 height(0),
Jeonghoon 3:2a3664dc6634 42 width(0),
Jeonghoon 3:2a3664dc6634 43 distortion_model(""),
Jeonghoon 3:2a3664dc6634 44 D_length(0), D(NULL),
Jeonghoon 3:2a3664dc6634 45 K(),
Jeonghoon 3:2a3664dc6634 46 R(),
Jeonghoon 3:2a3664dc6634 47 P(),
Jeonghoon 3:2a3664dc6634 48 binning_x(0),
Jeonghoon 3:2a3664dc6634 49 binning_y(0),
Jeonghoon 3:2a3664dc6634 50 roi()
Jeonghoon 3:2a3664dc6634 51 {
Jeonghoon 3:2a3664dc6634 52 }
Jeonghoon 3:2a3664dc6634 53
Jeonghoon 3:2a3664dc6634 54 virtual int serialize(unsigned char *outbuffer) const
Jeonghoon 3:2a3664dc6634 55 {
Jeonghoon 3:2a3664dc6634 56 int offset = 0;
Jeonghoon 3:2a3664dc6634 57 offset += this->header.serialize(outbuffer + offset);
Jeonghoon 3:2a3664dc6634 58 *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF;
Jeonghoon 3:2a3664dc6634 59 *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF;
Jeonghoon 3:2a3664dc6634 60 *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF;
Jeonghoon 3:2a3664dc6634 61 *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF;
Jeonghoon 3:2a3664dc6634 62 offset += sizeof(this->height);
Jeonghoon 3:2a3664dc6634 63 *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF;
Jeonghoon 3:2a3664dc6634 64 *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF;
Jeonghoon 3:2a3664dc6634 65 *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF;
Jeonghoon 3:2a3664dc6634 66 *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF;
Jeonghoon 3:2a3664dc6634 67 offset += sizeof(this->width);
Jeonghoon 3:2a3664dc6634 68 uint32_t length_distortion_model = strlen(this->distortion_model);
Jeonghoon 3:2a3664dc6634 69 varToArr(outbuffer + offset, length_distortion_model);
Jeonghoon 3:2a3664dc6634 70 offset += 4;
Jeonghoon 3:2a3664dc6634 71 memcpy(outbuffer + offset, this->distortion_model, length_distortion_model);
Jeonghoon 3:2a3664dc6634 72 offset += length_distortion_model;
Jeonghoon 3:2a3664dc6634 73 *(outbuffer + offset + 0) = (this->D_length >> (8 * 0)) & 0xFF;
Jeonghoon 3:2a3664dc6634 74 *(outbuffer + offset + 1) = (this->D_length >> (8 * 1)) & 0xFF;
Jeonghoon 3:2a3664dc6634 75 *(outbuffer + offset + 2) = (this->D_length >> (8 * 2)) & 0xFF;
Jeonghoon 3:2a3664dc6634 76 *(outbuffer + offset + 3) = (this->D_length >> (8 * 3)) & 0xFF;
Jeonghoon 3:2a3664dc6634 77 offset += sizeof(this->D_length);
Jeonghoon 3:2a3664dc6634 78 for( uint32_t i = 0; i < D_length; i++){
Jeonghoon 3:2a3664dc6634 79 union {
Jeonghoon 3:2a3664dc6634 80 double real;
Jeonghoon 3:2a3664dc6634 81 uint64_t base;
Jeonghoon 3:2a3664dc6634 82 } u_Di;
Jeonghoon 3:2a3664dc6634 83 u_Di.real = this->D[i];
Jeonghoon 3:2a3664dc6634 84 *(outbuffer + offset + 0) = (u_Di.base >> (8 * 0)) & 0xFF;
Jeonghoon 3:2a3664dc6634 85 *(outbuffer + offset + 1) = (u_Di.base >> (8 * 1)) & 0xFF;
Jeonghoon 3:2a3664dc6634 86 *(outbuffer + offset + 2) = (u_Di.base >> (8 * 2)) & 0xFF;
Jeonghoon 3:2a3664dc6634 87 *(outbuffer + offset + 3) = (u_Di.base >> (8 * 3)) & 0xFF;
Jeonghoon 3:2a3664dc6634 88 *(outbuffer + offset + 4) = (u_Di.base >> (8 * 4)) & 0xFF;
Jeonghoon 3:2a3664dc6634 89 *(outbuffer + offset + 5) = (u_Di.base >> (8 * 5)) & 0xFF;
Jeonghoon 3:2a3664dc6634 90 *(outbuffer + offset + 6) = (u_Di.base >> (8 * 6)) & 0xFF;
Jeonghoon 3:2a3664dc6634 91 *(outbuffer + offset + 7) = (u_Di.base >> (8 * 7)) & 0xFF;
Jeonghoon 3:2a3664dc6634 92 offset += sizeof(this->D[i]);
Jeonghoon 3:2a3664dc6634 93 }
Jeonghoon 3:2a3664dc6634 94 for( uint32_t i = 0; i < 9; i++){
Jeonghoon 3:2a3664dc6634 95 union {
Jeonghoon 3:2a3664dc6634 96 double real;
Jeonghoon 3:2a3664dc6634 97 uint64_t base;
Jeonghoon 3:2a3664dc6634 98 } u_Ki;
Jeonghoon 3:2a3664dc6634 99 u_Ki.real = this->K[i];
Jeonghoon 3:2a3664dc6634 100 *(outbuffer + offset + 0) = (u_Ki.base >> (8 * 0)) & 0xFF;
Jeonghoon 3:2a3664dc6634 101 *(outbuffer + offset + 1) = (u_Ki.base >> (8 * 1)) & 0xFF;
Jeonghoon 3:2a3664dc6634 102 *(outbuffer + offset + 2) = (u_Ki.base >> (8 * 2)) & 0xFF;
Jeonghoon 3:2a3664dc6634 103 *(outbuffer + offset + 3) = (u_Ki.base >> (8 * 3)) & 0xFF;
Jeonghoon 3:2a3664dc6634 104 *(outbuffer + offset + 4) = (u_Ki.base >> (8 * 4)) & 0xFF;
Jeonghoon 3:2a3664dc6634 105 *(outbuffer + offset + 5) = (u_Ki.base >> (8 * 5)) & 0xFF;
Jeonghoon 3:2a3664dc6634 106 *(outbuffer + offset + 6) = (u_Ki.base >> (8 * 6)) & 0xFF;
Jeonghoon 3:2a3664dc6634 107 *(outbuffer + offset + 7) = (u_Ki.base >> (8 * 7)) & 0xFF;
Jeonghoon 3:2a3664dc6634 108 offset += sizeof(this->K[i]);
Jeonghoon 3:2a3664dc6634 109 }
Jeonghoon 3:2a3664dc6634 110 for( uint32_t i = 0; i < 9; i++){
Jeonghoon 3:2a3664dc6634 111 union {
Jeonghoon 3:2a3664dc6634 112 double real;
Jeonghoon 3:2a3664dc6634 113 uint64_t base;
Jeonghoon 3:2a3664dc6634 114 } u_Ri;
Jeonghoon 3:2a3664dc6634 115 u_Ri.real = this->R[i];
Jeonghoon 3:2a3664dc6634 116 *(outbuffer + offset + 0) = (u_Ri.base >> (8 * 0)) & 0xFF;
Jeonghoon 3:2a3664dc6634 117 *(outbuffer + offset + 1) = (u_Ri.base >> (8 * 1)) & 0xFF;
Jeonghoon 3:2a3664dc6634 118 *(outbuffer + offset + 2) = (u_Ri.base >> (8 * 2)) & 0xFF;
Jeonghoon 3:2a3664dc6634 119 *(outbuffer + offset + 3) = (u_Ri.base >> (8 * 3)) & 0xFF;
Jeonghoon 3:2a3664dc6634 120 *(outbuffer + offset + 4) = (u_Ri.base >> (8 * 4)) & 0xFF;
Jeonghoon 3:2a3664dc6634 121 *(outbuffer + offset + 5) = (u_Ri.base >> (8 * 5)) & 0xFF;
Jeonghoon 3:2a3664dc6634 122 *(outbuffer + offset + 6) = (u_Ri.base >> (8 * 6)) & 0xFF;
Jeonghoon 3:2a3664dc6634 123 *(outbuffer + offset + 7) = (u_Ri.base >> (8 * 7)) & 0xFF;
Jeonghoon 3:2a3664dc6634 124 offset += sizeof(this->R[i]);
Jeonghoon 3:2a3664dc6634 125 }
Jeonghoon 3:2a3664dc6634 126 for( uint32_t i = 0; i < 12; i++){
Jeonghoon 3:2a3664dc6634 127 union {
Jeonghoon 3:2a3664dc6634 128 double real;
Jeonghoon 3:2a3664dc6634 129 uint64_t base;
Jeonghoon 3:2a3664dc6634 130 } u_Pi;
Jeonghoon 3:2a3664dc6634 131 u_Pi.real = this->P[i];
Jeonghoon 3:2a3664dc6634 132 *(outbuffer + offset + 0) = (u_Pi.base >> (8 * 0)) & 0xFF;
Jeonghoon 3:2a3664dc6634 133 *(outbuffer + offset + 1) = (u_Pi.base >> (8 * 1)) & 0xFF;
Jeonghoon 3:2a3664dc6634 134 *(outbuffer + offset + 2) = (u_Pi.base >> (8 * 2)) & 0xFF;
Jeonghoon 3:2a3664dc6634 135 *(outbuffer + offset + 3) = (u_Pi.base >> (8 * 3)) & 0xFF;
Jeonghoon 3:2a3664dc6634 136 *(outbuffer + offset + 4) = (u_Pi.base >> (8 * 4)) & 0xFF;
Jeonghoon 3:2a3664dc6634 137 *(outbuffer + offset + 5) = (u_Pi.base >> (8 * 5)) & 0xFF;
Jeonghoon 3:2a3664dc6634 138 *(outbuffer + offset + 6) = (u_Pi.base >> (8 * 6)) & 0xFF;
Jeonghoon 3:2a3664dc6634 139 *(outbuffer + offset + 7) = (u_Pi.base >> (8 * 7)) & 0xFF;
Jeonghoon 3:2a3664dc6634 140 offset += sizeof(this->P[i]);
Jeonghoon 3:2a3664dc6634 141 }
Jeonghoon 3:2a3664dc6634 142 *(outbuffer + offset + 0) = (this->binning_x >> (8 * 0)) & 0xFF;
Jeonghoon 3:2a3664dc6634 143 *(outbuffer + offset + 1) = (this->binning_x >> (8 * 1)) & 0xFF;
Jeonghoon 3:2a3664dc6634 144 *(outbuffer + offset + 2) = (this->binning_x >> (8 * 2)) & 0xFF;
Jeonghoon 3:2a3664dc6634 145 *(outbuffer + offset + 3) = (this->binning_x >> (8 * 3)) & 0xFF;
Jeonghoon 3:2a3664dc6634 146 offset += sizeof(this->binning_x);
Jeonghoon 3:2a3664dc6634 147 *(outbuffer + offset + 0) = (this->binning_y >> (8 * 0)) & 0xFF;
Jeonghoon 3:2a3664dc6634 148 *(outbuffer + offset + 1) = (this->binning_y >> (8 * 1)) & 0xFF;
Jeonghoon 3:2a3664dc6634 149 *(outbuffer + offset + 2) = (this->binning_y >> (8 * 2)) & 0xFF;
Jeonghoon 3:2a3664dc6634 150 *(outbuffer + offset + 3) = (this->binning_y >> (8 * 3)) & 0xFF;
Jeonghoon 3:2a3664dc6634 151 offset += sizeof(this->binning_y);
Jeonghoon 3:2a3664dc6634 152 offset += this->roi.serialize(outbuffer + offset);
Jeonghoon 3:2a3664dc6634 153 return offset;
Jeonghoon 3:2a3664dc6634 154 }
Jeonghoon 3:2a3664dc6634 155
Jeonghoon 3:2a3664dc6634 156 virtual int deserialize(unsigned char *inbuffer)
Jeonghoon 3:2a3664dc6634 157 {
Jeonghoon 3:2a3664dc6634 158 int offset = 0;
Jeonghoon 3:2a3664dc6634 159 offset += this->header.deserialize(inbuffer + offset);
Jeonghoon 3:2a3664dc6634 160 this->height = ((uint32_t) (*(inbuffer + offset)));
Jeonghoon 3:2a3664dc6634 161 this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
Jeonghoon 3:2a3664dc6634 162 this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
Jeonghoon 3:2a3664dc6634 163 this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
Jeonghoon 3:2a3664dc6634 164 offset += sizeof(this->height);
Jeonghoon 3:2a3664dc6634 165 this->width = ((uint32_t) (*(inbuffer + offset)));
Jeonghoon 3:2a3664dc6634 166 this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
Jeonghoon 3:2a3664dc6634 167 this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
Jeonghoon 3:2a3664dc6634 168 this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
Jeonghoon 3:2a3664dc6634 169 offset += sizeof(this->width);
Jeonghoon 3:2a3664dc6634 170 uint32_t length_distortion_model;
Jeonghoon 3:2a3664dc6634 171 arrToVar(length_distortion_model, (inbuffer + offset));
Jeonghoon 3:2a3664dc6634 172 offset += 4;
Jeonghoon 3:2a3664dc6634 173 for(unsigned int k= offset; k< offset+length_distortion_model; ++k){
Jeonghoon 3:2a3664dc6634 174 inbuffer[k-1]=inbuffer[k];
Jeonghoon 3:2a3664dc6634 175 }
Jeonghoon 3:2a3664dc6634 176 inbuffer[offset+length_distortion_model-1]=0;
Jeonghoon 3:2a3664dc6634 177 this->distortion_model = (char *)(inbuffer + offset-1);
Jeonghoon 3:2a3664dc6634 178 offset += length_distortion_model;
Jeonghoon 3:2a3664dc6634 179 uint32_t D_lengthT = ((uint32_t) (*(inbuffer + offset)));
Jeonghoon 3:2a3664dc6634 180 D_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
Jeonghoon 3:2a3664dc6634 181 D_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
Jeonghoon 3:2a3664dc6634 182 D_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
Jeonghoon 3:2a3664dc6634 183 offset += sizeof(this->D_length);
Jeonghoon 3:2a3664dc6634 184 if(D_lengthT > D_length)
Jeonghoon 3:2a3664dc6634 185 this->D = (double*)realloc(this->D, D_lengthT * sizeof(double));
Jeonghoon 3:2a3664dc6634 186 D_length = D_lengthT;
Jeonghoon 3:2a3664dc6634 187 for( uint32_t i = 0; i < D_length; i++){
Jeonghoon 3:2a3664dc6634 188 union {
Jeonghoon 3:2a3664dc6634 189 double real;
Jeonghoon 3:2a3664dc6634 190 uint64_t base;
Jeonghoon 3:2a3664dc6634 191 } u_st_D;
Jeonghoon 3:2a3664dc6634 192 u_st_D.base = 0;
Jeonghoon 3:2a3664dc6634 193 u_st_D.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
Jeonghoon 3:2a3664dc6634 194 u_st_D.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
Jeonghoon 3:2a3664dc6634 195 u_st_D.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
Jeonghoon 3:2a3664dc6634 196 u_st_D.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
Jeonghoon 3:2a3664dc6634 197 u_st_D.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
Jeonghoon 3:2a3664dc6634 198 u_st_D.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
Jeonghoon 3:2a3664dc6634 199 u_st_D.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
Jeonghoon 3:2a3664dc6634 200 u_st_D.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
Jeonghoon 3:2a3664dc6634 201 this->st_D = u_st_D.real;
Jeonghoon 3:2a3664dc6634 202 offset += sizeof(this->st_D);
Jeonghoon 3:2a3664dc6634 203 memcpy( &(this->D[i]), &(this->st_D), sizeof(double));
Jeonghoon 3:2a3664dc6634 204 }
Jeonghoon 3:2a3664dc6634 205 for( uint32_t i = 0; i < 9; i++){
Jeonghoon 3:2a3664dc6634 206 union {
Jeonghoon 3:2a3664dc6634 207 double real;
Jeonghoon 3:2a3664dc6634 208 uint64_t base;
Jeonghoon 3:2a3664dc6634 209 } u_Ki;
Jeonghoon 3:2a3664dc6634 210 u_Ki.base = 0;
Jeonghoon 3:2a3664dc6634 211 u_Ki.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
Jeonghoon 3:2a3664dc6634 212 u_Ki.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
Jeonghoon 3:2a3664dc6634 213 u_Ki.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
Jeonghoon 3:2a3664dc6634 214 u_Ki.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
Jeonghoon 3:2a3664dc6634 215 u_Ki.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
Jeonghoon 3:2a3664dc6634 216 u_Ki.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
Jeonghoon 3:2a3664dc6634 217 u_Ki.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
Jeonghoon 3:2a3664dc6634 218 u_Ki.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
Jeonghoon 3:2a3664dc6634 219 this->K[i] = u_Ki.real;
Jeonghoon 3:2a3664dc6634 220 offset += sizeof(this->K[i]);
Jeonghoon 3:2a3664dc6634 221 }
Jeonghoon 3:2a3664dc6634 222 for( uint32_t i = 0; i < 9; i++){
Jeonghoon 3:2a3664dc6634 223 union {
Jeonghoon 3:2a3664dc6634 224 double real;
Jeonghoon 3:2a3664dc6634 225 uint64_t base;
Jeonghoon 3:2a3664dc6634 226 } u_Ri;
Jeonghoon 3:2a3664dc6634 227 u_Ri.base = 0;
Jeonghoon 3:2a3664dc6634 228 u_Ri.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
Jeonghoon 3:2a3664dc6634 229 u_Ri.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
Jeonghoon 3:2a3664dc6634 230 u_Ri.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
Jeonghoon 3:2a3664dc6634 231 u_Ri.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
Jeonghoon 3:2a3664dc6634 232 u_Ri.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
Jeonghoon 3:2a3664dc6634 233 u_Ri.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
Jeonghoon 3:2a3664dc6634 234 u_Ri.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
Jeonghoon 3:2a3664dc6634 235 u_Ri.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
Jeonghoon 3:2a3664dc6634 236 this->R[i] = u_Ri.real;
Jeonghoon 3:2a3664dc6634 237 offset += sizeof(this->R[i]);
Jeonghoon 3:2a3664dc6634 238 }
Jeonghoon 3:2a3664dc6634 239 for( uint32_t i = 0; i < 12; i++){
Jeonghoon 3:2a3664dc6634 240 union {
Jeonghoon 3:2a3664dc6634 241 double real;
Jeonghoon 3:2a3664dc6634 242 uint64_t base;
Jeonghoon 3:2a3664dc6634 243 } u_Pi;
Jeonghoon 3:2a3664dc6634 244 u_Pi.base = 0;
Jeonghoon 3:2a3664dc6634 245 u_Pi.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
Jeonghoon 3:2a3664dc6634 246 u_Pi.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
Jeonghoon 3:2a3664dc6634 247 u_Pi.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
Jeonghoon 3:2a3664dc6634 248 u_Pi.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
Jeonghoon 3:2a3664dc6634 249 u_Pi.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
Jeonghoon 3:2a3664dc6634 250 u_Pi.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
Jeonghoon 3:2a3664dc6634 251 u_Pi.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
Jeonghoon 3:2a3664dc6634 252 u_Pi.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
Jeonghoon 3:2a3664dc6634 253 this->P[i] = u_Pi.real;
Jeonghoon 3:2a3664dc6634 254 offset += sizeof(this->P[i]);
Jeonghoon 3:2a3664dc6634 255 }
Jeonghoon 3:2a3664dc6634 256 this->binning_x = ((uint32_t) (*(inbuffer + offset)));
Jeonghoon 3:2a3664dc6634 257 this->binning_x |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
Jeonghoon 3:2a3664dc6634 258 this->binning_x |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
Jeonghoon 3:2a3664dc6634 259 this->binning_x |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
Jeonghoon 3:2a3664dc6634 260 offset += sizeof(this->binning_x);
Jeonghoon 3:2a3664dc6634 261 this->binning_y = ((uint32_t) (*(inbuffer + offset)));
Jeonghoon 3:2a3664dc6634 262 this->binning_y |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
Jeonghoon 3:2a3664dc6634 263 this->binning_y |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
Jeonghoon 3:2a3664dc6634 264 this->binning_y |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
Jeonghoon 3:2a3664dc6634 265 offset += sizeof(this->binning_y);
Jeonghoon 3:2a3664dc6634 266 offset += this->roi.deserialize(inbuffer + offset);
Jeonghoon 3:2a3664dc6634 267 return offset;
Jeonghoon 3:2a3664dc6634 268 }
Jeonghoon 3:2a3664dc6634 269
Jeonghoon 3:2a3664dc6634 270 const char * getType(){ return "sensor_msgs/CameraInfo"; };
Jeonghoon 3:2a3664dc6634 271 const char * getMD5(){ return "c9a58c1b0b154e0e6da7578cb991d214"; };
Jeonghoon 3:2a3664dc6634 272
Jeonghoon 3:2a3664dc6634 273 };
Jeonghoon 3:2a3664dc6634 274
Jeonghoon 3:2a3664dc6634 275 }
Jeonghoon 3:2a3664dc6634 276 #endif