RAPP Platform API
 All Classes Namespaces Files Functions Variables Typedefs
PathPlanningPlan2D.py
Go to the documentation of this file.
1 from RappCloud.Objects import (
2  File,
3  Payload)
4 
5 from Cloud import (
6  CloudMsg,
7  CloudRequest,
8  CloudResponse)
9 
10 
11 class PathPlanningPlan2D(CloudMsg):
12  """ Path Planning Plan 2D Cloud Message object
13 
14  For more information read on:
15  https://github.com/rapp-project/rapp-platform/tree/master/rapp_path_planning/rapp_path_planning
16  """
17 
18  class Request(CloudRequest):
19  """ Path Planning Plan 2D Cloud Request object.
20 
21  PathPlanningPlan2D.Request
22  """
23  def __init__(self, **kwargs):
24  """!
25  Constructor
26 
27  @param **kwargs - Keyword arguments. Apply values to the request attributes.
28  - @ref map_name
29  - @ref robot_type
30  - @ref algorithm
31  - @ref pose_start
32  - @ref pose_goal
33  """
34 
35  ## The map name.
36  self.map_name = ''
37  ## The robot type. It is required to determine it's parameters
38  # (footprint etc.)
39  self.robot_type = ''
40  ## The path planning algorithm to apply.
41  self.algorithm = ''
42  ## Start pose of the robot.
43  # Same structure to ROS-GeometryMsgs/PoseStamped
44  self.pose_start = {}
45  ## Goal pose of the robot.
46  # Same structure to ROS-GeometryMsgs/PoseStamped
47  self.pose_goal = {}
48  super(PathPlanningPlan2D.Request, self).__init__(**kwargs)
49 
50 
51  def make_payload(self):
52  """ Create and return the Payload of the Request. """
53  return Payload(
54  map_name=self.map_name,
55  robot_type=self.robot_type,
56  algorithm=self.algorithm,
57  start=self.pose_start,
58  goal=self.pose_goal)
59 
60 
61 
62  def make_files(self):
63  """ Create and return Array of File objects of the Request. """
64  return []
65 
66 
67  class Response(CloudResponse):
68  """ Path Planning Plan 2D Cloud Response object.
69 
70  PathPlanningPlan2D.Response
71  """
72  def __init__(self, **kwargs):
73  """!
74  Constructor
75 
76  @param **kwargs - Keyword arguments. Apply values to the request attributes.
77  - @ref error
78  """
79 
80  ## Error message
81  self.error = ''
82  ## Plan Status. Can be one of:
83  # - 0 : path cannot be planned.
84  # - 1 : path found.
85  # - 2 : wrong map name.
86  # - 3 : wrong robot type.
87  # - 4 : wrong algorithm.
88  self.plan_found = 0
89  ## Ff plan_found is equal to 0 (path found), this is an array of
90  # waypoints from start to goal.
91  self.path = []
92  super(PathPlanningPlan2D.Response, self).__init__(**kwargs)
93 
94 
95  def __init__(self, **kwargs):
96  """!
97  Constructor
98 
99  @param **kwargs - Keyword arguments. Apply values to the request attributes.
100  - @ref Request.map_name
101  - @ref Request.robot_type
102  - @ref Request.algorithm
103  - @ref Request.pose_start
104  - @ref Request.pose_goal
105  """
106 
107  # Create and hold the Request object for this CloudMsg
109  # Create and hold the Response object for this CloudMsg
111  super(PathPlanningPlan2D, self).__init__(
112  svcname='path_planning_plan_path_2d', **kwargs)
113 
114 
path
Ff plan_found is equal to 0 (path found), this is an array of waypoints from start to goal...