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
SimpleOccupancyGridArray.h
00001 #ifndef _ROS_jsk_recognition_msgs_SimpleOccupancyGridArray_h 00002 #define _ROS_jsk_recognition_msgs_SimpleOccupancyGridArray_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 #include "std_msgs/Header.h" 00009 #include "jsk_recognition_msgs/SimpleOccupancyGrid.h" 00010 00011 namespace jsk_recognition_msgs 00012 { 00013 00014 class SimpleOccupancyGridArray : public ros::Msg 00015 { 00016 public: 00017 typedef std_msgs::Header _header_type; 00018 _header_type header; 00019 uint32_t grids_length; 00020 typedef jsk_recognition_msgs::SimpleOccupancyGrid _grids_type; 00021 _grids_type st_grids; 00022 _grids_type * grids; 00023 00024 SimpleOccupancyGridArray(): 00025 header(), 00026 grids_length(0), grids(NULL) 00027 { 00028 } 00029 00030 virtual int serialize(unsigned char *outbuffer) const 00031 { 00032 int offset = 0; 00033 offset += this->header.serialize(outbuffer + offset); 00034 *(outbuffer + offset + 0) = (this->grids_length >> (8 * 0)) & 0xFF; 00035 *(outbuffer + offset + 1) = (this->grids_length >> (8 * 1)) & 0xFF; 00036 *(outbuffer + offset + 2) = (this->grids_length >> (8 * 2)) & 0xFF; 00037 *(outbuffer + offset + 3) = (this->grids_length >> (8 * 3)) & 0xFF; 00038 offset += sizeof(this->grids_length); 00039 for( uint32_t i = 0; i < grids_length; i++){ 00040 offset += this->grids[i].serialize(outbuffer + offset); 00041 } 00042 return offset; 00043 } 00044 00045 virtual int deserialize(unsigned char *inbuffer) 00046 { 00047 int offset = 0; 00048 offset += this->header.deserialize(inbuffer + offset); 00049 uint32_t grids_lengthT = ((uint32_t) (*(inbuffer + offset))); 00050 grids_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00051 grids_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00052 grids_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00053 offset += sizeof(this->grids_length); 00054 if(grids_lengthT > grids_length) 00055 this->grids = (jsk_recognition_msgs::SimpleOccupancyGrid*)realloc(this->grids, grids_lengthT * sizeof(jsk_recognition_msgs::SimpleOccupancyGrid)); 00056 grids_length = grids_lengthT; 00057 for( uint32_t i = 0; i < grids_length; i++){ 00058 offset += this->st_grids.deserialize(inbuffer + offset); 00059 memcpy( &(this->grids[i]), &(this->st_grids), sizeof(jsk_recognition_msgs::SimpleOccupancyGrid)); 00060 } 00061 return offset; 00062 } 00063 00064 virtual const char * getType(){ return "jsk_recognition_msgs/SimpleOccupancyGridArray"; }; 00065 virtual const char * getMD5(){ return "e448b458270a6ec465d66169c4180932"; }; 00066 00067 }; 00068 00069 } 00070 #endif
Generated on Mon Sep 26 2022 13:47:03 by
