Skip to content

Commit

Permalink
Update motion planning docs
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasr22 committed Nov 1, 2024
1 parent e6d69e1 commit d6be1b5
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions doc/planning/motion_planning.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,53 @@
# Motion Planning

**Summary:** [motion_planning.py](.../code/planning/local_planner/src/motion_planning.py):
The motion planning is responsible for collecting all the speeds from the different components and choosing the optimal one to be fowarded into the acting. It also is capable to change the trajectory for an overtaking maneuver.
The motion planning is responsible for collecting all the velocity recommendations from the different components and choosing the optimal one to be fowarded into the acting. It also is capable to change the trajectory for an overtaking maneuver.

- [Overview](#overview)
- [Component](#component)
- [ROS Data Interface](#ros-data-interface)
- [Subscribed Topics](#subscribed-topics)
- [Published Topics](#published-topics)
- [Node Creation + Running Tests](#node-creation--running-tests)

## Overview

This module is responsible for adjusting the current speed and the current trajectory according to the traffic situation. It subscribes to topics that provide information about the current speed of the vehicle, the current heading and many more to navigate safely in the simulation.
It publishes topics that provide information about the target speed, trajectoy changes, current waypoint and if an overtake was successful.
This module contains one ROS node and is responsible for adjusting and publishing the target velocity and the target trajectory according to the traffic situation.
It subscribes to topics that provide information about the current velocity of the vehicle, the current heading and many more to navigate safely in the simulation.
It also publishes a topic that indicates wether an overtake maneuver was successful or not.

This file is also responsible for providing a ```target_speed of -3``` for acting, whenever we need to use the Unstuck Behavior. -3 is the only case we can drive backwards right now,
since we only need it for the unstuck routine. It also creates an overtake trajectory, whenever the unstuck behavior calls for it.
This component is also responsible for providing a target_speed of `-3` for acting, whenever we need to use the Unstuck Behavior. This is currently the only behavior that allows the car to drive backwards.

## Component

The Motion Planning only consists of one node that contains all subscribers and publishers. It uses some utility functions from [utils.py](../../code/planning/src/local_planner/utils.py).
The trajectory is calculated by the global planner and is adjusted by the motion planning node.
When the decision making node decides that an overtake maneuver is necessary, the motion planning node will adjust the trajectory accordingly.
Otherwise the received trajectory is published without any changes.

## ROS Data Interface

### Subscribed Topics

This node subscribes to the following topics:

- `/paf/hero/speed_limit`: Subscribes to the speed Limit.
- `/carla/hero/Speed`: Subscribes to the current speed.
- `/paf/hero/acc_velocity`: Subscribes to the speed published by the acc.
- `/paf/hero/Center/traffic_light_y_distance`: Subscribes to the distance the traffic light has to the upper camera bound in pixels.
- `/paf/hero/collision`: Subscribes to the collision published by the Collision Check.
- `/paf/hero/curr_behavior`: Subscribes to Current Behavior pubished by the Decision Making.
- `/paf/hero/current_heading`: Subscribes to the filtered heading of the ego vehicle.
- `/paf/hero/trajectory_global`: Subscribes to the global trajectory, which is calculated at the start of the simulation.
- `/paf/hero/current_pos`: Subscribes to the filtered position of our car.
- `/paf/hero/curr_behavior`: Subscribes to Current Behavior pubished by the Decision Making.
- `/paf/hero/acc_velocity`: Subscribes to the speed published by the acc.
- `/paf/hero/waypoint_distance`: Subscribes to the Carla Waypoint to get the new road option.
- `/paf/hero/current_wp`: Subscribes to the current waypoint.
- `/paf/hero/lane_change_distance`: Subscribes to the Carla Waypoint to check if the next Waypoint is a lane change.
- `/paf/hero/collision`: Subscribes to the collision published by the Collision Check.
- `/paf/hero/Center/traffic_light_y_distance`: Subscribes to the distance the traffic light has to the upper camera bound in pixels.
- `/paf/hero/speed_limit`: Subscribes to the speed limit.
- `/paf/hero/trajectory_global`: Subscribes to the global trajectory, which is calculated at the start of the simulation.
- `/paf/hero/unstuck_distance`: Subscribes to the distance travelled by the unstuck maneuver.
- `/paf/hero/waypoint_distance`: Subscribes to the Carla Waypoint to get the new road option.

### Published Topics

This node publishes the following topics:

- `/paf/hero/trajectory`: Publishes the new adjusted trajectory.
- `/paf/hero/target_velocity`: Publishes the new calcualted Speed.
- `/paf/hero/current_wp`: Publishes according to our position the index of the current point on the trajectory.
- `/paf/hero/overtake_success`: Publishes if an overtake was successful.
- `/paf/hero/overtake_success`: Publishes if an overtake was successful. ([std_msgs/Float32](http://docs.ros.org/en/api/std_msgs/html/msg/Float32.html))
- `/paf/hero/target_velocity`: Publishes the target velocity in m/s. ([std_msgs/Float32](http://docs.ros.org/en/api/std_msgs/html/msg/Float32.html))
- `/paf/hero/trajectory`: Publishes the new adjusted trajectory. ([nav_msgs/Path](https://docs.ros.org/en/lunar/api/nav_msgs/html/msg/Path.html))

## Node Creation + Running Tests

Expand Down

0 comments on commit d6be1b5

Please sign in to comment.