/Ene-AD

Primary LanguagePythonApache License 2.0Apache-2.0

Energy-Efficient Autonomous Driving with Adaptive Perception and Robust Decision

This repo is the implementation of the following paper:

Energy-Efficient Autonomous Driving with Adaptive Perception and Robust Decision

main code files

  • algs

    • pdqn.py
      Implementaion for our reinforcement learning algorithm,
    • replay_buffer.py
      relay buffer of our reinforcement learning, which is used to store experiences and sample experiences.
  • gym_carla
    Gym-like carla environment for vehicle agent controlled by reinforcement learning.

    • carla_env.py
      Main module for Gym-like Carla environment, which shares the same APIs as classical Gym. Function "reset" is an initialization at the beginning of an episode and Function "step" includes state generation and reward calculation. It includes all the processes of the autonomous vehicle interacting with the environment, including how to use cameras and lidar to obtain environmental data, how to process data, and how to perform actions. In addition, for feature extraction algorithms, i.e., sparseBev, sparsefusion, bevfusion and prediction algorithm multipath++, we use their open source code and run them in another process. For simplicity and environmental adaptation issues, they transmit data through files.
    • agent/global_planner.py. This module provides a high level route plan, which set a global map route for each vehicle. In addition, BasicAgent implements an algorithm that navigates the scene and contains PID controllers to perform lateral and longitudinal control
    • util. The file bridge_functions.py includes transfer functions for onboard sensors. The file sensor.yaml includes the location and rotation of all sensors, including camera, lidar, imu, and gnss. The classification.py includes the model of our quality classification model
  • main. The pdqn_multi_lane_sumo.py is the training file of our framework on the Carla simulation. The process.py file has Two functions that are used to start a process or kill a process about simulations.

  • Sumo. The bridge_helper.py introduces how to connect the carla simulator and the sumo simulator. In the experiment, carla is responsible for rendering, and sumo is responsible for recording vehicle information and power consumption, etc.

Getting started

  1. Install and setup the CARLA simulator, set the executable CARLA_PATH in gym_carla/setting.py. Then install the SUMO simulator and put its path to the environment path: SUMO_HOME

  2. Setup conda environment

$ conda create -n env_name python=3.8
$ conda activate env_name
  1. Clone the repo and Install the dependent package
$ git clone https://github.com/xiayuyang/Ene-AD.git
$ pip install -r requirements.txt
  1. Train the RL agent in the multi-lane scenario
$ python ./main/trainer/pdqn_multi_lane_sumo.py

License

All code within this repository is under Apache License 2.0.

Acknowledgements

Our code is based on several repositories: