This program is porting rosserial_arduino for mbed http://www.ros.org/wiki/rosserial_arduino This program supported the revision of 169 of rosserial.
Dependents: rosserial_mbed robot_S2
Diff: nav_msgs/MapMetaData.h
- Revision:
- 0:77afd7560544
- Child:
- 1:ff0ec969dad1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nav_msgs/MapMetaData.h Fri Aug 19 09:06:30 2011 +0000 @@ -0,0 +1,147 @@ +#ifndef ros_MapMetaData_h +#define ros_MapMetaData_h + +#include <stdint.h> +#include <string.h> +#include <stdlib.h> +#include "../ros/msg.h" +#include "ros/time.h" +#include "geometry_msgs/Pose.h" + +namespace nav_msgs +{ + + class MapMetaData : public ros::Msg + { + public: + ros::Time map_load_time; + float resolution; + unsigned long width; + unsigned long height; + geometry_msgs::Pose origin; + + virtual int serialize(unsigned char *outbuffer) + { + int offset = 0; + union { + unsigned long real; + unsigned long base; + } u_sec; + u_sec.real = this->map_load_time.sec; + *(outbuffer + offset + 0) = (u_sec.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sec.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sec.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sec.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->map_load_time.sec); + union { + unsigned long real; + unsigned long base; + } u_nsec; + u_nsec.real = this->map_load_time.nsec; + *(outbuffer + offset + 0) = (u_nsec.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_nsec.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_nsec.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_nsec.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->map_load_time.nsec); + union { + float real; + unsigned long base; + } u_resolution; + u_resolution.real = this->resolution; + *(outbuffer + offset + 0) = (u_resolution.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_resolution.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_resolution.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_resolution.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->resolution); + union { + unsigned long real; + unsigned long base; + } u_width; + u_width.real = this->width; + *(outbuffer + offset + 0) = (u_width.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_width.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_width.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_width.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + union { + unsigned long real; + unsigned long base; + } u_height; + u_height.real = this->height; + *(outbuffer + offset + 0) = (u_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_height.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + offset += this->origin.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + unsigned long real; + unsigned long base; + } u_sec; + u_sec.base = 0; + u_sec.base |= ((typeof(u_sec.base)) (*(inbuffer + offset + 0))) << (8 * 0); + u_sec.base |= ((typeof(u_sec.base)) (*(inbuffer + offset + 1))) << (8 * 1); + u_sec.base |= ((typeof(u_sec.base)) (*(inbuffer + offset + 2))) << (8 * 2); + u_sec.base |= ((typeof(u_sec.base)) (*(inbuffer + offset + 3))) << (8 * 3); + this->map_load_time.sec = u_sec.real; + offset += sizeof(this->map_load_time.sec); + union { + unsigned long real; + unsigned long base; + } u_nsec; + u_nsec.base = 0; + u_nsec.base |= ((typeof(u_nsec.base)) (*(inbuffer + offset + 0))) << (8 * 0); + u_nsec.base |= ((typeof(u_nsec.base)) (*(inbuffer + offset + 1))) << (8 * 1); + u_nsec.base |= ((typeof(u_nsec.base)) (*(inbuffer + offset + 2))) << (8 * 2); + u_nsec.base |= ((typeof(u_nsec.base)) (*(inbuffer + offset + 3))) << (8 * 3); + this->map_load_time.nsec = u_nsec.real; + offset += sizeof(this->map_load_time.nsec); + union { + float real; + unsigned long base; + } u_resolution; + u_resolution.base = 0; + u_resolution.base |= ((typeof(u_resolution.base)) (*(inbuffer + offset + 0))) << (8 * 0); + u_resolution.base |= ((typeof(u_resolution.base)) (*(inbuffer + offset + 1))) << (8 * 1); + u_resolution.base |= ((typeof(u_resolution.base)) (*(inbuffer + offset + 2))) << (8 * 2); + u_resolution.base |= ((typeof(u_resolution.base)) (*(inbuffer + offset + 3))) << (8 * 3); + this->resolution = u_resolution.real; + offset += sizeof(this->resolution); + union { + unsigned long real; + unsigned long base; + } u_width; + u_width.base = 0; + u_width.base |= ((typeof(u_width.base)) (*(inbuffer + offset + 0))) << (8 * 0); + u_width.base |= ((typeof(u_width.base)) (*(inbuffer + offset + 1))) << (8 * 1); + u_width.base |= ((typeof(u_width.base)) (*(inbuffer + offset + 2))) << (8 * 2); + u_width.base |= ((typeof(u_width.base)) (*(inbuffer + offset + 3))) << (8 * 3); + this->width = u_width.real; + offset += sizeof(this->width); + union { + unsigned long real; + unsigned long base; + } u_height; + u_height.base = 0; + u_height.base |= ((typeof(u_height.base)) (*(inbuffer + offset + 0))) << (8 * 0); + u_height.base |= ((typeof(u_height.base)) (*(inbuffer + offset + 1))) << (8 * 1); + u_height.base |= ((typeof(u_height.base)) (*(inbuffer + offset + 2))) << (8 * 2); + u_height.base |= ((typeof(u_height.base)) (*(inbuffer + offset + 3))) << (8 * 3); + this->height = u_height.real; + offset += sizeof(this->height); + offset += this->origin.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType(){ return "nav_msgs/MapMetaData"; }; + + }; + +} +#endif \ No newline at end of file