Skip to content

“Autonomous Vehicle Driving Project”: Intelligent driving agent in CARLA. Lane changes, obstacle avoidance, pedestrian handling & overtaking for realistic urban navigation.

License

Notifications You must be signed in to change notification settings

Crostino14/Autonomous-Vehicle-Driving-Project

Repository files navigation

🚗 Autonomous Vehicle Driving Project

📚 Project Overview

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


📁 Project Structure

├── 📁 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

🚀 Improvements Introduced

🔀 Lane Change and Overtaking Logic

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.

🚧 Obstacle Detection and Avoidance

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.

🚶 Pedestrian Management

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.

🚗 Vehicle Ahead Management

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.

↔️ Lane Invasion Management

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.

🛣️ Curve Handling and Stability Control

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.

🚦 Intersection Handling

Enhanced intersection navigation and safety:

  • Improved junction decision-making logic, particularly for complex traffic scenarios.
  • Integrated robust stop-sign recognition and reaction behaviors.

⛔ Stop Sign Recognition and Reaction

Developed explicit stop sign handling behaviors:

  • Introduced controlled deceleration logic to reliably halt at stop signs.
  • Included compliance with stop-sign duration requirements.

🛠️ Prerequisites

To correctly run this project and replicate the development environment, the following system and software requirements must be met:

📌 Required Software

📌 Required Python Packages

The following Python packages are required for the autonomous agent to run properly:

numpy
matplotlib
shapely
carla

🏃 How to Run

# 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

📚 References


👨‍💻 Authors

About

“Autonomous Vehicle Driving Project”: Intelligent driving agent in CARLA. Lane changes, obstacle avoidance, pedestrian handling & overtaking for realistic urban navigation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published