1 #ifndef _ROS_sensor_msgs_CameraInfo_h
2 #define _ROS_sensor_msgs_CameraInfo_h
46 virtual int serialize(
unsigned char *outbuffer)
const
50 *(outbuffer + offset + 0) = (this->
height >> (8 * 0)) & 0xFF;
51 *(outbuffer + offset + 1) = (this->
height >> (8 * 1)) & 0xFF;
52 *(outbuffer + offset + 2) = (this->
height >> (8 * 2)) & 0xFF;
53 *(outbuffer + offset + 3) = (this->
height >> (8 * 3)) & 0xFF;
54 offset +=
sizeof(this->
height);
55 *(outbuffer + offset + 0) = (this->
width >> (8 * 0)) & 0xFF;
56 *(outbuffer + offset + 1) = (this->
width >> (8 * 1)) & 0xFF;
57 *(outbuffer + offset + 2) = (this->
width >> (8 * 2)) & 0xFF;
58 *(outbuffer + offset + 3) = (this->
width >> (8 * 3)) & 0xFF;
59 offset +=
sizeof(this->
width);
61 memcpy(outbuffer + offset, &length_distortion_model,
sizeof(uint32_t));
64 offset += length_distortion_model;
66 *(outbuffer + offset++) = 0;
67 *(outbuffer + offset++) = 0;
68 *(outbuffer + offset++) = 0;
69 for( uint8_t i = 0; i <
D_length; i++){
72 for( uint8_t i = 0; i < 9; i++){
75 for( uint8_t i = 0; i < 9; i++){
78 for( uint8_t i = 0; i < 12; i++){
81 *(outbuffer + offset + 0) = (this->
binning_x >> (8 * 0)) & 0xFF;
82 *(outbuffer + offset + 1) = (this->
binning_x >> (8 * 1)) & 0xFF;
83 *(outbuffer + offset + 2) = (this->
binning_x >> (8 * 2)) & 0xFF;
84 *(outbuffer + offset + 3) = (this->
binning_x >> (8 * 3)) & 0xFF;
86 *(outbuffer + offset + 0) = (this->
binning_y >> (8 * 0)) & 0xFF;
87 *(outbuffer + offset + 1) = (this->
binning_y >> (8 * 1)) & 0xFF;
88 *(outbuffer + offset + 2) = (this->
binning_y >> (8 * 2)) & 0xFF;
89 *(outbuffer + offset + 3) = (this->
binning_y >> (8 * 3)) & 0xFF;
99 this->
height = ((uint32_t) (*(inbuffer + offset)));
100 this->
height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
101 this->
height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
102 this->
height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
103 offset +=
sizeof(this->
height);
104 this->
width = ((uint32_t) (*(inbuffer + offset)));
105 this->
width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
106 this->
width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
107 this->
width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
108 offset +=
sizeof(this->
width);
109 uint32_t length_distortion_model;
110 memcpy(&length_distortion_model, (inbuffer + offset),
sizeof(uint32_t));
112 for(
unsigned int k= offset; k< offset+length_distortion_model; ++k){
113 inbuffer[k-1]=inbuffer[k];
115 inbuffer[offset+length_distortion_model-1]=0;
117 offset += length_distortion_model;
118 uint8_t D_lengthT = *(inbuffer + offset++);
120 this->
D = (
float*)realloc(this->
D, D_lengthT *
sizeof(
float));
123 for( uint8_t i = 0; i <
D_length; i++){
125 memcpy( &(this->
D[i]), &(this->
st_D),
sizeof(
float));
127 for( uint8_t i = 0; i < 9; i++){
130 for( uint8_t i = 0; i < 9; i++){
133 for( uint8_t i = 0; i < 12; i++){
136 this->
binning_x = ((uint32_t) (*(inbuffer + offset)));
137 this->
binning_x |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
138 this->
binning_x |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
139 this->
binning_x |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
141 this->
binning_y = ((uint32_t) (*(inbuffer + offset)));
142 this->
binning_y |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
143 this->
binning_y |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
144 this->
binning_y |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
150 const char *
getType(){
return "sensor_msgs/CameraInfo"; };
151 const char *
getMD5(){
return "c9a58c1b0b154e0e6da7578cb991d214"; };
Definition: CameraInfo.h:14
CameraInfo()
Definition: CameraInfo.h:31
const char * getType()
Definition: CameraInfo.h:150
static int serializeAvrFloat64(unsigned char *outbuffer, const float f)
This tricky function handles promoting a 32bit float to a 64bit double, so that AVR can publish messa...
Definition: msg.h:62
uint32_t binning_y
Definition: CameraInfo.h:28
uint32_t width
Definition: CameraInfo.h:19
float P[12]
Definition: CameraInfo.h:26
uint32_t binning_x
Definition: CameraInfo.h:27
virtual int deserialize(unsigned char *inbuffer)
Definition: RegionOfInterest.h:63
virtual int deserialize(unsigned char *inbuffer)
Definition: CameraInfo.h:95
std_msgs::Header header
Definition: CameraInfo.h:17
const char * distortion_model
Definition: CameraInfo.h:20
virtual int serialize(unsigned char *outbuffer) const
Definition: CameraInfo.h:46
uint8_t D_length
Definition: CameraInfo.h:21
float st_D
Definition: CameraInfo.h:22
Definition: RegionOfInterest.h:12
float R[9]
Definition: CameraInfo.h:25
sensor_msgs::RegionOfInterest roi
Definition: CameraInfo.h:29
float * D
Definition: CameraInfo.h:23
uint32_t height
Definition: CameraInfo.h:18
virtual int serialize(unsigned char *outbuffer) const
Definition: RegionOfInterest.h:30
static int deserializeAvrFloat64(const unsigned char *inbuffer, float *f)
This tricky function handles demoting a 64bit double to a 32bit float, so that AVR can understand mes...
Definition: msg.h:100
float K[9]
Definition: CameraInfo.h:24
const char * getMD5()
Definition: CameraInfo.h:151