Irfan Tito Kurniawan / ros_lib
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PlannerService.h Source File

PlannerService.h

00001 #ifndef _ROS_SERVICE_PlannerService_h
00002 #define _ROS_SERVICE_PlannerService_h
00003 #include <stdint.h>
00004 #include <string.h>
00005 #include <stdlib.h>
00006 #include "ros/msg.h"
00007 #include "geometry_msgs/PoseStamped.h"
00008 #include "trajectory_msgs/MultiDOFJointTrajectory.h"
00009 #include "geometry_msgs/Vector3.h"
00010 #include "mav_planning_msgs/PolynomialTrajectory4D.h"
00011 
00012 namespace mav_planning_msgs
00013 {
00014 
00015 static const char PLANNERSERVICE[] = "mav_planning_msgs/PlannerService";
00016 
00017   class PlannerServiceRequest : public ros::Msg
00018   {
00019     public:
00020       typedef geometry_msgs::PoseStamped _start_pose_type;
00021       _start_pose_type start_pose;
00022       typedef geometry_msgs::Vector3 _start_velocity_type;
00023       _start_velocity_type start_velocity;
00024       typedef geometry_msgs::PoseStamped _goal_pose_type;
00025       _goal_pose_type goal_pose;
00026       typedef geometry_msgs::Vector3 _goal_velocity_type;
00027       _goal_velocity_type goal_velocity;
00028       typedef geometry_msgs::Vector3 _bounding_box_type;
00029       _bounding_box_type bounding_box;
00030 
00031     PlannerServiceRequest():
00032       start_pose(),
00033       start_velocity(),
00034       goal_pose(),
00035       goal_velocity(),
00036       bounding_box()
00037     {
00038     }
00039 
00040     virtual int serialize(unsigned char *outbuffer) const
00041     {
00042       int offset = 0;
00043       offset += this->start_pose.serialize(outbuffer + offset);
00044       offset += this->start_velocity.serialize(outbuffer + offset);
00045       offset += this->goal_pose.serialize(outbuffer + offset);
00046       offset += this->goal_velocity.serialize(outbuffer + offset);
00047       offset += this->bounding_box.serialize(outbuffer + offset);
00048       return offset;
00049     }
00050 
00051     virtual int deserialize(unsigned char *inbuffer)
00052     {
00053       int offset = 0;
00054       offset += this->start_pose.deserialize(inbuffer + offset);
00055       offset += this->start_velocity.deserialize(inbuffer + offset);
00056       offset += this->goal_pose.deserialize(inbuffer + offset);
00057       offset += this->goal_velocity.deserialize(inbuffer + offset);
00058       offset += this->bounding_box.deserialize(inbuffer + offset);
00059      return offset;
00060     }
00061 
00062     const char * getType(){ return PLANNERSERVICE; };
00063     const char * getMD5(){ return "6090fe8ab3df1362b8c26859b8850940"; };
00064 
00065   };
00066 
00067   class PlannerServiceResponse : public ros::Msg
00068   {
00069     public:
00070       typedef bool _success_type;
00071       _success_type success;
00072       typedef mav_planning_msgs::PolynomialTrajectory4D _polynomial_plan_type;
00073       _polynomial_plan_type polynomial_plan;
00074       typedef trajectory_msgs::MultiDOFJointTrajectory _sampled_plan_type;
00075       _sampled_plan_type sampled_plan;
00076 
00077     PlannerServiceResponse():
00078       success(0),
00079       polynomial_plan(),
00080       sampled_plan()
00081     {
00082     }
00083 
00084     virtual int serialize(unsigned char *outbuffer) const
00085     {
00086       int offset = 0;
00087       union {
00088         bool real;
00089         uint8_t base;
00090       } u_success;
00091       u_success.real = this->success;
00092       *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF;
00093       offset += sizeof(this->success);
00094       offset += this->polynomial_plan.serialize(outbuffer + offset);
00095       offset += this->sampled_plan.serialize(outbuffer + offset);
00096       return offset;
00097     }
00098 
00099     virtual int deserialize(unsigned char *inbuffer)
00100     {
00101       int offset = 0;
00102       union {
00103         bool real;
00104         uint8_t base;
00105       } u_success;
00106       u_success.base = 0;
00107       u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00108       this->success = u_success.real;
00109       offset += sizeof(this->success);
00110       offset += this->polynomial_plan.deserialize(inbuffer + offset);
00111       offset += this->sampled_plan.deserialize(inbuffer + offset);
00112      return offset;
00113     }
00114 
00115     const char * getType(){ return PLANNERSERVICE; };
00116     const char * getMD5(){ return "2b0f390ba4c264f0182acc6839f4d8b4"; };
00117 
00118   };
00119 
00120   class PlannerService {
00121     public:
00122     typedef PlannerServiceRequest Request;
00123     typedef PlannerServiceResponse Response;
00124   };
00125 
00126 }
00127 #endif