Skip to content

Commit 6374013

Browse files
authored
Merge pull request #773 from una-auxme/762-general-documentation-lanechange-unstuck
762 general documentation lanechange unstuck
2 parents 03a8bb8 + ce90bd0 commit 6374013

19 files changed

+269
-421
lines changed
-39.1 KB
Binary file not shown.

doc/general/architecture_current.md

+25-47
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ The document contains an overview over all [nodes](#overview) and [topics](#topi
88
- [Vision Node (vision\_node.py)](#vision-node-vision_nodepy)
99
- [Traffic Light Detection (traffic\_light\_node.py)](#traffic-light-detection-traffic_light_nodepy)
1010
- [Position Heading Node (position\_heading\_publisher\_node.py)](#position-heading-node-position_heading_publisher_nodepy)
11-
- [Global distances (global\_plan\_distance\_publisher.py)](#global-distances-global_plan_distance_publisherpy)
1211
- [Kalman filtering (kalman\_filter.py)](#kalman-filtering-kalman_filterpy)
1312
- [Localization](#localization)
1413
- [Planning](#planning)
1514
- [PrePlaner (global\_planner.py)](#preplaner-global_plannerpy)
15+
- [Global distances (global\_plan\_distance\_publisher.py)](#global-distances-global_plan_distance_publisherpy)
1616
- [Behavior Agent (behavior\_agent)](#behavior-agent-behavior_agent)
1717
- [Local Planning](#local-planning)
1818
- [Acting](#acting)
@@ -112,17 +112,6 @@ Publishes:
112112
- ```/paf/hero/current_pos``` \(/pure_pursuit_controller, /MotionPlanning, /ACC, /MainFramePublisher, /GlobalPlanDistance, /position_heading_publisher_node, /curr_behavior \) ([geometry_msgs/PoseStamped](https://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/PoseStamped.html))
113113
- ```/paf/hero/current_heading``` \(/behavior_agent\) ([std_msgs/Float32](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32.html))
114114

115-
### Global distances ([global_plan_distance_publisher.py](/../paf/code/perception/src/global_plan_distance_publisher.py))
116-
117-
Subscriptions:
118-
119-
- ```/paf/hero/current_pos``` \(/position_heading_publisher_node\) ([geometry_msgs/PoseStamped](https://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/PoseStamped.html))
120-
- ```/carla/hero/global_plan``` \(/ \) ([ros_carla_msgs/msg/CarlaRoute](https://github.com/carla-simulator/ros-carla-msgs/blob/leaderboard-2.0/msg/CarlaRoute.msg))
121-
122-
Publishes:
123-
124-
- ```/paf/hero/current_waypoint``` \(/MotionPlanning, /behavior_agent\) ([geographic_msgs/WayPoint](https://docs.ros.org/en/melodic/api/geographic_msgs/html/msg/WayPoint.html))
125-
126115
### Kalman filtering ([kalman_filter.py](/../paf/code/perception/src/kalman_filter.py))
127116

128117
Subscriptions:
@@ -170,11 +159,21 @@ Publishes:
170159
- ```/paf/hero/trajectory_global``` \(/ACC, /MotionPlanning\) ([nav_msgs/Path](https://docs.ros.org/en/noetic/api/nav_msgs/html/msg/Path.html))
171160
- ```/paf/hero/speed_limits_OpenDrive``` \(/ACC\) ([sensor_msgs/Float32MultiArray](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32MultiArray.html))
172161

162+
### Global distances ([global_plan_distance_publisher.py](/../paf/code/planning/src/global_planner/global_plan_distance_publisher.py))
163+
164+
Subscriptions:
165+
166+
- ```/paf/hero/current_pos``` \(/position_heading_publisher_node\) ([geometry_msgs/PoseStamped](https://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/PoseStamped.html))
167+
- ```/carla/hero/global_plan``` \(/ \) ([ros_carla_msgs/msg/CarlaRoute](https://github.com/carla-simulator/ros-carla-msgs/blob/leaderboard-2.0/msg/CarlaRoute.msg))
168+
169+
Publishes:
170+
171+
- ```/paf/hero/current_waypoint``` \(/MotionPlanning, /behavior_agent\) ([geographic_msgs/WayPoint](https://docs.ros.org/en/melodic/api/geographic_msgs/html/msg/WayPoint.html))
172+
173173
### Behavior Agent ([behavior_agent](/../paf/code/planning/src/behavior_agent/))
174174

175-
Decides which speed is the right one to pass through a certain situation and
176-
also checks if an overtake is necessary.
177-
Everything is based on the data from the Perception [Perception](#Perception). More about the behavior tree can be found [here](../planning/Behavior_tree.md)
175+
Decides which situation occurs and how the car reacts to it, e.g. checks for intersection, overtake, lanechange and more.
176+
Everything is based on the data from the [Perception](#Perception) and Intermediate Layer. More about the behavior tree can be found [here](../planning/Behavior_tree.md)
178177

179178
Subscriptions:
180179

@@ -187,7 +186,6 @@ Subscriptions:
187186
- ```/paf/hero/Center/traffic_light_y_distance``` \(/TrafficLightNode\) ([std_msgs/Int16](https://docs.ros.org/en/api/std_msgs/html/msg/Int16.html))
188187
- ```/paf/hero/max_velocity``` \(/behavior_agent\) ([std_msgs/Float32](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32.html))
189188
- ```/paf/hero/speed_limit``` \(/ACC\) ([std_msgs/Float32](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32.html))
190-
- ```/paf/hero/collision``` \(/CollisionCheck\) ([sensor_msgs/Float32MultiArray](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32MultiArray.html))
191189
- ```/paf/hero/current_pos``` \(/position_heading_publisher_node\) ([geometry_msgs/PoseStamped](https://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/PoseStamped.html))
192190
- ```/paf/hero/current_heading``` \(/position_heading_publisher_node\) ([std_msgs/Float32](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32.html))
193191
- ```/paf/hero/overtake_success``` \(/MotionPlanning\) ([std_msgs/Float32](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32.html))
@@ -196,35 +194,28 @@ Subscriptions:
196194

197195
Publishes:
198196

199-
[maneuvers.py](/../paf/code/planning/src/behavior_agent/behaviours/maneuvers.py)
200-
201197
- ```/paf/hero/curr_behavior``` \(/MotionPlanning, /vehicle_controller\) ([std_msgs/String](https://docs.ros.org/en/api/std_msgs/html/msg/String.html))
202-
- ```/paf/hero/unstuck_distance``` \(/ACC, /MotionPlanning\) ([std_msgs/Float32](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32.html))
203-
- ```/paf/hero/unstuck_flag``` \(/ACC\) ([std_msg/Bool](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Bool.html))
204198

205-
[intersection.py](/../paf/code/planning/src/behavior_agent/behaviours/intersection.py)
199+
Includes:
206200

207-
- ```/paf/hero/curr_behavior``` \(/MotionPlanning, /vehicle_controller\) ([std_msgs/String](https://docs.ros.org/en/api/std_msgs/html/msg/String.html))
208-
209-
[lane_change.py](/../paf/code/planning/src/behavior_agent/behaviours/lane_change.py)
210-
211-
- ```/paf/hero/curr_behavior``` \(/MotionPlanning, /vehicle_controller\) ([std_msgs/String](https://docs.ros.org/en/api/std_msgs/html/msg/String.html))
201+
[cruise.py](/../paf/code/planning/src/behavior_agent/behaviors/cruise.py)
212202

213-
[meta.py](/../paf/code/planning/src/behavior_agent/behaviours/meta.py)
203+
[intersection.py](/../paf/code/planning/src/behavior_agent/behaviors/intersection.py)
204+
205+
[lane_change.py](/../paf/code/planning/src/behavior_agent/behaviors/lane_change.py)
214206

215-
- ```/paf/hero/max_velocity``` \(/behavior_agent\) ([std_msgs/Float32](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32.html))
207+
[leave_parking_space.py](/../paf/code/planning/src/behavior_agent/behaviors/leave_parking_space.py)
216208

217-
[overtake.py](/../paf/code/planning/src/behavior_agent/behaviours/overtake.py)
209+
[overtake.py](/../paf/code/planning/src/behavior_agent/behaviors/overtake.py)
218210

219-
- ```/paf/hero/curr_behavior``` \(/MotionPlanning, /vehicle_controller\) ([std_msgs/String](https://docs.ros.org/en/api/std_msgs/html/msg/String.html))
211+
[unstuck_routine.py](/../paf/code/planning/src/behavior_agent/behaviors/unstuck_routine.py)
220212

221213
### [Local Planning](../planning/Local_Planning.md)
222214

223-
It consists of three components:
215+
It consists of two components:
224216

225-
- [Collision Check](../planning//Collision_Check.md): Checks for collisions based on objects recieved from [Perception](#perception)
226-
- [ACC](../planning/ACC.md): Generates a new speed based on a possible collision recieved from Collision Check and speedlimits recieved from [Global Planner](#global-planning)
227-
- [Motion Planning](../planning/motion_planning.md): Decides the target speed and modifies trajectory if signal recieved from [Behavior Agent](#behavior-agent-behavior_agent)
217+
- [ACC](../planning/ACC.md): Generates a new speed based on a possible collision received from Collision Check and speedlimits received from [Global Planner](#global-planning)
218+
- [Motion Planning](../planning/motion_planning.md): Decides the target speed and modifies trajectory if signal received from [Behavior Agent](#behavior-agent-behavior_agent)
228219

229220
Subscriptions:
230221

@@ -236,12 +227,6 @@ Subscriptions:
236227
- ```/paf/hero/speed_limits_OpenDrive``` \(/PrePlanner\) ([sensor_msgs/Float32MultiArray](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32MultiArray.html))
237228
- ```/paf/hero/trajectory_global``` \(/PrePlanner\) ([nav_msgs/Path](https://docs.ros.org/en/noetic/api/nav_msgs/html/msg/Path.html))
238229
- ```/paf/hero/current_pos``` \(/position_heading_publisher_node\) ([geometry_msgs/PoseStamped](https://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/PoseStamped.html))
239-
- ```/paf/hero/collision``` \(/CollisionCheck\) ([sensor_msgs/Float32MultiArray](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32MultiArray.html))
240-
241-
[collision_check.py](/../paf/code/planning/src/local_planner/collision_check.py)
242-
243-
- ```/carla/hero/Speed``` \(/carla_ros_bridge\) ([ros_carla_msgs/msg/CarlaSpeedometer](https://github.com/carla-simulator/ros-carla-msgs/blob/leaderboard-2.0/msg/CarlaSpeedometer.msg))
244-
- ```/paf/hero/Center/object_distance``` \(/CollisionCheck\) ([sensor_msgs/Float32MultiArray](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32MultiArray.html))
245230

246231
[motion_planning.py](/../paf/code/planning/src/local_planner/motion_planning.py)
247232

@@ -254,7 +239,6 @@ Subscriptions:
254239
- ```/paf/hero/unchecked_emergency``` \(/\) ([std_msg/Bool](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Bool.html))
255240
- ```/paf/hero/acc_velocity``` \(/ACC\) ([std_msgs/Float32](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32.html))
256241
- ```/paf/hero/current_waypoint``` \(/GlobalPlanDistance\) ([geographic_msgs/WayPoint](https://docs.ros.org/en/melodic/api/geographic_msgs/html/msg/WayPoint.html))
257-
- ```/paf/hero/collision``` \(/CollisionCheck\) ([sensor_msgs/Float32MultiArray](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32MultiArray.html))
258242
- ```/paf/hero/Center/traffic_light_y_distance``` \(/TrafficLightNode\) ([std_msgs/Int16](https://docs.ros.org/en/api/std_msgs/html/msg/Int16.html))
259243
- ```/paf/hero/unstuck_distance``` \(/behavior_agent\) ([std_msgs/Float32](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32.html))
260244
- ```/paf/hero/current_wp``` \(/ACC\) ([std_msgs/Float32](https://docs.ros.org/en/api/std_msgs/html/msg/Float32.html))
@@ -267,12 +251,6 @@ Publishes:
267251
- ```/paf/hero/current_wp``` ([std_msgs/Float32](https://docs.ros.org/en/api/std_msgs/html/msg/Float32.html))
268252
- ```/paf/hero/speed_limit``` \(/behavior_agent\) ([std_msgs/Float32](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32.html))
269253

270-
[collision_check.py](/../paf/code/planning/src/local_planner/collision_check.py)
271-
272-
- ```/paf/hero/emergency``` \(/vehicle_controller\) ([std_msg/Bool](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Bool.html))
273-
- ```/paf/hero/collision``` \(/ACC, /MotionPlanning\) ([sensor_msgs/Float32MultiArray](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32MultiArray.html))
274-
- ```/paf/hero/oncoming``` \(/behavior_agent\) ([std_msgs/Float32](https://docs.ros.org/en/noetic/api/std_msgs/html/msg/Float32.html))
275-
276254
[motion_planning.py](/../paf/code/planning/src/local_planner/motion_planning.py)
277255

278256
- ```/paf/hero/trajectory``` \(/pure_pursuit_controller\) ([nav_msgs/Path](https://docs.ros.org/en/noetic/api/nav_msgs/html/msg/Path.html))

doc/general/architecture_planned.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ The document contains an overview over all [nodes](#overview) and [topics](#topi
1414
- [Global Planning](#global-planning)
1515
- [Decision Making](#decision-making)
1616
- [Local Planning](#local-planning)
17-
- [Collision Check](#collision-check)
1817
- [ACC](#acc)
1918
- [Motion Planning](#motion-planning)
2019
- [Acting](#acting)
@@ -165,14 +164,11 @@ Publishes:
165164

166165
### [Local Planning](../planning/Local_Planning.md)
167166

168-
It consists of three components:
167+
It consists of two components:
169168

170-
- Collision Check: Checks for collisions based on objects recieved from [Perception](#perception)
171169
- ACC: Generates a new speed based on a possible collision recieved from Collision Check and speedlimits recieved from [Global Planner](#global-planning)
172170
- Motion Planning: Decides the target speed and modifies trajectory if signal recieved from [Decision Making](#decision-making)
173171

174-
#### [Collision Check](../planning//Collision_Check.md)
175-
176172
Subscriptions:
177173

178174
- ```Speed``` ([carla_msgs/Speedometer](https://docs.ros.org/en/api/std_msgs/html/msg/Float32.html))

doc/planning/Behavior_tree.md

+21-34
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Behavior Tree
22

3-
**Summary:** This page contains a simple explanation for the behavior tree. For more technical insights have a look at the [code](../../code/planning/src/behavior_agent/behaviours) itself.
3+
**Summary:** This page contains a simple explanation for the behavior tree. For more technical insights have a look at the [code](../../code/planning/src/behavior_agent/behaviors) itself.
44

55
**Disclaimer**: As we mainly built our decision tree on the previous projects [psaf2](https://github.com/ll7/psaf2) and [paf22](https://github.com/ll7/paf22) , most part of the documentation was added here and adjusted to the changes we made.
66

@@ -11,9 +11,7 @@
1111
- [Sequence](#sequence)
1212
- [Condition](#condition)
1313
- [Subtree](#subtree)
14-
- [Intersection](#intersection)
15-
- [Legend](#legend)
16-
- [Other Behaviors](#other-behaviors)
14+
- [Our behaviors](#our-behaviors)
1715
- [Developing guide](#developing-guide)
1816
- [Tree Definition](#tree-definition)
1917
- [Behaviors](#behaviors)
@@ -26,6 +24,7 @@
2624
- [`initialise()`](#initialise)
2725
- [`update()`](#update)
2826
- [`terminate()`](#terminate)
27+
- [Dynamic Reconfigure](#dynamic-reconfigure)
2928

3029
## About
3130

@@ -63,49 +62,30 @@ Is always the first child of a sequence. It decides if the sequence should be ex
6362

6463
Represents a specific task/scenario which is handled by the decision tree.
6564

66-
### Intersection
65+
## Our behaviors
6766

68-
#### Legend
67+
Every behavior is documented detailed in the 'behavior' subfolder:
6968

70-
![BT Legend](../assets/legend_bt.png)
71-
72-
![BT Intersection](../assets/intersection.png)
73-
74-
If there is an intersection coming up, the agent executes the following sequence of behaviors:
75-
76-
- Approach Intersection
77-
78-
Slows down and stops at line if a yellow or red traffic light is detected
79-
80-
- Wait at Intersection
81-
82-
Waits for traffic lights or higher priority traffic
83-
84-
- Enter Intersection
85-
86-
Enters the intersection and follows it predetermined path through the intersection
87-
88-
- Leave Intersection
89-
90-
Leaves the intersection in the right direction
91-
92-
### Other Behaviors
93-
94-
Lane Change and Overtake are built just like Intersection. So there is always an Approach, Wait, Enter and Leave part.
69+
- [Cruise](./behaviors/Cruise.md)
70+
- [Intersection](./behaviors/Intersection.md)
71+
- [LaneChange](./behaviors/LaneChange.md)
72+
- [LeaveParkingSpace](./behaviors/LeaveParkingSpace.md)
73+
- [Overtake](./behaviors/Overtake.md)
74+
- [Unstuck](./behaviors/Unstuck.md)
9575

9676
## Developing guide
9777

9878
### Tree Definition
9979

100-
The tree is defined in the `grow_a_tree()`-function inside `code/planning/src/behavior_agent/behavior_tree.py`, which is also the main node. It can be visualized using an [rqt-Plugin](https://wiki.ros.org/rqt_py_trees).
80+
The tree is defined in the `grow_a_tree()`-function inside the [behavior_tree.py](../../code/planning/src/behavior_agent/behavior_tree.py), which is also the main node. It can be visualized using an [rqt-Plugin](https://wiki.ros.org/rqt_py_trees).
10181

10282
### Behaviors
10383

104-
`Behaviors` are implemented in the `code/planning/src/behavior_agent/behaviors/` directory. All the behaviors used in the current version of the tree are contained as skeletons.
84+
`Behaviors` are implemented in the [behaviors/](../../code/planning/src/behavior_agent/behaviors/) subdirectory. All the behaviors used in the current version of the tree are contained as skeletons.
10585

10686
#### Blackboard
10787

108-
To deal with the asynchronicity of ROS, all the topics this tree subscribes to, should be written to the Blackboard at the beginning of each tick. A node is available, that automates this task. Just add your node to the list in `code/planning/src/behavior_agent/behaviors/topics2blackboard.py`:
88+
To deal with the asynchronicity of ROS, all the topics this tree subscribes to, should be written to the Blackboard at the beginning of each tick. A node is available, that automates this task. Just add your node to the list in the [topics2blackboard.py](../../code/planning/src/behavior_agent/behaviors/topics2blackboard.py):
10989

11090
``` python
11191
...
@@ -161,3 +141,10 @@ Main function of a behavior, that gets called everytime the behavior is ticked.
161141
##### `terminate()`
162142

163143
This gets called, whenever a behavior is cancelled by a higher priority branch. Use to terminate middleware connections or asynchronous Calculations, whose results are not needed anymore.
144+
145+
### Dynamic Reconfigure
146+
147+
Dynamic Reconfigure is implemented in the Behavior Tree. This allows variables to be changed at runtime, which is good for debugging etc. \
148+
If you want to add a new parameter, you need to include them in the
149+
[behavior_config.yaml](../../code/planning/config/behavior_config.yaml) and in the [BEHAVIOR.cfg](../../code/planning/config/BEHAVIOR.cfg) in the `/code/planning/config` subfolder. \
150+
New parameters are added automatically into the blackboard and are available as topic `/params/*parameter_name*`.

doc/planning/Collision_Check.md

-39
This file was deleted.

0 commit comments

Comments
 (0)