Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed Watchdog stm32-sensor-base2
ros_lib_melodic/pcl_msgs/Vertices.h@2:b7fdc74e5c5d, 2020-07-07 (annotated)
- Committer:
- ommpy
- Date:
- Tue Jul 07 15:19:06 2020 +0530
- Revision:
- 2:b7fdc74e5c5d
new board files
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ommpy | 2:b7fdc74e5c5d | 1 | #ifndef _ROS_pcl_msgs_Vertices_h |
| ommpy | 2:b7fdc74e5c5d | 2 | #define _ROS_pcl_msgs_Vertices_h |
| ommpy | 2:b7fdc74e5c5d | 3 | |
| ommpy | 2:b7fdc74e5c5d | 4 | #include <stdint.h> |
| ommpy | 2:b7fdc74e5c5d | 5 | #include <string.h> |
| ommpy | 2:b7fdc74e5c5d | 6 | #include <stdlib.h> |
| ommpy | 2:b7fdc74e5c5d | 7 | #include "ros/msg.h" |
| ommpy | 2:b7fdc74e5c5d | 8 | |
| ommpy | 2:b7fdc74e5c5d | 9 | namespace pcl_msgs |
| ommpy | 2:b7fdc74e5c5d | 10 | { |
| ommpy | 2:b7fdc74e5c5d | 11 | |
| ommpy | 2:b7fdc74e5c5d | 12 | class Vertices : public ros::Msg |
| ommpy | 2:b7fdc74e5c5d | 13 | { |
| ommpy | 2:b7fdc74e5c5d | 14 | public: |
| ommpy | 2:b7fdc74e5c5d | 15 | uint32_t vertices_length; |
| ommpy | 2:b7fdc74e5c5d | 16 | typedef uint32_t _vertices_type; |
| ommpy | 2:b7fdc74e5c5d | 17 | _vertices_type st_vertices; |
| ommpy | 2:b7fdc74e5c5d | 18 | _vertices_type * vertices; |
| ommpy | 2:b7fdc74e5c5d | 19 | |
| ommpy | 2:b7fdc74e5c5d | 20 | Vertices(): |
| ommpy | 2:b7fdc74e5c5d | 21 | vertices_length(0), vertices(NULL) |
| ommpy | 2:b7fdc74e5c5d | 22 | { |
| ommpy | 2:b7fdc74e5c5d | 23 | } |
| ommpy | 2:b7fdc74e5c5d | 24 | |
| ommpy | 2:b7fdc74e5c5d | 25 | virtual int serialize(unsigned char *outbuffer) const |
| ommpy | 2:b7fdc74e5c5d | 26 | { |
| ommpy | 2:b7fdc74e5c5d | 27 | int offset = 0; |
| ommpy | 2:b7fdc74e5c5d | 28 | *(outbuffer + offset + 0) = (this->vertices_length >> (8 * 0)) & 0xFF; |
| ommpy | 2:b7fdc74e5c5d | 29 | *(outbuffer + offset + 1) = (this->vertices_length >> (8 * 1)) & 0xFF; |
| ommpy | 2:b7fdc74e5c5d | 30 | *(outbuffer + offset + 2) = (this->vertices_length >> (8 * 2)) & 0xFF; |
| ommpy | 2:b7fdc74e5c5d | 31 | *(outbuffer + offset + 3) = (this->vertices_length >> (8 * 3)) & 0xFF; |
| ommpy | 2:b7fdc74e5c5d | 32 | offset += sizeof(this->vertices_length); |
| ommpy | 2:b7fdc74e5c5d | 33 | for( uint32_t i = 0; i < vertices_length; i++){ |
| ommpy | 2:b7fdc74e5c5d | 34 | *(outbuffer + offset + 0) = (this->vertices[i] >> (8 * 0)) & 0xFF; |
| ommpy | 2:b7fdc74e5c5d | 35 | *(outbuffer + offset + 1) = (this->vertices[i] >> (8 * 1)) & 0xFF; |
| ommpy | 2:b7fdc74e5c5d | 36 | *(outbuffer + offset + 2) = (this->vertices[i] >> (8 * 2)) & 0xFF; |
| ommpy | 2:b7fdc74e5c5d | 37 | *(outbuffer + offset + 3) = (this->vertices[i] >> (8 * 3)) & 0xFF; |
| ommpy | 2:b7fdc74e5c5d | 38 | offset += sizeof(this->vertices[i]); |
| ommpy | 2:b7fdc74e5c5d | 39 | } |
| ommpy | 2:b7fdc74e5c5d | 40 | return offset; |
| ommpy | 2:b7fdc74e5c5d | 41 | } |
| ommpy | 2:b7fdc74e5c5d | 42 | |
| ommpy | 2:b7fdc74e5c5d | 43 | virtual int deserialize(unsigned char *inbuffer) |
| ommpy | 2:b7fdc74e5c5d | 44 | { |
| ommpy | 2:b7fdc74e5c5d | 45 | int offset = 0; |
| ommpy | 2:b7fdc74e5c5d | 46 | uint32_t vertices_lengthT = ((uint32_t) (*(inbuffer + offset))); |
| ommpy | 2:b7fdc74e5c5d | 47 | vertices_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
| ommpy | 2:b7fdc74e5c5d | 48 | vertices_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
| ommpy | 2:b7fdc74e5c5d | 49 | vertices_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
| ommpy | 2:b7fdc74e5c5d | 50 | offset += sizeof(this->vertices_length); |
| ommpy | 2:b7fdc74e5c5d | 51 | if(vertices_lengthT > vertices_length) |
| ommpy | 2:b7fdc74e5c5d | 52 | this->vertices = (uint32_t*)realloc(this->vertices, vertices_lengthT * sizeof(uint32_t)); |
| ommpy | 2:b7fdc74e5c5d | 53 | vertices_length = vertices_lengthT; |
| ommpy | 2:b7fdc74e5c5d | 54 | for( uint32_t i = 0; i < vertices_length; i++){ |
| ommpy | 2:b7fdc74e5c5d | 55 | this->st_vertices = ((uint32_t) (*(inbuffer + offset))); |
| ommpy | 2:b7fdc74e5c5d | 56 | this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
| ommpy | 2:b7fdc74e5c5d | 57 | this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
| ommpy | 2:b7fdc74e5c5d | 58 | this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
| ommpy | 2:b7fdc74e5c5d | 59 | offset += sizeof(this->st_vertices); |
| ommpy | 2:b7fdc74e5c5d | 60 | memcpy( &(this->vertices[i]), &(this->st_vertices), sizeof(uint32_t)); |
| ommpy | 2:b7fdc74e5c5d | 61 | } |
| ommpy | 2:b7fdc74e5c5d | 62 | return offset; |
| ommpy | 2:b7fdc74e5c5d | 63 | } |
| ommpy | 2:b7fdc74e5c5d | 64 | |
| ommpy | 2:b7fdc74e5c5d | 65 | const char * getType(){ return "pcl_msgs/Vertices"; }; |
| ommpy | 2:b7fdc74e5c5d | 66 | const char * getMD5(){ return "39bd7b1c23763ddd1b882b97cb7cfe11"; }; |
| ommpy | 2:b7fdc74e5c5d | 67 | |
| ommpy | 2:b7fdc74e5c5d | 68 | }; |
| ommpy | 2:b7fdc74e5c5d | 69 | |
| ommpy | 2:b7fdc74e5c5d | 70 | } |
| ommpy | 2:b7fdc74e5c5d | 71 | #endif |