ROS Serial library for Mbed platforms for ROS Indigo Igloo. Check http://wiki.ros.org/rosserial_mbed/ for more information
Dependents: rosserial_mbed_hello_world_publisher rtos_base_control rosserial_mbed_F64MA ROS-RTOS ... more
Polygon.h
00001 #ifndef _ROS_geometry_msgs_Polygon_h 00002 #define _ROS_geometry_msgs_Polygon_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 #include "geometry_msgs/Point32.h" 00009 00010 namespace geometry_msgs 00011 { 00012 00013 class Polygon : public ros::Msg 00014 { 00015 public: 00016 uint8_t points_length; 00017 geometry_msgs::Point32 st_points; 00018 geometry_msgs::Point32 * points; 00019 00020 Polygon(): 00021 points_length(0), points(NULL) 00022 { 00023 } 00024 00025 virtual int serialize(unsigned char *outbuffer) const 00026 { 00027 int offset = 0; 00028 *(outbuffer + offset++) = points_length; 00029 *(outbuffer + offset++) = 0; 00030 *(outbuffer + offset++) = 0; 00031 *(outbuffer + offset++) = 0; 00032 for( uint8_t i = 0; i < points_length; i++){ 00033 offset += this->points[i].serialize(outbuffer + offset); 00034 } 00035 return offset; 00036 } 00037 00038 virtual int deserialize(unsigned char *inbuffer) 00039 { 00040 int offset = 0; 00041 uint8_t points_lengthT = *(inbuffer + offset++); 00042 if(points_lengthT > points_length) 00043 this->points = (geometry_msgs::Point32*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point32)); 00044 offset += 3; 00045 points_length = points_lengthT; 00046 for( uint8_t i = 0; i < points_length; i++){ 00047 offset += this->st_points.deserialize(inbuffer + offset); 00048 memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point32)); 00049 } 00050 return offset; 00051 } 00052 00053 const char * getType(){ return "geometry_msgs/Polygon"; }; 00054 const char * getMD5(){ return "cd60a26494a087f577976f0329fa120e"; }; 00055 00056 }; 00057 00058 } 00059 #endif
Generated on Tue Jul 12 2022 18:39:40 by 1.7.2