hairo

Dependencies:   mbed BufferedSerial

Committer:
garyservin
Date:
Sat Dec 31 00:48:34 2016 +0000
Revision:
0:9e9b7db60fd5
Initial commit, generated based on a clean kinetic-desktop-full

Who changed what in which revision?

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