-
Notifications
You must be signed in to change notification settings - Fork 0
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
#376 Road Rules definitions in Carla #414
Merged
michalal7
merged 18 commits into
main
from
376-general-road-rules-definitions-in-carla-leaderboard
Jan 17, 2025
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e441711
Add files via upload
michalal7 9b74b1f
Updated carla_traffic_rules.md
michalal7 5b10bff
Fixed Linter markdown and added some information to the doc.
michalal7 9ddb9d7
Next Markdown Linter fix.
michalal7 4a00b94
Next next linter fix.
michalal7 b442603
Next attempt to solve Linter Markdowd issues.
michalal7 8fc4dab
Hopefully solved md issues now.
michalal7 3a09935
One more line break.
michalal7 46d67da
Reduced text for fix.
michalal7 b605972
resolve line too long
seitzseb 0df4628
Another update for Linter markdown.
michalal7 40d8096
"Remove accidentally committed file"
michalal7 f0c4f35
VSCode Trim Trailing Whitespace
michalal7 fd0f6f7
add note for inconsitent traffic rules at junctions
seitzseb 9f9a9cf
Merge branch 'main' into 376-general-road-rules-definitions-in-carla-…
michalal7 3d000cc
Fulfilled suggestion of including information about vehicle behavior …
michalal7 4774a13
Linter issue fix.
michalal7 63e4f85
Merge branch 'main' into 376-general-road-rules-definitions-in-carla-…
michalal7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
# Traffic Rules and Principles in CARLA | ||
|
||
## Table of Contents | ||
|
||
- [Table of Contents](#table-of-contents) | ||
- [Introduction](#introduction) | ||
- [Key Traffic Principles and Complex Interactions](#key-traffic-principles-and-complex-interactions) | ||
- [Using the Traffic Manager in CARLA](#using-the-traffic-manager-in-carla) | ||
- [CARLA Maps and Their Traffic Scenarios](#carla-maps-and-their-traffic-scenarios) | ||
- [Overview of CARLA Maps](#overview-of-carla-maps) | ||
- [Rural and Highway Scenarios](#rural-and-highway-scenarios) | ||
- [Road Network Creation with ASAM OpenDRIVE®](#road-network-creation-with-asam-opendrive) | ||
- [Units of Measurement](#units-of-measurement) | ||
- [References](#references) | ||
|
||
## Introduction | ||
|
||
CARLA (Car Learning to Act) is an open-source simulator for testing and developing autonomous driving systems. It integrates traffic rules to create a flexible environment, letting users adjust regulations and design custom maps to evaluate driving behaviors without following specific national laws. | ||
|
||
## Key Traffic Principles and Complex Interactions | ||
|
||
- **Traffic Signals**: Vehicles must stop at red lights and go on green. | ||
|
||
- **Stop Signs**: Vehicles must stop at stop signs and yield to pedestrians | ||
and other cars. | ||
|
||
- **Lane Management**: Cars should remain in their designated lanes. | ||
|
||
- **Speed Limits**: Different speed limits in various areas of the map allow | ||
testing of speed control and adherence to traffic laws. | ||
|
||
- **Pedestrian Rights**: Vehicles must yield to pedestrians at crosswalks, | ||
which is vital for pedestrian detection and ensuring safe stops. | ||
|
||
- **Intersection Management**: Vehicles must navigate intersections | ||
effectively, managing stop lights and stop signs while yielding when | ||
necessary to keep traffic moving. | ||
*Note: According to the [CARLA documentation](https://carla.readthedocs.io/en/latest/adv_traffic_manager/) the Traffic Manager uses its own priority system at junctions. This is a known problem in the simulation.* | ||
|
||
- **Roundabout Navigation**: Vehicles should yield to cars already in the | ||
roundabout. This tests their ability to navigate circular roads and merge | ||
correctly. | ||
|
||
- **Crosswalk Behavior**: Vehicles need to detect and stop for pedestrians | ||
at crosswalks, highlighting the importance of pedestrian safety. | ||
|
||
- **Bicycle Lane Navigation**: Vehicles should be able to detect and safely | ||
navigate around cyclists in traffic. | ||
|
||
- **Parking Maneuvers**: Vehicles are tested on their ability to park in | ||
tight spaces, simulating real-life parking challenges. | ||
|
||
## Using the Traffic Manager in CARLA | ||
|
||
The Traffic Manager (TM) in CARLA controls vehicle behavior during simulations. Below are key considerations and customization options: | ||
|
||
### General Behavior Patterns | ||
|
||
- **Non-goal-oriented Navigation**: Vehicles follow dynamically generated trajectories, choosing paths randomly at junctions. Their navigation is endless. | ||
- **Speed Adjustment**: Vehicles maintain a target speed of 70% of the speed limit unless explicitly modified. | ||
- **Junction Priority**: Junction handling does not strictly follow traffic regulations. Instead, the TM applies its own priority system, leading to potential issues, such as vehicles inside a roundabout yielding to incoming traffic. This limitation is being addressed. | ||
|
||
### Customizing TM Behavior via Python API | ||
|
||
The TM behavior can be tailored using the Python API. Key functionalities include: | ||
|
||
#### General | ||
|
||
- Create a TM instance connected to a specific port. | ||
- Retrieve the port where the TM is connected. | ||
|
||
#### Safety Conditions | ||
|
||
- Set a minimum stopping distance for vehicles (globally or individually). | ||
- Adjust the desired speed as a percentage of the speed limit. | ||
- Reset traffic lights programmatically. | ||
|
||
#### Collision Management | ||
|
||
- Enable or disable collisions between vehicles and specific actors. | ||
- Configure vehicles to ignore: | ||
- Other vehicles | ||
- Pedestrians | ||
- Traffic lights | ||
|
||
#### Lane Management | ||
|
||
- Force lane changes, overriding collision considerations. | ||
- Enable or disable lane changes for specific vehicles. | ||
|
||
#### Hybrid Physics Mode | ||
|
||
- Enable or disable hybrid physics mode for improved performance. | ||
- Adjust the radius within which physics is applied. | ||
|
||
For more details, refer to the [TM section of the Python API documentation](https://carla.readthedocs.io/en/latest/adv_traffic_manager/#vehicle-behavior-considerations). | ||
|
||
## CARLA Maps and Their Traffic Scenarios | ||
|
||
CARLA has 12 maps, each designed to test different aspects of self-driving, | ||
from basic navigation to complex urban and rural situations. | ||
Users can also create custom maps, allowing for additional testing scenarios | ||
tailored to specific needs. | ||
|
||
### Overview of CARLA Maps | ||
|
||
- **Town 1**: A small town with T-junctions and bridges, focusing on managing | ||
intersections and staying in lanes. | ||
|
||
- **Town 2**: Similar to Town 1, this town includes shops and homes, testing | ||
navigation and awareness of the surroundings. | ||
|
||
- **Town 3**: A larger city area with roundabouts and underpasses, assessing | ||
navigation in roundabouts and speed adjustments. | ||
|
||
- **Town 4**: A small town with a figure-eight road, testing navigation in | ||
multiple lanes and interactions with pedestrians. | ||
|
||
- **Town 5**: An urban area with multilane roads and a highway, focusing on | ||
highway driving and commercial strategies. | ||
|
||
- **Town 6**: A less populated town with unique junctions, testing navigation | ||
in multiple lanes and the use of slip roads. | ||
|
||
- **Town 7**: A rural community with no marked roads, which tests navigation | ||
and parking in residential areas. | ||
|
||
- **Town 8 & Town 9**: Hidden maps used for the Leaderboard challenge. | ||
|
||
- **Town 10**: An inner-city area with various junctions and pedestrian | ||
activity, testing skills in complex traffic situations. | ||
|
||
- **Town 11**: A basic map for testing navigation in open areas with fewer | ||
visual guides. | ||
|
||
- **Town 12**: A large map based on Amarillo, Texas, featuring urban, | ||
residential, and rural areas to test navigation and visual skills across | ||
diverse environments. | ||
|
||
### Rural and Highway Scenarios | ||
|
||
Maps like **Town 7** and **Town 12** focus on rural and highway driving, | ||
simulating open and high-speed areas. They test long-distance driving, | ||
speed management, and safe overtaking, requiring drivers to adapt to | ||
unmarked roads and agricultural settings. | ||
|
||
## Road Network Creation with ASAM OpenDRIVE® | ||
|
||
Road networks in CARLA are built using **ASAM OpenDRIVE®**, which standardizes | ||
road descriptions: | ||
|
||
- **Hierarchical Structure**: Roads are organized into nodes for better | ||
integration. | ||
|
||
- **Reference Line**: Each road has a reference line that defines its shape. | ||
|
||
- **Interconnectivity**: Roads can connect to each other for realistic | ||
traffic flow. | ||
|
||
## Units of Measurement | ||
|
||
To keep tests consistent, CARLA uses standardized units: | ||
|
||
- **Speed**: Measured in meters per second (m/s). | ||
|
||
- **Distance**: Measured in meters. | ||
|
||
Comment on lines
+160
to
+167
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance units section with regional conversions. Expand this section to include:
|
||
## References | ||
|
||
- CARLA Documentation: [CARLA](https://carla.readthedocs.io/en/latest/) | ||
- Traffic Manager Behavior Considerations: [CARLA TM Documentation](https://carla.readthedocs.io/en/latest/adv_traffic_manager/#vehicle-behavior-considerations) | ||
- ASAM OpenDRIVE® Standard: [ASAM OpenDRIVE](https://www.asam.net/standards/detail/opendrive/) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Enhance introduction with regional standards information.
The introduction should clarify: