Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ros_lib/mav_planning_msgs/PlannerService.h@0:8f3710bfd298, 2020-09-02 (annotated)
- Committer:
- irfantitok
- Date:
- Wed Sep 02 13:51:31 2020 +0000
- Revision:
- 0:8f3710bfd298
Resolved round not found
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
irfantitok | 0:8f3710bfd298 | 1 | #ifndef _ROS_SERVICE_PlannerService_h |
irfantitok | 0:8f3710bfd298 | 2 | #define _ROS_SERVICE_PlannerService_h |
irfantitok | 0:8f3710bfd298 | 3 | #include <stdint.h> |
irfantitok | 0:8f3710bfd298 | 4 | #include <string.h> |
irfantitok | 0:8f3710bfd298 | 5 | #include <stdlib.h> |
irfantitok | 0:8f3710bfd298 | 6 | #include "ros/msg.h" |
irfantitok | 0:8f3710bfd298 | 7 | #include "geometry_msgs/PoseStamped.h" |
irfantitok | 0:8f3710bfd298 | 8 | #include "trajectory_msgs/MultiDOFJointTrajectory.h" |
irfantitok | 0:8f3710bfd298 | 9 | #include "geometry_msgs/Vector3.h" |
irfantitok | 0:8f3710bfd298 | 10 | #include "mav_planning_msgs/PolynomialTrajectory4D.h" |
irfantitok | 0:8f3710bfd298 | 11 | |
irfantitok | 0:8f3710bfd298 | 12 | namespace mav_planning_msgs |
irfantitok | 0:8f3710bfd298 | 13 | { |
irfantitok | 0:8f3710bfd298 | 14 | |
irfantitok | 0:8f3710bfd298 | 15 | static const char PLANNERSERVICE[] = "mav_planning_msgs/PlannerService"; |
irfantitok | 0:8f3710bfd298 | 16 | |
irfantitok | 0:8f3710bfd298 | 17 | class PlannerServiceRequest : public ros::Msg |
irfantitok | 0:8f3710bfd298 | 18 | { |
irfantitok | 0:8f3710bfd298 | 19 | public: |
irfantitok | 0:8f3710bfd298 | 20 | typedef geometry_msgs::PoseStamped _start_pose_type; |
irfantitok | 0:8f3710bfd298 | 21 | _start_pose_type start_pose; |
irfantitok | 0:8f3710bfd298 | 22 | typedef geometry_msgs::Vector3 _start_velocity_type; |
irfantitok | 0:8f3710bfd298 | 23 | _start_velocity_type start_velocity; |
irfantitok | 0:8f3710bfd298 | 24 | typedef geometry_msgs::PoseStamped _goal_pose_type; |
irfantitok | 0:8f3710bfd298 | 25 | _goal_pose_type goal_pose; |
irfantitok | 0:8f3710bfd298 | 26 | typedef geometry_msgs::Vector3 _goal_velocity_type; |
irfantitok | 0:8f3710bfd298 | 27 | _goal_velocity_type goal_velocity; |
irfantitok | 0:8f3710bfd298 | 28 | typedef geometry_msgs::Vector3 _bounding_box_type; |
irfantitok | 0:8f3710bfd298 | 29 | _bounding_box_type bounding_box; |
irfantitok | 0:8f3710bfd298 | 30 | |
irfantitok | 0:8f3710bfd298 | 31 | PlannerServiceRequest(): |
irfantitok | 0:8f3710bfd298 | 32 | start_pose(), |
irfantitok | 0:8f3710bfd298 | 33 | start_velocity(), |
irfantitok | 0:8f3710bfd298 | 34 | goal_pose(), |
irfantitok | 0:8f3710bfd298 | 35 | goal_velocity(), |
irfantitok | 0:8f3710bfd298 | 36 | bounding_box() |
irfantitok | 0:8f3710bfd298 | 37 | { |
irfantitok | 0:8f3710bfd298 | 38 | } |
irfantitok | 0:8f3710bfd298 | 39 | |
irfantitok | 0:8f3710bfd298 | 40 | virtual int serialize(unsigned char *outbuffer) const |
irfantitok | 0:8f3710bfd298 | 41 | { |
irfantitok | 0:8f3710bfd298 | 42 | int offset = 0; |
irfantitok | 0:8f3710bfd298 | 43 | offset += this->start_pose.serialize(outbuffer + offset); |
irfantitok | 0:8f3710bfd298 | 44 | offset += this->start_velocity.serialize(outbuffer + offset); |
irfantitok | 0:8f3710bfd298 | 45 | offset += this->goal_pose.serialize(outbuffer + offset); |
irfantitok | 0:8f3710bfd298 | 46 | offset += this->goal_velocity.serialize(outbuffer + offset); |
irfantitok | 0:8f3710bfd298 | 47 | offset += this->bounding_box.serialize(outbuffer + offset); |
irfantitok | 0:8f3710bfd298 | 48 | return offset; |
irfantitok | 0:8f3710bfd298 | 49 | } |
irfantitok | 0:8f3710bfd298 | 50 | |
irfantitok | 0:8f3710bfd298 | 51 | virtual int deserialize(unsigned char *inbuffer) |
irfantitok | 0:8f3710bfd298 | 52 | { |
irfantitok | 0:8f3710bfd298 | 53 | int offset = 0; |
irfantitok | 0:8f3710bfd298 | 54 | offset += this->start_pose.deserialize(inbuffer + offset); |
irfantitok | 0:8f3710bfd298 | 55 | offset += this->start_velocity.deserialize(inbuffer + offset); |
irfantitok | 0:8f3710bfd298 | 56 | offset += this->goal_pose.deserialize(inbuffer + offset); |
irfantitok | 0:8f3710bfd298 | 57 | offset += this->goal_velocity.deserialize(inbuffer + offset); |
irfantitok | 0:8f3710bfd298 | 58 | offset += this->bounding_box.deserialize(inbuffer + offset); |
irfantitok | 0:8f3710bfd298 | 59 | return offset; |
irfantitok | 0:8f3710bfd298 | 60 | } |
irfantitok | 0:8f3710bfd298 | 61 | |
irfantitok | 0:8f3710bfd298 | 62 | const char * getType(){ return PLANNERSERVICE; }; |
irfantitok | 0:8f3710bfd298 | 63 | const char * getMD5(){ return "6090fe8ab3df1362b8c26859b8850940"; }; |
irfantitok | 0:8f3710bfd298 | 64 | |
irfantitok | 0:8f3710bfd298 | 65 | }; |
irfantitok | 0:8f3710bfd298 | 66 | |
irfantitok | 0:8f3710bfd298 | 67 | class PlannerServiceResponse : public ros::Msg |
irfantitok | 0:8f3710bfd298 | 68 | { |
irfantitok | 0:8f3710bfd298 | 69 | public: |
irfantitok | 0:8f3710bfd298 | 70 | typedef bool _success_type; |
irfantitok | 0:8f3710bfd298 | 71 | _success_type success; |
irfantitok | 0:8f3710bfd298 | 72 | typedef mav_planning_msgs::PolynomialTrajectory4D _polynomial_plan_type; |
irfantitok | 0:8f3710bfd298 | 73 | _polynomial_plan_type polynomial_plan; |
irfantitok | 0:8f3710bfd298 | 74 | typedef trajectory_msgs::MultiDOFJointTrajectory _sampled_plan_type; |
irfantitok | 0:8f3710bfd298 | 75 | _sampled_plan_type sampled_plan; |
irfantitok | 0:8f3710bfd298 | 76 | |
irfantitok | 0:8f3710bfd298 | 77 | PlannerServiceResponse(): |
irfantitok | 0:8f3710bfd298 | 78 | success(0), |
irfantitok | 0:8f3710bfd298 | 79 | polynomial_plan(), |
irfantitok | 0:8f3710bfd298 | 80 | sampled_plan() |
irfantitok | 0:8f3710bfd298 | 81 | { |
irfantitok | 0:8f3710bfd298 | 82 | } |
irfantitok | 0:8f3710bfd298 | 83 | |
irfantitok | 0:8f3710bfd298 | 84 | virtual int serialize(unsigned char *outbuffer) const |
irfantitok | 0:8f3710bfd298 | 85 | { |
irfantitok | 0:8f3710bfd298 | 86 | int offset = 0; |
irfantitok | 0:8f3710bfd298 | 87 | union { |
irfantitok | 0:8f3710bfd298 | 88 | bool real; |
irfantitok | 0:8f3710bfd298 | 89 | uint8_t base; |
irfantitok | 0:8f3710bfd298 | 90 | } u_success; |
irfantitok | 0:8f3710bfd298 | 91 | u_success.real = this->success; |
irfantitok | 0:8f3710bfd298 | 92 | *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; |
irfantitok | 0:8f3710bfd298 | 93 | offset += sizeof(this->success); |
irfantitok | 0:8f3710bfd298 | 94 | offset += this->polynomial_plan.serialize(outbuffer + offset); |
irfantitok | 0:8f3710bfd298 | 95 | offset += this->sampled_plan.serialize(outbuffer + offset); |
irfantitok | 0:8f3710bfd298 | 96 | return offset; |
irfantitok | 0:8f3710bfd298 | 97 | } |
irfantitok | 0:8f3710bfd298 | 98 | |
irfantitok | 0:8f3710bfd298 | 99 | virtual int deserialize(unsigned char *inbuffer) |
irfantitok | 0:8f3710bfd298 | 100 | { |
irfantitok | 0:8f3710bfd298 | 101 | int offset = 0; |
irfantitok | 0:8f3710bfd298 | 102 | union { |
irfantitok | 0:8f3710bfd298 | 103 | bool real; |
irfantitok | 0:8f3710bfd298 | 104 | uint8_t base; |
irfantitok | 0:8f3710bfd298 | 105 | } u_success; |
irfantitok | 0:8f3710bfd298 | 106 | u_success.base = 0; |
irfantitok | 0:8f3710bfd298 | 107 | u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
irfantitok | 0:8f3710bfd298 | 108 | this->success = u_success.real; |
irfantitok | 0:8f3710bfd298 | 109 | offset += sizeof(this->success); |
irfantitok | 0:8f3710bfd298 | 110 | offset += this->polynomial_plan.deserialize(inbuffer + offset); |
irfantitok | 0:8f3710bfd298 | 111 | offset += this->sampled_plan.deserialize(inbuffer + offset); |
irfantitok | 0:8f3710bfd298 | 112 | return offset; |
irfantitok | 0:8f3710bfd298 | 113 | } |
irfantitok | 0:8f3710bfd298 | 114 | |
irfantitok | 0:8f3710bfd298 | 115 | const char * getType(){ return PLANNERSERVICE; }; |
irfantitok | 0:8f3710bfd298 | 116 | const char * getMD5(){ return "2b0f390ba4c264f0182acc6839f4d8b4"; }; |
irfantitok | 0:8f3710bfd298 | 117 | |
irfantitok | 0:8f3710bfd298 | 118 | }; |
irfantitok | 0:8f3710bfd298 | 119 | |
irfantitok | 0:8f3710bfd298 | 120 | class PlannerService { |
irfantitok | 0:8f3710bfd298 | 121 | public: |
irfantitok | 0:8f3710bfd298 | 122 | typedef PlannerServiceRequest Request; |
irfantitok | 0:8f3710bfd298 | 123 | typedef PlannerServiceResponse Response; |
irfantitok | 0:8f3710bfd298 | 124 | }; |
irfantitok | 0:8f3710bfd298 | 125 | |
irfantitok | 0:8f3710bfd298 | 126 | } |
irfantitok | 0:8f3710bfd298 | 127 | #endif |