ROS Serial library for Mbed platforms for ROS Indigo Igloo. Check http://wiki.ros.org/rosserial_mbed/ for more information

Dependencies:   BufferedSerial

Dependents:   rosserial_mbed_hello_world_publisher rtos_base_control rosserial_mbed_F64MA ROS-RTOS ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ProjectedMap.h Source File

ProjectedMap.h

00001 #ifndef _ROS_map_msgs_ProjectedMap_h
00002 #define _ROS_map_msgs_ProjectedMap_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "nav_msgs/OccupancyGrid.h"
00009 
00010 namespace map_msgs
00011 {
00012 
00013   class ProjectedMap : public ros::Msg
00014   {
00015     public:
00016       nav_msgs::OccupancyGrid map;
00017       double min_z;
00018       double max_z;
00019 
00020     ProjectedMap():
00021       map(),
00022       min_z(0),
00023       max_z(0)
00024     {
00025     }
00026 
00027     virtual int serialize(unsigned char *outbuffer) const
00028     {
00029       int offset = 0;
00030       offset += this->map.serialize(outbuffer + offset);
00031       union {
00032         double real;
00033         uint64_t base;
00034       } u_min_z;
00035       u_min_z.real = this->min_z;
00036       *(outbuffer + offset + 0) = (u_min_z.base >> (8 * 0)) & 0xFF;
00037       *(outbuffer + offset + 1) = (u_min_z.base >> (8 * 1)) & 0xFF;
00038       *(outbuffer + offset + 2) = (u_min_z.base >> (8 * 2)) & 0xFF;
00039       *(outbuffer + offset + 3) = (u_min_z.base >> (8 * 3)) & 0xFF;
00040       *(outbuffer + offset + 4) = (u_min_z.base >> (8 * 4)) & 0xFF;
00041       *(outbuffer + offset + 5) = (u_min_z.base >> (8 * 5)) & 0xFF;
00042       *(outbuffer + offset + 6) = (u_min_z.base >> (8 * 6)) & 0xFF;
00043       *(outbuffer + offset + 7) = (u_min_z.base >> (8 * 7)) & 0xFF;
00044       offset += sizeof(this->min_z);
00045       union {
00046         double real;
00047         uint64_t base;
00048       } u_max_z;
00049       u_max_z.real = this->max_z;
00050       *(outbuffer + offset + 0) = (u_max_z.base >> (8 * 0)) & 0xFF;
00051       *(outbuffer + offset + 1) = (u_max_z.base >> (8 * 1)) & 0xFF;
00052       *(outbuffer + offset + 2) = (u_max_z.base >> (8 * 2)) & 0xFF;
00053       *(outbuffer + offset + 3) = (u_max_z.base >> (8 * 3)) & 0xFF;
00054       *(outbuffer + offset + 4) = (u_max_z.base >> (8 * 4)) & 0xFF;
00055       *(outbuffer + offset + 5) = (u_max_z.base >> (8 * 5)) & 0xFF;
00056       *(outbuffer + offset + 6) = (u_max_z.base >> (8 * 6)) & 0xFF;
00057       *(outbuffer + offset + 7) = (u_max_z.base >> (8 * 7)) & 0xFF;
00058       offset += sizeof(this->max_z);
00059       return offset;
00060     }
00061 
00062     virtual int deserialize(unsigned char *inbuffer)
00063     {
00064       int offset = 0;
00065       offset += this->map.deserialize(inbuffer + offset);
00066       union {
00067         double real;
00068         uint64_t base;
00069       } u_min_z;
00070       u_min_z.base = 0;
00071       u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00072       u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00073       u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00074       u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00075       u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00076       u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00077       u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00078       u_min_z.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00079       this->min_z = u_min_z.real;
00080       offset += sizeof(this->min_z);
00081       union {
00082         double real;
00083         uint64_t base;
00084       } u_max_z;
00085       u_max_z.base = 0;
00086       u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00087       u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00088       u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00089       u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00090       u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00091       u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00092       u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00093       u_max_z.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00094       this->max_z = u_max_z.real;
00095       offset += sizeof(this->max_z);
00096      return offset;
00097     }
00098 
00099     const char * getType(){ return "map_msgs/ProjectedMap"; };
00100     const char * getMD5(){ return "7bbe8f96e45089681dc1ea7d023cbfca"; };
00101 
00102   };
00103 
00104 }
00105 #endif