This program is porting rosserial_arduino for mbed http://www.ros.org/wiki/rosserial_arduino This program supported the revision of 169 of rosserial. This program contains an example.
Dependencies: rosserial_mbed_lib mbed Servo
nav_msgs/GetMap.h@0:06fc856e99ca, 2011-08-19 (annotated)
- Committer:
- nucho
- Date:
- Fri Aug 19 09:06:16 2011 +0000
- Revision:
- 0:06fc856e99ca
- Child:
- 3:dff241b66f84
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nucho | 0:06fc856e99ca | 1 | #ifndef ros_SERVICE_GetMap_h |
nucho | 0:06fc856e99ca | 2 | #define ros_SERVICE_GetMap_h |
nucho | 0:06fc856e99ca | 3 | #include <stdint.h> |
nucho | 0:06fc856e99ca | 4 | #include <string.h> |
nucho | 0:06fc856e99ca | 5 | #include <stdlib.h> |
nucho | 0:06fc856e99ca | 6 | #include "../ros/msg.h" |
nucho | 0:06fc856e99ca | 7 | #include "nav_msgs/OccupancyGrid.h" |
nucho | 0:06fc856e99ca | 8 | |
nucho | 0:06fc856e99ca | 9 | namespace nav_msgs |
nucho | 0:06fc856e99ca | 10 | { |
nucho | 0:06fc856e99ca | 11 | |
nucho | 0:06fc856e99ca | 12 | static const char GETMAP[] = "nav_msgs/GetMap"; |
nucho | 0:06fc856e99ca | 13 | |
nucho | 0:06fc856e99ca | 14 | class GetMapRequest : public ros::Msg |
nucho | 0:06fc856e99ca | 15 | { |
nucho | 0:06fc856e99ca | 16 | public: |
nucho | 0:06fc856e99ca | 17 | |
nucho | 0:06fc856e99ca | 18 | virtual int serialize(unsigned char *outbuffer) |
nucho | 0:06fc856e99ca | 19 | { |
nucho | 0:06fc856e99ca | 20 | int offset = 0; |
nucho | 0:06fc856e99ca | 21 | return offset; |
nucho | 0:06fc856e99ca | 22 | } |
nucho | 0:06fc856e99ca | 23 | |
nucho | 0:06fc856e99ca | 24 | virtual int deserialize(unsigned char *inbuffer) |
nucho | 0:06fc856e99ca | 25 | { |
nucho | 0:06fc856e99ca | 26 | int offset = 0; |
nucho | 0:06fc856e99ca | 27 | return offset; |
nucho | 0:06fc856e99ca | 28 | } |
nucho | 0:06fc856e99ca | 29 | |
nucho | 0:06fc856e99ca | 30 | const char * getType(){ return GETMAP; }; |
nucho | 0:06fc856e99ca | 31 | |
nucho | 0:06fc856e99ca | 32 | }; |
nucho | 0:06fc856e99ca | 33 | |
nucho | 0:06fc856e99ca | 34 | class GetMapResponse : public ros::Msg |
nucho | 0:06fc856e99ca | 35 | { |
nucho | 0:06fc856e99ca | 36 | public: |
nucho | 0:06fc856e99ca | 37 | nav_msgs::OccupancyGrid map; |
nucho | 0:06fc856e99ca | 38 | |
nucho | 0:06fc856e99ca | 39 | virtual int serialize(unsigned char *outbuffer) |
nucho | 0:06fc856e99ca | 40 | { |
nucho | 0:06fc856e99ca | 41 | int offset = 0; |
nucho | 0:06fc856e99ca | 42 | offset += this->map.serialize(outbuffer + offset); |
nucho | 0:06fc856e99ca | 43 | return offset; |
nucho | 0:06fc856e99ca | 44 | } |
nucho | 0:06fc856e99ca | 45 | |
nucho | 0:06fc856e99ca | 46 | virtual int deserialize(unsigned char *inbuffer) |
nucho | 0:06fc856e99ca | 47 | { |
nucho | 0:06fc856e99ca | 48 | int offset = 0; |
nucho | 0:06fc856e99ca | 49 | offset += this->map.deserialize(inbuffer + offset); |
nucho | 0:06fc856e99ca | 50 | return offset; |
nucho | 0:06fc856e99ca | 51 | } |
nucho | 0:06fc856e99ca | 52 | |
nucho | 0:06fc856e99ca | 53 | virtual const char * getType(){ return GETMAP; }; |
nucho | 0:06fc856e99ca | 54 | |
nucho | 0:06fc856e99ca | 55 | }; |
nucho | 0:06fc856e99ca | 56 | |
nucho | 0:06fc856e99ca | 57 | } |
nucho | 0:06fc856e99ca | 58 | #endif |