Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Traffic Manager features for 0.9.13 #4786

Merged
merged 35 commits into from
Nov 3, 2021

Conversation

jackbart94
Copy link
Contributor

@jackbart94 jackbart94 commented Oct 25, 2021

Description

New Traffic Manager features for 0.9.13. This PR includes:

  1. The option for users to use traffic_manager.set_path(actor, path) to pass a list of carla.Location elements to a vehicle controlled by the Traffic Manager, which will follow the given path. This has some limitations, given by the amount and the location of points in the path. Users should be aware that, in order for it to work, the locations should not be inside intersections (because routes sometimes overlap) and should give at least one location between two different intersections.

  2. Introduction of a RoadOption element in each SimpleWaypoint, which can be: Void, Left, Right, Straight, LaneFollow, RoadEnd. Currently developing a way to have more options, so that if an intersection has more than one exits that go left, they can be identified separately.

  3. Users can now get the next action that a vehicle will perform (traffic_manager.get_next_action(actor)), or the whole action buffer that the vehicle has already planned. (traffic_manager.get_all_actions(actor)). The first one will return a list with two elements, the first one being the next RoadOption, the second being the waypoint where it's going to be performed. If there's no particular action other than following the lane, the action returned will be LaneFollow and the waypoint will be the furthest in the buffer. The second one will return a list of lists with two elements, which will be the same as before, with each RoadOption that will be performed and the waypoint where said RoadOption is going to begin. If it's only lane following, the same principle as get_next_action is applied.

  4. The option for users to use traffic_manager.set_route(actor, route) to pass a list of RoadOptions (in the form of strings) to a vehicle controlled by the Traffic Manager, which will follow the given high-level route. This has currently some limitations, given by the fact that there might be more than one exit with the same RoadOption name, and also doesn't work with lane changes.

  5. Fixes traffic_manager.keep_right_rule_percentage(actor, percentage) parameter and traffic_manager.set_distance_leading_vehicle(actor, percentage)

  6. Introduces traffic_manager.random_left_lanechange_percentage(actor, percentage) and traffic_manager.random_right_lanechange_percentage(actor, percentage) , which allow the user to set a random chance for a vehicle to perform a lane change at any given frame. Vehicles already have a policy for lane changes, this parameter will just try to trigger a forced lane changes, and only while the vehicle is moving with some velocity.

  7. Improved braking of vehicles, according to new physics.

  8. Changes in new VehicleLightStage.

Where has this been tested?

  • Platform(s): Ubuntu 18
  • Python version(s): Python 3.6
  • Unreal Engine version(s): 4.26

Possible Drawbacks

Requires quite some testing to avoid possible edge cases.


This change is Reviewable

jackbart94 and others added 17 commits February 12, 2021 11:24
Added new constants
Fixed collisions at high speed.
Implementation of RoadOption for SimpleWaypoints
Implementation of GetNextAction and GetActionBuffer for TM actions
Parameters for setting the path import and starting the import process.
Other minor changes
Introduced getter in PythonAPI for high level path
Introduced getter in PythonAPI for next high level action
Introduced parameters for random lane changes
Fixed keep right parameter
… controlled vehicles.

Method in Localization Stage to compute a path using RoadOptions.
@jackbart94 jackbart94 requested a review from a team as a code owner October 25, 2021 11:23
@update-docs
Copy link

update-docs bot commented Oct 25, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update our CHANGELOG.md based on your changes.

Copy link
Contributor

@joel-mb joel-mb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 4 files at r2, 1 of 17 files at r3, 3 of 13 files at r6, 1 of 1 files at r7, 2 of 7 files at r8, 2 of 13 files at r9.
Reviewable status: 6 of 26 files reviewed, 4 unresolved discussions (waiting on @glopezdiest, @jackbart94, and @joel-mb)


LibCarla/source/carla/trafficmanager/InMemoryMap.h, line 20 at r8 (raw file):

#include "carla/client/Map.h"
#include "carla/client/Waypoint.h"
#include "carla/client/DebugHelper.h"

Is this needed?


LibCarla/source/carla/trafficmanager/LocalizationStage.h, line 58 at r9 (raw file):

mported_waypoints

I would call this argument imported_locationsor imported_path. imported_waypoints can be confusing because we are not using waypoints.


LibCarla/source/carla/trafficmanager/LocalizationStage.h, line 63 at r9 (raw file):

imported_route

I would call this argument imported_actions if we use imported_locations in the previous one.


LibCarla/source/carla/trafficmanager/LocalizationStage.cpp, line 169 at r9 (raw file):

imported_points

I would call this imported_path or imported_locations

Copy link
Contributor Author

@jackbart94 jackbart94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 6 of 26 files reviewed, 2 unresolved discussions (waiting on @glopezdiest and @joel-mb)


LibCarla/source/carla/trafficmanager/InMemoryMap.h, line 20 at r8 (raw file):

Previously, joel-mb wrote…

Is this needed?

Done.


LibCarla/source/carla/trafficmanager/LocalizationStage.cpp, line 169 at r9 (raw file):

Previously, joel-mb wrote…
imported_points

I would call this imported_path or imported_locations

Done.

Changes name of variables in Loc stage
Removed unnecessary import
Copy link
Contributor

@joel-mb joel-mb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 5 files at r10, 2 of 4 files at r11, 1 of 5 files at r12, all commit messages.
Reviewable status: 8 of 26 files reviewed, all discussions resolved (waiting on @glopezdiest)

@jackbart94 jackbart94 removed the request for review from glopezdiest October 29, 2021 15:12
joel-mb
joel-mb previously approved these changes Oct 29, 2021
Copy link
Contributor

@joel-mb joel-mb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 19 files at r1, 1 of 17 files at r3, 2 of 13 files at r6, 1 of 7 files at r8, 7 of 13 files at r9, 1 of 5 files at r10, 1 of 4 files at r11, 4 of 5 files at r12.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @jackbart94)

Copy link
Contributor

@joel-mb joel-mb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r13, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @jackbart94)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants