It has only one change from original one. I added robotfeedback message on it.
Dependents: RobotFeedback mobileRobotITU
Fork of ros_lib_indigo by
pcl_msgs/Vertices.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_pcl_msgs_Vertices_h |
garyservin | 0:fd24f7ca9688 | 2 | #define _ROS_pcl_msgs_Vertices_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 | |
garyservin | 0:fd24f7ca9688 | 9 | namespace pcl_msgs |
garyservin | 0:fd24f7ca9688 | 10 | { |
garyservin | 0:fd24f7ca9688 | 11 | |
garyservin | 0:fd24f7ca9688 | 12 | class Vertices : public ros::Msg |
garyservin | 0:fd24f7ca9688 | 13 | { |
garyservin | 0:fd24f7ca9688 | 14 | public: |
garyservin | 0:fd24f7ca9688 | 15 | uint8_t vertices_length; |
garyservin | 0:fd24f7ca9688 | 16 | uint32_t st_vertices; |
garyservin | 0:fd24f7ca9688 | 17 | uint32_t * vertices; |
garyservin | 0:fd24f7ca9688 | 18 | |
garyservin | 0:fd24f7ca9688 | 19 | Vertices(): |
garyservin | 0:fd24f7ca9688 | 20 | vertices_length(0), vertices(NULL) |
garyservin | 0:fd24f7ca9688 | 21 | { |
garyservin | 0:fd24f7ca9688 | 22 | } |
garyservin | 0:fd24f7ca9688 | 23 | |
garyservin | 0:fd24f7ca9688 | 24 | virtual int serialize(unsigned char *outbuffer) const |
garyservin | 0:fd24f7ca9688 | 25 | { |
garyservin | 0:fd24f7ca9688 | 26 | int offset = 0; |
garyservin | 0:fd24f7ca9688 | 27 | *(outbuffer + offset++) = vertices_length; |
garyservin | 0:fd24f7ca9688 | 28 | *(outbuffer + offset++) = 0; |
garyservin | 0:fd24f7ca9688 | 29 | *(outbuffer + offset++) = 0; |
garyservin | 0:fd24f7ca9688 | 30 | *(outbuffer + offset++) = 0; |
garyservin | 0:fd24f7ca9688 | 31 | for( uint8_t i = 0; i < vertices_length; i++){ |
garyservin | 0:fd24f7ca9688 | 32 | *(outbuffer + offset + 0) = (this->vertices[i] >> (8 * 0)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 33 | *(outbuffer + offset + 1) = (this->vertices[i] >> (8 * 1)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 34 | *(outbuffer + offset + 2) = (this->vertices[i] >> (8 * 2)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 35 | *(outbuffer + offset + 3) = (this->vertices[i] >> (8 * 3)) & 0xFF; |
garyservin | 0:fd24f7ca9688 | 36 | offset += sizeof(this->vertices[i]); |
garyservin | 0:fd24f7ca9688 | 37 | } |
garyservin | 0:fd24f7ca9688 | 38 | return offset; |
garyservin | 0:fd24f7ca9688 | 39 | } |
garyservin | 0:fd24f7ca9688 | 40 | |
garyservin | 0:fd24f7ca9688 | 41 | virtual int deserialize(unsigned char *inbuffer) |
garyservin | 0:fd24f7ca9688 | 42 | { |
garyservin | 0:fd24f7ca9688 | 43 | int offset = 0; |
garyservin | 0:fd24f7ca9688 | 44 | uint8_t vertices_lengthT = *(inbuffer + offset++); |
garyservin | 0:fd24f7ca9688 | 45 | if(vertices_lengthT > vertices_length) |
garyservin | 0:fd24f7ca9688 | 46 | this->vertices = (uint32_t*)realloc(this->vertices, vertices_lengthT * sizeof(uint32_t)); |
garyservin | 0:fd24f7ca9688 | 47 | offset += 3; |
garyservin | 0:fd24f7ca9688 | 48 | vertices_length = vertices_lengthT; |
garyservin | 0:fd24f7ca9688 | 49 | for( uint8_t i = 0; i < vertices_length; i++){ |
garyservin | 0:fd24f7ca9688 | 50 | this->st_vertices = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:fd24f7ca9688 | 51 | this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:fd24f7ca9688 | 52 | this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:fd24f7ca9688 | 53 | this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:fd24f7ca9688 | 54 | offset += sizeof(this->st_vertices); |
garyservin | 0:fd24f7ca9688 | 55 | memcpy( &(this->vertices[i]), &(this->st_vertices), sizeof(uint32_t)); |
garyservin | 0:fd24f7ca9688 | 56 | } |
garyservin | 0:fd24f7ca9688 | 57 | return offset; |
garyservin | 0:fd24f7ca9688 | 58 | } |
garyservin | 0:fd24f7ca9688 | 59 | |
garyservin | 0:fd24f7ca9688 | 60 | const char * getType(){ return "pcl_msgs/Vertices"; }; |
garyservin | 0:fd24f7ca9688 | 61 | const char * getMD5(){ return "39bd7b1c23763ddd1b882b97cb7cfe11"; }; |
garyservin | 0:fd24f7ca9688 | 62 | |
garyservin | 0:fd24f7ca9688 | 63 | }; |
garyservin | 0:fd24f7ca9688 | 64 | |
garyservin | 0:fd24f7ca9688 | 65 | } |
garyservin | 0:fd24f7ca9688 | 66 | #endif |