Personal fork

Dependencies:   MODSERIAL

Dependents:   rosserial_mbed

Fork of rosserial_mbed_lib by nucho

Committer:
garyservin
Date:
Thu May 01 06:01:31 2014 +0000
Revision:
5:19c5437ed9fe
Parent:
4:684f39d0c346
Updated to hydro

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nucho 3:1cf99502f396 1 #ifndef _ROS_SERVICE_GetPlan_h
nucho 3:1cf99502f396 2 #define _ROS_SERVICE_GetPlan_h
nucho 0:77afd7560544 3 #include <stdint.h>
nucho 0:77afd7560544 4 #include <string.h>
nucho 0:77afd7560544 5 #include <stdlib.h>
nucho 3:1cf99502f396 6 #include "ros/msg.h"
nucho 0:77afd7560544 7 #include "geometry_msgs/PoseStamped.h"
nucho 0:77afd7560544 8 #include "nav_msgs/Path.h"
nucho 0:77afd7560544 9
nucho 0:77afd7560544 10 namespace nav_msgs
nucho 0:77afd7560544 11 {
nucho 0:77afd7560544 12
nucho 0:77afd7560544 13 static const char GETPLAN[] = "nav_msgs/GetPlan";
nucho 0:77afd7560544 14
nucho 0:77afd7560544 15 class GetPlanRequest : public ros::Msg
nucho 0:77afd7560544 16 {
nucho 0:77afd7560544 17 public:
nucho 0:77afd7560544 18 geometry_msgs::PoseStamped start;
nucho 0:77afd7560544 19 geometry_msgs::PoseStamped goal;
nucho 0:77afd7560544 20 float tolerance;
nucho 0:77afd7560544 21
nucho 3:1cf99502f396 22 virtual int serialize(unsigned char *outbuffer) const
nucho 0:77afd7560544 23 {
nucho 0:77afd7560544 24 int offset = 0;
nucho 0:77afd7560544 25 offset += this->start.serialize(outbuffer + offset);
nucho 0:77afd7560544 26 offset += this->goal.serialize(outbuffer + offset);
nucho 0:77afd7560544 27 union {
nucho 0:77afd7560544 28 float real;
nucho 3:1cf99502f396 29 uint32_t base;
nucho 0:77afd7560544 30 } u_tolerance;
nucho 0:77afd7560544 31 u_tolerance.real = this->tolerance;
nucho 0:77afd7560544 32 *(outbuffer + offset + 0) = (u_tolerance.base >> (8 * 0)) & 0xFF;
nucho 0:77afd7560544 33 *(outbuffer + offset + 1) = (u_tolerance.base >> (8 * 1)) & 0xFF;
nucho 0:77afd7560544 34 *(outbuffer + offset + 2) = (u_tolerance.base >> (8 * 2)) & 0xFF;
nucho 0:77afd7560544 35 *(outbuffer + offset + 3) = (u_tolerance.base >> (8 * 3)) & 0xFF;
nucho 0:77afd7560544 36 offset += sizeof(this->tolerance);
nucho 0:77afd7560544 37 return offset;
nucho 0:77afd7560544 38 }
nucho 0:77afd7560544 39
nucho 0:77afd7560544 40 virtual int deserialize(unsigned char *inbuffer)
nucho 0:77afd7560544 41 {
nucho 0:77afd7560544 42 int offset = 0;
nucho 0:77afd7560544 43 offset += this->start.deserialize(inbuffer + offset);
nucho 0:77afd7560544 44 offset += this->goal.deserialize(inbuffer + offset);
nucho 0:77afd7560544 45 union {
nucho 0:77afd7560544 46 float real;
nucho 3:1cf99502f396 47 uint32_t base;
nucho 0:77afd7560544 48 } u_tolerance;
nucho 0:77afd7560544 49 u_tolerance.base = 0;
nucho 3:1cf99502f396 50 u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
nucho 3:1cf99502f396 51 u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
nucho 3:1cf99502f396 52 u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
nucho 3:1cf99502f396 53 u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
nucho 0:77afd7560544 54 this->tolerance = u_tolerance.real;
nucho 0:77afd7560544 55 offset += sizeof(this->tolerance);
nucho 0:77afd7560544 56 return offset;
nucho 0:77afd7560544 57 }
nucho 0:77afd7560544 58
nucho 4:684f39d0c346 59 const char * getType(){ return GETPLAN; };
nucho 4:684f39d0c346 60 const char * getMD5(){ return "e25a43e0752bcca599a8c2eef8282df8"; };
nucho 0:77afd7560544 61
nucho 0:77afd7560544 62 };
nucho 0:77afd7560544 63
nucho 0:77afd7560544 64 class GetPlanResponse : public ros::Msg
nucho 0:77afd7560544 65 {
nucho 0:77afd7560544 66 public:
nucho 0:77afd7560544 67 nav_msgs::Path plan;
nucho 0:77afd7560544 68
nucho 3:1cf99502f396 69 virtual int serialize(unsigned char *outbuffer) const
nucho 0:77afd7560544 70 {
nucho 0:77afd7560544 71 int offset = 0;
nucho 0:77afd7560544 72 offset += this->plan.serialize(outbuffer + offset);
nucho 0:77afd7560544 73 return offset;
nucho 0:77afd7560544 74 }
nucho 0:77afd7560544 75
nucho 0:77afd7560544 76 virtual int deserialize(unsigned char *inbuffer)
nucho 0:77afd7560544 77 {
nucho 0:77afd7560544 78 int offset = 0;
nucho 0:77afd7560544 79 offset += this->plan.deserialize(inbuffer + offset);
nucho 0:77afd7560544 80 return offset;
nucho 0:77afd7560544 81 }
nucho 0:77afd7560544 82
nucho 4:684f39d0c346 83 const char * getType(){ return GETPLAN; };
nucho 4:684f39d0c346 84 const char * getMD5(){ return "0002bc113c0259d71f6cf8cbc9430e18"; };
nucho 3:1cf99502f396 85
nucho 3:1cf99502f396 86 };
nucho 0:77afd7560544 87
nucho 3:1cf99502f396 88 class GetPlan {
nucho 3:1cf99502f396 89 public:
nucho 3:1cf99502f396 90 typedef GetPlanRequest Request;
nucho 3:1cf99502f396 91 typedef GetPlanResponse Response;
nucho 0:77afd7560544 92 };
nucho 0:77afd7560544 93
nucho 0:77afd7560544 94 }
nucho 0:77afd7560544 95 #endif