This project focuses on enhancing the behavior of an autonomous driving agent within the CARLA simulation environment. The initial agent provided, known as BehaviorAgent, served as a baseline featuring essential navigation capabilities, including route-following and basic adherence to traffic rules, along with preliminary responses to pedestrians and traffic lights.
To precisely identify the agent's shortcomings, comprehensive testing was conducted on two predefined urban routes designed to simulate a variety of realistic and complex driving scenarios. The results highlighted significant limitations, especially in managing dynamic interactions and atypical driving conditions safely and effectively.
The primary objective of this project was to systematically address these identified weaknesses by implementing targeted improvements, particularly focusing on critical decision-making scenarios. The effectiveness of these enhancements was subsequently assessed through rigorous comparisons against the baseline agent.
For methodology, results, and discussions, see Avd_report_group04.pdf
├── 📁 userCode/
│ ├── 📁 carla_behavior_agent/
│ │ ├── basic_agent.py
│ │ ├── basic_autonomous_agent.py
│ │ ├── behavior_agent.py
│ │ ├── behavior_types.py
│ │ ├── config_agent_basic.json
│ │ ├── controller.py
│ │ ├── global_route_planner.py
│ │ ├── junction_manager.py
│ │ ├── local_planner.py
│ │ ├── misc.py
| │ └── utils.py
│ ├── route_1_avddiem.xml
│ ├── route_4_avddiem.xml
│ ├── run_sim.sh
| └── speed.txt
├── Avd_report_group04.pdf
├── docker_run_client.sh
├── docker_run_server.sh
├── Dockerfile
└── README.md
Overtaking behaviors were implemented, addressing situations with blocked lanes:
- Corrected path generation to avoid reverse or erroneous maneuvers.
- Introduced detection methods for oncoming traffic to ensure overtaking safety.
- Provided fallback logic for overtaking scenarios to avoid indefinite standstills.
Enhanced static obstacle detection and response strategies:
- Implemented proactive gradual deceleration and emergency braking based on proximity thresholds.
- Integrated obstacle detection seamlessly with overtaking behaviors.
Refined pedestrian detection and interaction:
- Enhanced braking logic to stop reliably before reaching pedestrians.
- Implemented a fallback mechanism to resolve standstill interactions when pedestrians do not proceed.
Significantly improved vehicle detection and following logic:
- Refined detection mechanisms for cyclists and slow-moving vehicles.
- Differentiated adaptive braking strategies based on vehicle types and speeds.
- Integrated overtaking logic for prolonged slow-speed scenarios, particularly involving bicycles.
Developed sophisticated logic to detect and respond to lane invasions:
- Dynamically checked adjacent lanes for invading vehicles or objects.
- Implemented lateral shifts and overtaking logic based on the severity and context of lane invasions.
Introduced stability improvements specifically for navigating curves:
- Implemented safe speed control measures to avoid overshooting or drifting.
- Maintained steering input during braking to prevent trajectory loss.
- Improved traction control for wet road conditions by gradual acceleration before entering curves.
Enhanced intersection navigation and safety:
- Improved junction decision-making logic, particularly for complex traffic scenarios.
- Integrated robust stop-sign recognition and reaction behaviors.
Developed explicit stop sign handling behaviors:
- Introduced controlled deceleration logic to reliably halt at stop signs.
- Included compliance with stop-sign duration requirements.
To correctly run this project and replicate the development environment, the following system and software requirements must be met:
-
CARLA Simulator
- Minimum version: 0.9.13
- Download CARLA
-
Docker
- Recommended version: 20.10+
- Install Docker
-
Python
- Recommended version: Python 3.8 or higher
- Install Python
The following Python packages are required for the autonomous agent to run properly:
numpy
matplotlib
shapely
carla# Clone the repository
git clone https://github.com/Crostino14/Autonomous-Vehicle-Driving-Project.git
cd Autonomous-Vehicle-Driving-Project
# Start CARLA server using Docker
./docker_run_server.sh
# In another terminal, start CARLA client using Docker
./docker_run_client.sh
# Connect to the client container
# Navigate to the team_code directory
cd team_code/
# Launch the autonomous driving agent
./run_sim.sh
- CARLA Simulator: https://carla.org
- CARLA GitHub Repository: https://github.com/carla-simulator/carla
- CARLA Traffic Manager Documentation: https://carla.readthedocs.io/en/latest/adv_traffic_manager
- CARLA Waypoint API: https://carla.readthedocs.io/en/latest/core_map/#waypoints
- CARLA Stop Sign and Traffic Light Handling: https://carla.readthedocs.io/en/latest/tuto_M_custom_add_tl/
- ASAM OpenDRIVE Standard (for road and lane specifications): https://publications.pages.asam.net/standards/ASAM_OpenDRIVE
- CARLA Vehicle and Pedestrian Control API: https://carla.readthedocs.io/en/latest/python_api/#carla.VehicleControl
- Shapely Geometry Library (for polygon-based collision checking): https://shapely.readthedocs.io/en/stable/manual.html
- Agostino Cardamone — a.cardamone7@studenti.unisa.it
- Chiara Ferraioli — c.ferraioli30@studenti.unisa.it
- Asja Antonucci — a.antonucci5@studenti.unisa.it