ROS Serial library for Mbed platforms for ROS Melodic Morenia. Check http://wiki.ros.org/rosserial_mbed/ for more information.
sensor_msgs/MultiEchoLaserScan.h@2:fa426560b283, 2021-05-27 (annotated)
- Committer:
- krogedal
- Date:
- Thu May 27 19:25:46 2021 +0000
- Revision:
- 2:fa426560b283
- Parent:
- 0:04ac6be8229a
no change
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Gary Servin |
0:04ac6be8229a | 1 | #ifndef _ROS_sensor_msgs_MultiEchoLaserScan_h |
Gary Servin |
0:04ac6be8229a | 2 | #define _ROS_sensor_msgs_MultiEchoLaserScan_h |
Gary Servin |
0:04ac6be8229a | 3 | |
Gary Servin |
0:04ac6be8229a | 4 | #include <stdint.h> |
Gary Servin |
0:04ac6be8229a | 5 | #include <string.h> |
Gary Servin |
0:04ac6be8229a | 6 | #include <stdlib.h> |
Gary Servin |
0:04ac6be8229a | 7 | #include "ros/msg.h" |
Gary Servin |
0:04ac6be8229a | 8 | #include "std_msgs/Header.h" |
Gary Servin |
0:04ac6be8229a | 9 | #include "sensor_msgs/LaserEcho.h" |
Gary Servin |
0:04ac6be8229a | 10 | |
Gary Servin |
0:04ac6be8229a | 11 | namespace sensor_msgs |
Gary Servin |
0:04ac6be8229a | 12 | { |
Gary Servin |
0:04ac6be8229a | 13 | |
Gary Servin |
0:04ac6be8229a | 14 | class MultiEchoLaserScan : public ros::Msg |
Gary Servin |
0:04ac6be8229a | 15 | { |
Gary Servin |
0:04ac6be8229a | 16 | public: |
Gary Servin |
0:04ac6be8229a | 17 | typedef std_msgs::Header _header_type; |
Gary Servin |
0:04ac6be8229a | 18 | _header_type header; |
Gary Servin |
0:04ac6be8229a | 19 | typedef float _angle_min_type; |
Gary Servin |
0:04ac6be8229a | 20 | _angle_min_type angle_min; |
Gary Servin |
0:04ac6be8229a | 21 | typedef float _angle_max_type; |
Gary Servin |
0:04ac6be8229a | 22 | _angle_max_type angle_max; |
Gary Servin |
0:04ac6be8229a | 23 | typedef float _angle_increment_type; |
Gary Servin |
0:04ac6be8229a | 24 | _angle_increment_type angle_increment; |
Gary Servin |
0:04ac6be8229a | 25 | typedef float _time_increment_type; |
Gary Servin |
0:04ac6be8229a | 26 | _time_increment_type time_increment; |
Gary Servin |
0:04ac6be8229a | 27 | typedef float _scan_time_type; |
Gary Servin |
0:04ac6be8229a | 28 | _scan_time_type scan_time; |
Gary Servin |
0:04ac6be8229a | 29 | typedef float _range_min_type; |
Gary Servin |
0:04ac6be8229a | 30 | _range_min_type range_min; |
Gary Servin |
0:04ac6be8229a | 31 | typedef float _range_max_type; |
Gary Servin |
0:04ac6be8229a | 32 | _range_max_type range_max; |
Gary Servin |
0:04ac6be8229a | 33 | uint32_t ranges_length; |
Gary Servin |
0:04ac6be8229a | 34 | typedef sensor_msgs::LaserEcho _ranges_type; |
Gary Servin |
0:04ac6be8229a | 35 | _ranges_type st_ranges; |
Gary Servin |
0:04ac6be8229a | 36 | _ranges_type * ranges; |
Gary Servin |
0:04ac6be8229a | 37 | uint32_t intensities_length; |
Gary Servin |
0:04ac6be8229a | 38 | typedef sensor_msgs::LaserEcho _intensities_type; |
Gary Servin |
0:04ac6be8229a | 39 | _intensities_type st_intensities; |
Gary Servin |
0:04ac6be8229a | 40 | _intensities_type * intensities; |
Gary Servin |
0:04ac6be8229a | 41 | |
Gary Servin |
0:04ac6be8229a | 42 | MultiEchoLaserScan(): |
Gary Servin |
0:04ac6be8229a | 43 | header(), |
Gary Servin |
0:04ac6be8229a | 44 | angle_min(0), |
Gary Servin |
0:04ac6be8229a | 45 | angle_max(0), |
Gary Servin |
0:04ac6be8229a | 46 | angle_increment(0), |
Gary Servin |
0:04ac6be8229a | 47 | time_increment(0), |
Gary Servin |
0:04ac6be8229a | 48 | scan_time(0), |
Gary Servin |
0:04ac6be8229a | 49 | range_min(0), |
Gary Servin |
0:04ac6be8229a | 50 | range_max(0), |
Gary Servin |
0:04ac6be8229a | 51 | ranges_length(0), ranges(NULL), |
Gary Servin |
0:04ac6be8229a | 52 | intensities_length(0), intensities(NULL) |
Gary Servin |
0:04ac6be8229a | 53 | { |
Gary Servin |
0:04ac6be8229a | 54 | } |
Gary Servin |
0:04ac6be8229a | 55 | |
Gary Servin |
0:04ac6be8229a | 56 | virtual int serialize(unsigned char *outbuffer) const |
Gary Servin |
0:04ac6be8229a | 57 | { |
Gary Servin |
0:04ac6be8229a | 58 | int offset = 0; |
Gary Servin |
0:04ac6be8229a | 59 | offset += this->header.serialize(outbuffer + offset); |
Gary Servin |
0:04ac6be8229a | 60 | union { |
Gary Servin |
0:04ac6be8229a | 61 | float real; |
Gary Servin |
0:04ac6be8229a | 62 | uint32_t base; |
Gary Servin |
0:04ac6be8229a | 63 | } u_angle_min; |
Gary Servin |
0:04ac6be8229a | 64 | u_angle_min.real = this->angle_min; |
Gary Servin |
0:04ac6be8229a | 65 | *(outbuffer + offset + 0) = (u_angle_min.base >> (8 * 0)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 66 | *(outbuffer + offset + 1) = (u_angle_min.base >> (8 * 1)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 67 | *(outbuffer + offset + 2) = (u_angle_min.base >> (8 * 2)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 68 | *(outbuffer + offset + 3) = (u_angle_min.base >> (8 * 3)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 69 | offset += sizeof(this->angle_min); |
Gary Servin |
0:04ac6be8229a | 70 | union { |
Gary Servin |
0:04ac6be8229a | 71 | float real; |
Gary Servin |
0:04ac6be8229a | 72 | uint32_t base; |
Gary Servin |
0:04ac6be8229a | 73 | } u_angle_max; |
Gary Servin |
0:04ac6be8229a | 74 | u_angle_max.real = this->angle_max; |
Gary Servin |
0:04ac6be8229a | 75 | *(outbuffer + offset + 0) = (u_angle_max.base >> (8 * 0)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 76 | *(outbuffer + offset + 1) = (u_angle_max.base >> (8 * 1)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 77 | *(outbuffer + offset + 2) = (u_angle_max.base >> (8 * 2)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 78 | *(outbuffer + offset + 3) = (u_angle_max.base >> (8 * 3)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 79 | offset += sizeof(this->angle_max); |
Gary Servin |
0:04ac6be8229a | 80 | union { |
Gary Servin |
0:04ac6be8229a | 81 | float real; |
Gary Servin |
0:04ac6be8229a | 82 | uint32_t base; |
Gary Servin |
0:04ac6be8229a | 83 | } u_angle_increment; |
Gary Servin |
0:04ac6be8229a | 84 | u_angle_increment.real = this->angle_increment; |
Gary Servin |
0:04ac6be8229a | 85 | *(outbuffer + offset + 0) = (u_angle_increment.base >> (8 * 0)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 86 | *(outbuffer + offset + 1) = (u_angle_increment.base >> (8 * 1)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 87 | *(outbuffer + offset + 2) = (u_angle_increment.base >> (8 * 2)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 88 | *(outbuffer + offset + 3) = (u_angle_increment.base >> (8 * 3)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 89 | offset += sizeof(this->angle_increment); |
Gary Servin |
0:04ac6be8229a | 90 | union { |
Gary Servin |
0:04ac6be8229a | 91 | float real; |
Gary Servin |
0:04ac6be8229a | 92 | uint32_t base; |
Gary Servin |
0:04ac6be8229a | 93 | } u_time_increment; |
Gary Servin |
0:04ac6be8229a | 94 | u_time_increment.real = this->time_increment; |
Gary Servin |
0:04ac6be8229a | 95 | *(outbuffer + offset + 0) = (u_time_increment.base >> (8 * 0)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 96 | *(outbuffer + offset + 1) = (u_time_increment.base >> (8 * 1)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 97 | *(outbuffer + offset + 2) = (u_time_increment.base >> (8 * 2)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 98 | *(outbuffer + offset + 3) = (u_time_increment.base >> (8 * 3)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 99 | offset += sizeof(this->time_increment); |
Gary Servin |
0:04ac6be8229a | 100 | union { |
Gary Servin |
0:04ac6be8229a | 101 | float real; |
Gary Servin |
0:04ac6be8229a | 102 | uint32_t base; |
Gary Servin |
0:04ac6be8229a | 103 | } u_scan_time; |
Gary Servin |
0:04ac6be8229a | 104 | u_scan_time.real = this->scan_time; |
Gary Servin |
0:04ac6be8229a | 105 | *(outbuffer + offset + 0) = (u_scan_time.base >> (8 * 0)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 106 | *(outbuffer + offset + 1) = (u_scan_time.base >> (8 * 1)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 107 | *(outbuffer + offset + 2) = (u_scan_time.base >> (8 * 2)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 108 | *(outbuffer + offset + 3) = (u_scan_time.base >> (8 * 3)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 109 | offset += sizeof(this->scan_time); |
Gary Servin |
0:04ac6be8229a | 110 | union { |
Gary Servin |
0:04ac6be8229a | 111 | float real; |
Gary Servin |
0:04ac6be8229a | 112 | uint32_t base; |
Gary Servin |
0:04ac6be8229a | 113 | } u_range_min; |
Gary Servin |
0:04ac6be8229a | 114 | u_range_min.real = this->range_min; |
Gary Servin |
0:04ac6be8229a | 115 | *(outbuffer + offset + 0) = (u_range_min.base >> (8 * 0)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 116 | *(outbuffer + offset + 1) = (u_range_min.base >> (8 * 1)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 117 | *(outbuffer + offset + 2) = (u_range_min.base >> (8 * 2)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 118 | *(outbuffer + offset + 3) = (u_range_min.base >> (8 * 3)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 119 | offset += sizeof(this->range_min); |
Gary Servin |
0:04ac6be8229a | 120 | union { |
Gary Servin |
0:04ac6be8229a | 121 | float real; |
Gary Servin |
0:04ac6be8229a | 122 | uint32_t base; |
Gary Servin |
0:04ac6be8229a | 123 | } u_range_max; |
Gary Servin |
0:04ac6be8229a | 124 | u_range_max.real = this->range_max; |
Gary Servin |
0:04ac6be8229a | 125 | *(outbuffer + offset + 0) = (u_range_max.base >> (8 * 0)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 126 | *(outbuffer + offset + 1) = (u_range_max.base >> (8 * 1)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 127 | *(outbuffer + offset + 2) = (u_range_max.base >> (8 * 2)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 128 | *(outbuffer + offset + 3) = (u_range_max.base >> (8 * 3)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 129 | offset += sizeof(this->range_max); |
Gary Servin |
0:04ac6be8229a | 130 | *(outbuffer + offset + 0) = (this->ranges_length >> (8 * 0)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 131 | *(outbuffer + offset + 1) = (this->ranges_length >> (8 * 1)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 132 | *(outbuffer + offset + 2) = (this->ranges_length >> (8 * 2)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 133 | *(outbuffer + offset + 3) = (this->ranges_length >> (8 * 3)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 134 | offset += sizeof(this->ranges_length); |
Gary Servin |
0:04ac6be8229a | 135 | for( uint32_t i = 0; i < ranges_length; i++){ |
Gary Servin |
0:04ac6be8229a | 136 | offset += this->ranges[i].serialize(outbuffer + offset); |
Gary Servin |
0:04ac6be8229a | 137 | } |
Gary Servin |
0:04ac6be8229a | 138 | *(outbuffer + offset + 0) = (this->intensities_length >> (8 * 0)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 139 | *(outbuffer + offset + 1) = (this->intensities_length >> (8 * 1)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 140 | *(outbuffer + offset + 2) = (this->intensities_length >> (8 * 2)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 141 | *(outbuffer + offset + 3) = (this->intensities_length >> (8 * 3)) & 0xFF; |
Gary Servin |
0:04ac6be8229a | 142 | offset += sizeof(this->intensities_length); |
Gary Servin |
0:04ac6be8229a | 143 | for( uint32_t i = 0; i < intensities_length; i++){ |
Gary Servin |
0:04ac6be8229a | 144 | offset += this->intensities[i].serialize(outbuffer + offset); |
Gary Servin |
0:04ac6be8229a | 145 | } |
Gary Servin |
0:04ac6be8229a | 146 | return offset; |
Gary Servin |
0:04ac6be8229a | 147 | } |
Gary Servin |
0:04ac6be8229a | 148 | |
Gary Servin |
0:04ac6be8229a | 149 | virtual int deserialize(unsigned char *inbuffer) |
Gary Servin |
0:04ac6be8229a | 150 | { |
Gary Servin |
0:04ac6be8229a | 151 | int offset = 0; |
Gary Servin |
0:04ac6be8229a | 152 | offset += this->header.deserialize(inbuffer + offset); |
Gary Servin |
0:04ac6be8229a | 153 | union { |
Gary Servin |
0:04ac6be8229a | 154 | float real; |
Gary Servin |
0:04ac6be8229a | 155 | uint32_t base; |
Gary Servin |
0:04ac6be8229a | 156 | } u_angle_min; |
Gary Servin |
0:04ac6be8229a | 157 | u_angle_min.base = 0; |
Gary Servin |
0:04ac6be8229a | 158 | u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
Gary Servin |
0:04ac6be8229a | 159 | u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
Gary Servin |
0:04ac6be8229a | 160 | u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
Gary Servin |
0:04ac6be8229a | 161 | u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
Gary Servin |
0:04ac6be8229a | 162 | this->angle_min = u_angle_min.real; |
Gary Servin |
0:04ac6be8229a | 163 | offset += sizeof(this->angle_min); |
Gary Servin |
0:04ac6be8229a | 164 | union { |
Gary Servin |
0:04ac6be8229a | 165 | float real; |
Gary Servin |
0:04ac6be8229a | 166 | uint32_t base; |
Gary Servin |
0:04ac6be8229a | 167 | } u_angle_max; |
Gary Servin |
0:04ac6be8229a | 168 | u_angle_max.base = 0; |
Gary Servin |
0:04ac6be8229a | 169 | u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
Gary Servin |
0:04ac6be8229a | 170 | u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
Gary Servin |
0:04ac6be8229a | 171 | u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
Gary Servin |
0:04ac6be8229a | 172 | u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
Gary Servin |
0:04ac6be8229a | 173 | this->angle_max = u_angle_max.real; |
Gary Servin |
0:04ac6be8229a | 174 | offset += sizeof(this->angle_max); |
Gary Servin |
0:04ac6be8229a | 175 | union { |
Gary Servin |
0:04ac6be8229a | 176 | float real; |
Gary Servin |
0:04ac6be8229a | 177 | uint32_t base; |
Gary Servin |
0:04ac6be8229a | 178 | } u_angle_increment; |
Gary Servin |
0:04ac6be8229a | 179 | u_angle_increment.base = 0; |
Gary Servin |
0:04ac6be8229a | 180 | u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
Gary Servin |
0:04ac6be8229a | 181 | u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
Gary Servin |
0:04ac6be8229a | 182 | u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
Gary Servin |
0:04ac6be8229a | 183 | u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
Gary Servin |
0:04ac6be8229a | 184 | this->angle_increment = u_angle_increment.real; |
Gary Servin |
0:04ac6be8229a | 185 | offset += sizeof(this->angle_increment); |
Gary Servin |
0:04ac6be8229a | 186 | union { |
Gary Servin |
0:04ac6be8229a | 187 | float real; |
Gary Servin |
0:04ac6be8229a | 188 | uint32_t base; |
Gary Servin |
0:04ac6be8229a | 189 | } u_time_increment; |
Gary Servin |
0:04ac6be8229a | 190 | u_time_increment.base = 0; |
Gary Servin |
0:04ac6be8229a | 191 | u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
Gary Servin |
0:04ac6be8229a | 192 | u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
Gary Servin |
0:04ac6be8229a | 193 | u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
Gary Servin |
0:04ac6be8229a | 194 | u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
Gary Servin |
0:04ac6be8229a | 195 | this->time_increment = u_time_increment.real; |
Gary Servin |
0:04ac6be8229a | 196 | offset += sizeof(this->time_increment); |
Gary Servin |
0:04ac6be8229a | 197 | union { |
Gary Servin |
0:04ac6be8229a | 198 | float real; |
Gary Servin |
0:04ac6be8229a | 199 | uint32_t base; |
Gary Servin |
0:04ac6be8229a | 200 | } u_scan_time; |
Gary Servin |
0:04ac6be8229a | 201 | u_scan_time.base = 0; |
Gary Servin |
0:04ac6be8229a | 202 | u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
Gary Servin |
0:04ac6be8229a | 203 | u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
Gary Servin |
0:04ac6be8229a | 204 | u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
Gary Servin |
0:04ac6be8229a | 205 | u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
Gary Servin |
0:04ac6be8229a | 206 | this->scan_time = u_scan_time.real; |
Gary Servin |
0:04ac6be8229a | 207 | offset += sizeof(this->scan_time); |
Gary Servin |
0:04ac6be8229a | 208 | union { |
Gary Servin |
0:04ac6be8229a | 209 | float real; |
Gary Servin |
0:04ac6be8229a | 210 | uint32_t base; |
Gary Servin |
0:04ac6be8229a | 211 | } u_range_min; |
Gary Servin |
0:04ac6be8229a | 212 | u_range_min.base = 0; |
Gary Servin |
0:04ac6be8229a | 213 | u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
Gary Servin |
0:04ac6be8229a | 214 | u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
Gary Servin |
0:04ac6be8229a | 215 | u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
Gary Servin |
0:04ac6be8229a | 216 | u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
Gary Servin |
0:04ac6be8229a | 217 | this->range_min = u_range_min.real; |
Gary Servin |
0:04ac6be8229a | 218 | offset += sizeof(this->range_min); |
Gary Servin |
0:04ac6be8229a | 219 | union { |
Gary Servin |
0:04ac6be8229a | 220 | float real; |
Gary Servin |
0:04ac6be8229a | 221 | uint32_t base; |
Gary Servin |
0:04ac6be8229a | 222 | } u_range_max; |
Gary Servin |
0:04ac6be8229a | 223 | u_range_max.base = 0; |
Gary Servin |
0:04ac6be8229a | 224 | u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
Gary Servin |
0:04ac6be8229a | 225 | u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
Gary Servin |
0:04ac6be8229a | 226 | u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
Gary Servin |
0:04ac6be8229a | 227 | u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
Gary Servin |
0:04ac6be8229a | 228 | this->range_max = u_range_max.real; |
Gary Servin |
0:04ac6be8229a | 229 | offset += sizeof(this->range_max); |
Gary Servin |
0:04ac6be8229a | 230 | uint32_t ranges_lengthT = ((uint32_t) (*(inbuffer + offset))); |
Gary Servin |
0:04ac6be8229a | 231 | ranges_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
Gary Servin |
0:04ac6be8229a | 232 | ranges_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
Gary Servin |
0:04ac6be8229a | 233 | ranges_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
Gary Servin |
0:04ac6be8229a | 234 | offset += sizeof(this->ranges_length); |
Gary Servin |
0:04ac6be8229a | 235 | if(ranges_lengthT > ranges_length) |
Gary Servin |
0:04ac6be8229a | 236 | this->ranges = (sensor_msgs::LaserEcho*)realloc(this->ranges, ranges_lengthT * sizeof(sensor_msgs::LaserEcho)); |
Gary Servin |
0:04ac6be8229a | 237 | ranges_length = ranges_lengthT; |
Gary Servin |
0:04ac6be8229a | 238 | for( uint32_t i = 0; i < ranges_length; i++){ |
Gary Servin |
0:04ac6be8229a | 239 | offset += this->st_ranges.deserialize(inbuffer + offset); |
Gary Servin |
0:04ac6be8229a | 240 | memcpy( &(this->ranges[i]), &(this->st_ranges), sizeof(sensor_msgs::LaserEcho)); |
Gary Servin |
0:04ac6be8229a | 241 | } |
Gary Servin |
0:04ac6be8229a | 242 | uint32_t intensities_lengthT = ((uint32_t) (*(inbuffer + offset))); |
Gary Servin |
0:04ac6be8229a | 243 | intensities_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
Gary Servin |
0:04ac6be8229a | 244 | intensities_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
Gary Servin |
0:04ac6be8229a | 245 | intensities_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
Gary Servin |
0:04ac6be8229a | 246 | offset += sizeof(this->intensities_length); |
Gary Servin |
0:04ac6be8229a | 247 | if(intensities_lengthT > intensities_length) |
Gary Servin |
0:04ac6be8229a | 248 | this->intensities = (sensor_msgs::LaserEcho*)realloc(this->intensities, intensities_lengthT * sizeof(sensor_msgs::LaserEcho)); |
Gary Servin |
0:04ac6be8229a | 249 | intensities_length = intensities_lengthT; |
Gary Servin |
0:04ac6be8229a | 250 | for( uint32_t i = 0; i < intensities_length; i++){ |
Gary Servin |
0:04ac6be8229a | 251 | offset += this->st_intensities.deserialize(inbuffer + offset); |
Gary Servin |
0:04ac6be8229a | 252 | memcpy( &(this->intensities[i]), &(this->st_intensities), sizeof(sensor_msgs::LaserEcho)); |
Gary Servin |
0:04ac6be8229a | 253 | } |
Gary Servin |
0:04ac6be8229a | 254 | return offset; |
Gary Servin |
0:04ac6be8229a | 255 | } |
Gary Servin |
0:04ac6be8229a | 256 | |
Gary Servin |
0:04ac6be8229a | 257 | const char * getType(){ return "sensor_msgs/MultiEchoLaserScan"; }; |
Gary Servin |
0:04ac6be8229a | 258 | const char * getMD5(){ return "6fefb0c6da89d7c8abe4b339f5c2f8fb"; }; |
Gary Servin |
0:04ac6be8229a | 259 | |
Gary Servin |
0:04ac6be8229a | 260 | }; |
Gary Servin |
0:04ac6be8229a | 261 | |
Gary Servin |
0:04ac6be8229a | 262 | } |
Gary Servin |
0:04ac6be8229a | 263 | #endif |