Skip to content

AIR-DISCOVER/Multi-alignment-Driving-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Multi-alignment-Driving-Agent

This repository contains the multi-alignment framework code for paper Driving Style Alignment for LLM-powered Driver Agent.

Installation and Configuration Guide

Before running our code, the installation and configuration of CARLA is required, for which we recommend version 0.9.14, the same as used in the paper. We also recommend using Python 3.7 and Unreal Engine 4.

The detailed build guide can be referred to in CARLA Simulator. In the bottom right corner, select the corresponding CARLA version.

After successfully running CARLA, follow these steps to intergrate our code:

  1. Replace the automatic_control.py in the CARLA source code at carla/PythonAPI/examples/automatic_control.py with Multi-alignment-Driving-Agent/src/automatic_control.py

  2. Replace the navigation folder in the CARLA source code at /carla/PythonAPI/carla/agents/navigation with Multi-alignment-Driving-Agent/src/navigation

  3. In navigation/behavior_agent.py, configure your API keys and organization of OpenAI in line 92 and line 93.

  4. Configure the path for prompts of the driver and coach agent, and the path for guidelines generated by the coach agent.

    1. In navigation/behavior_agent.py, configure the driver prompt path in line 96. The path should be the location where you store the prompt folder, and choose the corresponding driving style prompt according to your need (prompt/demonstration_cautious.txt, prompt/demonstration_risky.txt, or prompt/demonstration_not-aligned.txt).
    2. In navigation/behavior_agent.py, configure the coach prompt path in line 101. The path should be the location where you store the prompt folder, and choose the corresponding driving style prompt according to your need (prompt/feedback_cautious.txt, prompt/feedback_risky.txt, or prompt/feedback_not-aligned.txt).
    3. In navigation/behavior_agent.py, configure the guideline path in line 102. This file will store all the guidelines generated by the coach agent.
  5. Configure the path for all the logs generated while running.

    1. In automatic_control.py, configure the GPT log and CAN-Bus log path in line 107 and line 108. We recommend that you create two dedicated folders to store them separately. The log of each run will be stored with the current time as the default filename (of course, you can rename it according to your needs).
    2. In automatic_control.py, configure the collision log and time log path in line 82 and line 83. We recommend that you create two dedicated folders to store them separately. The log of each run will be stored with the current time as the default filename (of course, you can rename it according to your needs).

Running

Run the following command in the carla/PythonAPI/examples/ directory:

conda activate carla
python automatic_control.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages