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

#376 Road Rules definitions in Carla #414

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
121 changes: 121 additions & 0 deletions carla_traffic_rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Traffic Rules and Principles in CARLA

## Table of Contents

- [Introduction](#introduction)
- [Key Traffic Principles and Complex Interactions](#key-traffic-principles-and-complex-interactions)
- [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)
- [Custom Maps with ASAM OpenDRIVE®](#custom-maps-with-asam-opendrive)
- [Units of Measurement](#units-of-measurement)
- [References](#references)

## Introduction

CARLA (Car Learning to Act) is an open-source simulator for testing self-driving systems. It includes traffic rules, allowing flexible testing of driving behaviors without strict adherence to specific laws of any country.

## 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.

- **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.

## 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.

## References

- CARLA Documentation: [CARLA](https://carla.readthedocs.io/en/latest/)

- ASAM OpenDRIVE® Standard: [ASAM OpenDRIVE](https://www.asam.net/standards/detail/opendrive/)
124 changes: 124 additions & 0 deletions doc/research/paf24/general/carla_traffic_rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# Traffic Rules and Principles in CARLA

## Table of Contents

- [Introduction](#introduction)
- [Key Traffic Principles and Complex Interactions](#key-traffic-principles-and-complex-interactions)
- [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)
- [Custom Maps with ASAM OpenDRIVE®](#custom-maps-with-asam-opendrive)
- [Units of Measurement](#units-of-measurement)
- [References](#references)

Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add regional traffic standards section to Table of Contents.

To fully address issue #376, consider adding a new section for regional traffic standards that covers:

  • Country-specific regulations
  • Traffic sign variations and positioning
  • Speed measurement units (km/h vs. mph)
  • Road marking differences
🧰 Tools
🪛 LanguageTool

[uncategorized] ~6-~6: Possible missing preposition found.
Context: ...

  • Introduction
  • [Key Traffic Principles and Complex Interact...

(AI_HYDRA_LEO_MISSING_TO)

## 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.

Comment on lines +15 to +18
Copy link
Contributor

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:

  1. Which country's traffic rules serve as the baseline
  2. How CARLA handles different regional traffic standards
  3. How users can customize rules for their specific region

## 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.

- **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.

Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Expand traffic principles with regional variations.

Each principle should address common regional differences. For example:

  • Traffic Signals: Different signal patterns/colors by region
  • Speed Limits: Unit variations (km/h vs. mph)
  • Lane Management: Left vs. right-hand driving
  • Stop Signs: Design variations across regions
🧰 Tools
🪛 Markdownlint

22-22: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


27-27: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


30-30: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


33-33: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


34-34: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


37-37: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


38-38: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


41-41: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


44-44: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


47-47: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)

## 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 +114 to +121
Copy link
Contributor

Choose a reason for hiding this comment

The 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:

  1. How CARLA handles unit conversions internally
  2. Converting between m/s and regional units (km/h, mph)
  3. Configuring preferred units for simulation

## References

- CARLA Documentation: [CARLA](https://carla.readthedocs.io/en/latest/)

- ASAM OpenDRIVE® Standard: [ASAM OpenDRIVE](https://www.asam.net/standards/detail/opendrive/)
Loading