hairo
Dependencies: mbed BufferedSerial
visualization_msgs/ImageMarker.h@4:bcdd99711326, 2018-12-04 (annotated)
- Committer:
- tknara
- Date:
- Tue Dec 04 00:14:32 2018 +0000
- Revision:
- 4:bcdd99711326
- Parent:
- 0:9e9b7db60fd5
test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
garyservin | 0:9e9b7db60fd5 | 1 | #ifndef _ROS_visualization_msgs_ImageMarker_h |
garyservin | 0:9e9b7db60fd5 | 2 | #define _ROS_visualization_msgs_ImageMarker_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 "geometry_msgs/Point.h" |
garyservin | 0:9e9b7db60fd5 | 10 | #include "std_msgs/ColorRGBA.h" |
garyservin | 0:9e9b7db60fd5 | 11 | #include "ros/duration.h" |
garyservin | 0:9e9b7db60fd5 | 12 | |
garyservin | 0:9e9b7db60fd5 | 13 | namespace visualization_msgs |
garyservin | 0:9e9b7db60fd5 | 14 | { |
garyservin | 0:9e9b7db60fd5 | 15 | |
garyservin | 0:9e9b7db60fd5 | 16 | class ImageMarker : public ros::Msg |
garyservin | 0:9e9b7db60fd5 | 17 | { |
garyservin | 0:9e9b7db60fd5 | 18 | public: |
garyservin | 0:9e9b7db60fd5 | 19 | typedef std_msgs::Header _header_type; |
garyservin | 0:9e9b7db60fd5 | 20 | _header_type header; |
garyservin | 0:9e9b7db60fd5 | 21 | typedef const char* _ns_type; |
garyservin | 0:9e9b7db60fd5 | 22 | _ns_type ns; |
garyservin | 0:9e9b7db60fd5 | 23 | typedef int32_t _id_type; |
garyservin | 0:9e9b7db60fd5 | 24 | _id_type id; |
garyservin | 0:9e9b7db60fd5 | 25 | typedef int32_t _type_type; |
garyservin | 0:9e9b7db60fd5 | 26 | _type_type type; |
garyservin | 0:9e9b7db60fd5 | 27 | typedef int32_t _action_type; |
garyservin | 0:9e9b7db60fd5 | 28 | _action_type action; |
garyservin | 0:9e9b7db60fd5 | 29 | typedef geometry_msgs::Point _position_type; |
garyservin | 0:9e9b7db60fd5 | 30 | _position_type position; |
garyservin | 0:9e9b7db60fd5 | 31 | typedef float _scale_type; |
garyservin | 0:9e9b7db60fd5 | 32 | _scale_type scale; |
garyservin | 0:9e9b7db60fd5 | 33 | typedef std_msgs::ColorRGBA _outline_color_type; |
garyservin | 0:9e9b7db60fd5 | 34 | _outline_color_type outline_color; |
garyservin | 0:9e9b7db60fd5 | 35 | typedef uint8_t _filled_type; |
garyservin | 0:9e9b7db60fd5 | 36 | _filled_type filled; |
garyservin | 0:9e9b7db60fd5 | 37 | typedef std_msgs::ColorRGBA _fill_color_type; |
garyservin | 0:9e9b7db60fd5 | 38 | _fill_color_type fill_color; |
garyservin | 0:9e9b7db60fd5 | 39 | typedef ros::Duration _lifetime_type; |
garyservin | 0:9e9b7db60fd5 | 40 | _lifetime_type lifetime; |
garyservin | 0:9e9b7db60fd5 | 41 | uint32_t points_length; |
garyservin | 0:9e9b7db60fd5 | 42 | typedef geometry_msgs::Point _points_type; |
garyservin | 0:9e9b7db60fd5 | 43 | _points_type st_points; |
garyservin | 0:9e9b7db60fd5 | 44 | _points_type * points; |
garyservin | 0:9e9b7db60fd5 | 45 | uint32_t outline_colors_length; |
garyservin | 0:9e9b7db60fd5 | 46 | typedef std_msgs::ColorRGBA _outline_colors_type; |
garyservin | 0:9e9b7db60fd5 | 47 | _outline_colors_type st_outline_colors; |
garyservin | 0:9e9b7db60fd5 | 48 | _outline_colors_type * outline_colors; |
garyservin | 0:9e9b7db60fd5 | 49 | enum { CIRCLE = 0 }; |
garyservin | 0:9e9b7db60fd5 | 50 | enum { LINE_STRIP = 1 }; |
garyservin | 0:9e9b7db60fd5 | 51 | enum { LINE_LIST = 2 }; |
garyservin | 0:9e9b7db60fd5 | 52 | enum { POLYGON = 3 }; |
garyservin | 0:9e9b7db60fd5 | 53 | enum { POINTS = 4 }; |
garyservin | 0:9e9b7db60fd5 | 54 | enum { ADD = 0 }; |
garyservin | 0:9e9b7db60fd5 | 55 | enum { REMOVE = 1 }; |
garyservin | 0:9e9b7db60fd5 | 56 | |
garyservin | 0:9e9b7db60fd5 | 57 | ImageMarker(): |
garyservin | 0:9e9b7db60fd5 | 58 | header(), |
garyservin | 0:9e9b7db60fd5 | 59 | ns(""), |
garyservin | 0:9e9b7db60fd5 | 60 | id(0), |
garyservin | 0:9e9b7db60fd5 | 61 | type(0), |
garyservin | 0:9e9b7db60fd5 | 62 | action(0), |
garyservin | 0:9e9b7db60fd5 | 63 | position(), |
garyservin | 0:9e9b7db60fd5 | 64 | scale(0), |
garyservin | 0:9e9b7db60fd5 | 65 | outline_color(), |
garyservin | 0:9e9b7db60fd5 | 66 | filled(0), |
garyservin | 0:9e9b7db60fd5 | 67 | fill_color(), |
garyservin | 0:9e9b7db60fd5 | 68 | lifetime(), |
garyservin | 0:9e9b7db60fd5 | 69 | points_length(0), points(NULL), |
garyservin | 0:9e9b7db60fd5 | 70 | outline_colors_length(0), outline_colors(NULL) |
garyservin | 0:9e9b7db60fd5 | 71 | { |
garyservin | 0:9e9b7db60fd5 | 72 | } |
garyservin | 0:9e9b7db60fd5 | 73 | |
garyservin | 0:9e9b7db60fd5 | 74 | virtual int serialize(unsigned char *outbuffer) const |
garyservin | 0:9e9b7db60fd5 | 75 | { |
garyservin | 0:9e9b7db60fd5 | 76 | int offset = 0; |
garyservin | 0:9e9b7db60fd5 | 77 | offset += this->header.serialize(outbuffer + offset); |
garyservin | 0:9e9b7db60fd5 | 78 | uint32_t length_ns = strlen(this->ns); |
garyservin | 0:9e9b7db60fd5 | 79 | varToArr(outbuffer + offset, length_ns); |
garyservin | 0:9e9b7db60fd5 | 80 | offset += 4; |
garyservin | 0:9e9b7db60fd5 | 81 | memcpy(outbuffer + offset, this->ns, length_ns); |
garyservin | 0:9e9b7db60fd5 | 82 | offset += length_ns; |
garyservin | 0:9e9b7db60fd5 | 83 | union { |
garyservin | 0:9e9b7db60fd5 | 84 | int32_t real; |
garyservin | 0:9e9b7db60fd5 | 85 | uint32_t base; |
garyservin | 0:9e9b7db60fd5 | 86 | } u_id; |
garyservin | 0:9e9b7db60fd5 | 87 | u_id.real = this->id; |
garyservin | 0:9e9b7db60fd5 | 88 | *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 89 | *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 90 | *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 91 | *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 92 | offset += sizeof(this->id); |
garyservin | 0:9e9b7db60fd5 | 93 | union { |
garyservin | 0:9e9b7db60fd5 | 94 | int32_t real; |
garyservin | 0:9e9b7db60fd5 | 95 | uint32_t base; |
garyservin | 0:9e9b7db60fd5 | 96 | } u_type; |
garyservin | 0:9e9b7db60fd5 | 97 | u_type.real = this->type; |
garyservin | 0:9e9b7db60fd5 | 98 | *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 99 | *(outbuffer + offset + 1) = (u_type.base >> (8 * 1)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 100 | *(outbuffer + offset + 2) = (u_type.base >> (8 * 2)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 101 | *(outbuffer + offset + 3) = (u_type.base >> (8 * 3)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 102 | offset += sizeof(this->type); |
garyservin | 0:9e9b7db60fd5 | 103 | union { |
garyservin | 0:9e9b7db60fd5 | 104 | int32_t real; |
garyservin | 0:9e9b7db60fd5 | 105 | uint32_t base; |
garyservin | 0:9e9b7db60fd5 | 106 | } u_action; |
garyservin | 0:9e9b7db60fd5 | 107 | u_action.real = this->action; |
garyservin | 0:9e9b7db60fd5 | 108 | *(outbuffer + offset + 0) = (u_action.base >> (8 * 0)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 109 | *(outbuffer + offset + 1) = (u_action.base >> (8 * 1)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 110 | *(outbuffer + offset + 2) = (u_action.base >> (8 * 2)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 111 | *(outbuffer + offset + 3) = (u_action.base >> (8 * 3)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 112 | offset += sizeof(this->action); |
garyservin | 0:9e9b7db60fd5 | 113 | offset += this->position.serialize(outbuffer + offset); |
garyservin | 0:9e9b7db60fd5 | 114 | union { |
garyservin | 0:9e9b7db60fd5 | 115 | float real; |
garyservin | 0:9e9b7db60fd5 | 116 | uint32_t base; |
garyservin | 0:9e9b7db60fd5 | 117 | } u_scale; |
garyservin | 0:9e9b7db60fd5 | 118 | u_scale.real = this->scale; |
garyservin | 0:9e9b7db60fd5 | 119 | *(outbuffer + offset + 0) = (u_scale.base >> (8 * 0)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 120 | *(outbuffer + offset + 1) = (u_scale.base >> (8 * 1)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 121 | *(outbuffer + offset + 2) = (u_scale.base >> (8 * 2)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 122 | *(outbuffer + offset + 3) = (u_scale.base >> (8 * 3)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 123 | offset += sizeof(this->scale); |
garyservin | 0:9e9b7db60fd5 | 124 | offset += this->outline_color.serialize(outbuffer + offset); |
garyservin | 0:9e9b7db60fd5 | 125 | *(outbuffer + offset + 0) = (this->filled >> (8 * 0)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 126 | offset += sizeof(this->filled); |
garyservin | 0:9e9b7db60fd5 | 127 | offset += this->fill_color.serialize(outbuffer + offset); |
garyservin | 0:9e9b7db60fd5 | 128 | *(outbuffer + offset + 0) = (this->lifetime.sec >> (8 * 0)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 129 | *(outbuffer + offset + 1) = (this->lifetime.sec >> (8 * 1)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 130 | *(outbuffer + offset + 2) = (this->lifetime.sec >> (8 * 2)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 131 | *(outbuffer + offset + 3) = (this->lifetime.sec >> (8 * 3)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 132 | offset += sizeof(this->lifetime.sec); |
garyservin | 0:9e9b7db60fd5 | 133 | *(outbuffer + offset + 0) = (this->lifetime.nsec >> (8 * 0)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 134 | *(outbuffer + offset + 1) = (this->lifetime.nsec >> (8 * 1)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 135 | *(outbuffer + offset + 2) = (this->lifetime.nsec >> (8 * 2)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 136 | *(outbuffer + offset + 3) = (this->lifetime.nsec >> (8 * 3)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 137 | offset += sizeof(this->lifetime.nsec); |
garyservin | 0:9e9b7db60fd5 | 138 | *(outbuffer + offset + 0) = (this->points_length >> (8 * 0)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 139 | *(outbuffer + offset + 1) = (this->points_length >> (8 * 1)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 140 | *(outbuffer + offset + 2) = (this->points_length >> (8 * 2)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 141 | *(outbuffer + offset + 3) = (this->points_length >> (8 * 3)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 142 | offset += sizeof(this->points_length); |
garyservin | 0:9e9b7db60fd5 | 143 | for( uint32_t i = 0; i < points_length; i++){ |
garyservin | 0:9e9b7db60fd5 | 144 | offset += this->points[i].serialize(outbuffer + offset); |
garyservin | 0:9e9b7db60fd5 | 145 | } |
garyservin | 0:9e9b7db60fd5 | 146 | *(outbuffer + offset + 0) = (this->outline_colors_length >> (8 * 0)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 147 | *(outbuffer + offset + 1) = (this->outline_colors_length >> (8 * 1)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 148 | *(outbuffer + offset + 2) = (this->outline_colors_length >> (8 * 2)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 149 | *(outbuffer + offset + 3) = (this->outline_colors_length >> (8 * 3)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 150 | offset += sizeof(this->outline_colors_length); |
garyservin | 0:9e9b7db60fd5 | 151 | for( uint32_t i = 0; i < outline_colors_length; i++){ |
garyservin | 0:9e9b7db60fd5 | 152 | offset += this->outline_colors[i].serialize(outbuffer + offset); |
garyservin | 0:9e9b7db60fd5 | 153 | } |
garyservin | 0:9e9b7db60fd5 | 154 | return offset; |
garyservin | 0:9e9b7db60fd5 | 155 | } |
garyservin | 0:9e9b7db60fd5 | 156 | |
garyservin | 0:9e9b7db60fd5 | 157 | virtual int deserialize(unsigned char *inbuffer) |
garyservin | 0:9e9b7db60fd5 | 158 | { |
garyservin | 0:9e9b7db60fd5 | 159 | int offset = 0; |
garyservin | 0:9e9b7db60fd5 | 160 | offset += this->header.deserialize(inbuffer + offset); |
garyservin | 0:9e9b7db60fd5 | 161 | uint32_t length_ns; |
garyservin | 0:9e9b7db60fd5 | 162 | arrToVar(length_ns, (inbuffer + offset)); |
garyservin | 0:9e9b7db60fd5 | 163 | offset += 4; |
garyservin | 0:9e9b7db60fd5 | 164 | for(unsigned int k= offset; k< offset+length_ns; ++k){ |
garyservin | 0:9e9b7db60fd5 | 165 | inbuffer[k-1]=inbuffer[k]; |
garyservin | 0:9e9b7db60fd5 | 166 | } |
garyservin | 0:9e9b7db60fd5 | 167 | inbuffer[offset+length_ns-1]=0; |
garyservin | 0:9e9b7db60fd5 | 168 | this->ns = (char *)(inbuffer + offset-1); |
garyservin | 0:9e9b7db60fd5 | 169 | offset += length_ns; |
garyservin | 0:9e9b7db60fd5 | 170 | union { |
garyservin | 0:9e9b7db60fd5 | 171 | int32_t real; |
garyservin | 0:9e9b7db60fd5 | 172 | uint32_t base; |
garyservin | 0:9e9b7db60fd5 | 173 | } u_id; |
garyservin | 0:9e9b7db60fd5 | 174 | u_id.base = 0; |
garyservin | 0:9e9b7db60fd5 | 175 | u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
garyservin | 0:9e9b7db60fd5 | 176 | u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:9e9b7db60fd5 | 177 | u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:9e9b7db60fd5 | 178 | u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:9e9b7db60fd5 | 179 | this->id = u_id.real; |
garyservin | 0:9e9b7db60fd5 | 180 | offset += sizeof(this->id); |
garyservin | 0:9e9b7db60fd5 | 181 | union { |
garyservin | 0:9e9b7db60fd5 | 182 | int32_t real; |
garyservin | 0:9e9b7db60fd5 | 183 | uint32_t base; |
garyservin | 0:9e9b7db60fd5 | 184 | } u_type; |
garyservin | 0:9e9b7db60fd5 | 185 | u_type.base = 0; |
garyservin | 0:9e9b7db60fd5 | 186 | u_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
garyservin | 0:9e9b7db60fd5 | 187 | u_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:9e9b7db60fd5 | 188 | u_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:9e9b7db60fd5 | 189 | u_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:9e9b7db60fd5 | 190 | this->type = u_type.real; |
garyservin | 0:9e9b7db60fd5 | 191 | offset += sizeof(this->type); |
garyservin | 0:9e9b7db60fd5 | 192 | union { |
garyservin | 0:9e9b7db60fd5 | 193 | int32_t real; |
garyservin | 0:9e9b7db60fd5 | 194 | uint32_t base; |
garyservin | 0:9e9b7db60fd5 | 195 | } u_action; |
garyservin | 0:9e9b7db60fd5 | 196 | u_action.base = 0; |
garyservin | 0:9e9b7db60fd5 | 197 | u_action.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
garyservin | 0:9e9b7db60fd5 | 198 | u_action.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:9e9b7db60fd5 | 199 | u_action.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:9e9b7db60fd5 | 200 | u_action.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:9e9b7db60fd5 | 201 | this->action = u_action.real; |
garyservin | 0:9e9b7db60fd5 | 202 | offset += sizeof(this->action); |
garyservin | 0:9e9b7db60fd5 | 203 | offset += this->position.deserialize(inbuffer + offset); |
garyservin | 0:9e9b7db60fd5 | 204 | union { |
garyservin | 0:9e9b7db60fd5 | 205 | float real; |
garyservin | 0:9e9b7db60fd5 | 206 | uint32_t base; |
garyservin | 0:9e9b7db60fd5 | 207 | } u_scale; |
garyservin | 0:9e9b7db60fd5 | 208 | u_scale.base = 0; |
garyservin | 0:9e9b7db60fd5 | 209 | u_scale.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
garyservin | 0:9e9b7db60fd5 | 210 | u_scale.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:9e9b7db60fd5 | 211 | u_scale.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:9e9b7db60fd5 | 212 | u_scale.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:9e9b7db60fd5 | 213 | this->scale = u_scale.real; |
garyservin | 0:9e9b7db60fd5 | 214 | offset += sizeof(this->scale); |
garyservin | 0:9e9b7db60fd5 | 215 | offset += this->outline_color.deserialize(inbuffer + offset); |
garyservin | 0:9e9b7db60fd5 | 216 | this->filled = ((uint8_t) (*(inbuffer + offset))); |
garyservin | 0:9e9b7db60fd5 | 217 | offset += sizeof(this->filled); |
garyservin | 0:9e9b7db60fd5 | 218 | offset += this->fill_color.deserialize(inbuffer + offset); |
garyservin | 0:9e9b7db60fd5 | 219 | this->lifetime.sec = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:9e9b7db60fd5 | 220 | this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:9e9b7db60fd5 | 221 | this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:9e9b7db60fd5 | 222 | this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:9e9b7db60fd5 | 223 | offset += sizeof(this->lifetime.sec); |
garyservin | 0:9e9b7db60fd5 | 224 | this->lifetime.nsec = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:9e9b7db60fd5 | 225 | this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:9e9b7db60fd5 | 226 | this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:9e9b7db60fd5 | 227 | this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:9e9b7db60fd5 | 228 | offset += sizeof(this->lifetime.nsec); |
garyservin | 0:9e9b7db60fd5 | 229 | uint32_t points_lengthT = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:9e9b7db60fd5 | 230 | points_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:9e9b7db60fd5 | 231 | points_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:9e9b7db60fd5 | 232 | points_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:9e9b7db60fd5 | 233 | offset += sizeof(this->points_length); |
garyservin | 0:9e9b7db60fd5 | 234 | if(points_lengthT > points_length) |
garyservin | 0:9e9b7db60fd5 | 235 | this->points = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); |
garyservin | 0:9e9b7db60fd5 | 236 | points_length = points_lengthT; |
garyservin | 0:9e9b7db60fd5 | 237 | for( uint32_t i = 0; i < points_length; i++){ |
garyservin | 0:9e9b7db60fd5 | 238 | offset += this->st_points.deserialize(inbuffer + offset); |
garyservin | 0:9e9b7db60fd5 | 239 | memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point)); |
garyservin | 0:9e9b7db60fd5 | 240 | } |
garyservin | 0:9e9b7db60fd5 | 241 | uint32_t outline_colors_lengthT = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:9e9b7db60fd5 | 242 | outline_colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:9e9b7db60fd5 | 243 | outline_colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:9e9b7db60fd5 | 244 | outline_colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:9e9b7db60fd5 | 245 | offset += sizeof(this->outline_colors_length); |
garyservin | 0:9e9b7db60fd5 | 246 | if(outline_colors_lengthT > outline_colors_length) |
garyservin | 0:9e9b7db60fd5 | 247 | this->outline_colors = (std_msgs::ColorRGBA*)realloc(this->outline_colors, outline_colors_lengthT * sizeof(std_msgs::ColorRGBA)); |
garyservin | 0:9e9b7db60fd5 | 248 | outline_colors_length = outline_colors_lengthT; |
garyservin | 0:9e9b7db60fd5 | 249 | for( uint32_t i = 0; i < outline_colors_length; i++){ |
garyservin | 0:9e9b7db60fd5 | 250 | offset += this->st_outline_colors.deserialize(inbuffer + offset); |
garyservin | 0:9e9b7db60fd5 | 251 | memcpy( &(this->outline_colors[i]), &(this->st_outline_colors), sizeof(std_msgs::ColorRGBA)); |
garyservin | 0:9e9b7db60fd5 | 252 | } |
garyservin | 0:9e9b7db60fd5 | 253 | return offset; |
garyservin | 0:9e9b7db60fd5 | 254 | } |
garyservin | 0:9e9b7db60fd5 | 255 | |
garyservin | 0:9e9b7db60fd5 | 256 | const char * getType(){ return "visualization_msgs/ImageMarker"; }; |
garyservin | 0:9e9b7db60fd5 | 257 | const char * getMD5(){ return "1de93c67ec8858b831025a08fbf1b35c"; }; |
garyservin | 0:9e9b7db60fd5 | 258 | |
garyservin | 0:9e9b7db60fd5 | 259 | }; |
garyservin | 0:9e9b7db60fd5 | 260 | |
garyservin | 0:9e9b7db60fd5 | 261 | } |
garyservin | 0:9e9b7db60fd5 | 262 | #endif |