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