The g-g diagram visualizes the maximum longitudinal and lateral accelerations that a vehicle can achieve. To address non-planar road geometries, this concept can be extended to incorporate g-g constraints as a function of vehicle speed and vertical acceleration, commonly referred to as g-g-g-v diagrams. This repository provides a parallelized black box simulation toolchain to generate QSS g-g-g-v diagram. Our approach enables the use of existing high-fidelity vehicle models without the need for differentiability, avoiding model mismatch problems.
The core functionality involves a fully factorial batch execution of steering ramp maneuvers across specified ranges of velocity (v
), longitudinal acceleration (ax
), and vertical acceleration (gt
).
In the simulation, the vehicle maintains a quasi-steady-state at the target speed through external forces applied to its center of gravity, emulating inertial forces via the targeted longitudinal acceleration. A drive torque controller compensates for resistance forces to sustain the target speed.
Each simulation starts with a small steering step. The resulting lateral acceleration jump calculates an appropriate steering ramp speed, achieving a controlled lateral acceleration rise rate essential for quasi-static driving conditions. The maximum lateral acceleration recorded in each simulation becomes the result.
- Stable Runs: The maximum recorded lateral acceleration is used as the result.
- Unstable Runs: If instability is detected, the last known stable lateral acceleration is taken as the result.
Follow these steps to create a virtual environment, install dependencies, and build the project using Colcon on Ubuntu.
Run the following command to create a virtual environment named venv:
python3 -m venv venv
Activate the virtual environment with:
source venv/bin/activate
Once the virtual environment is activated, install the required packages:
pip install -r requirements.txt
To prevent Colcon from processing the virtual environment, create an empty COLCON_IGNORE file inside the venv/ folder:
touch venv/COLCON_IGNORE
Run Colcon to build the workspace:
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
source install/setup.bash
Alternatively, add the following line to your .bashrc file to source it automatically on every terminal start
echo "source $(pwd)/install/setup.bash" >> ~/.bashrc
- Check/Modify the parameter files located in the
./params
folder. - Run
main_gggv_generation.py
. Output files are created in theoutput
folder (folder is created if it does not exist).
The script plot_comparion.py
can be used to compare one or multiple simulation runs with each other. Simply run the script and follow the instuctions. The comparisons are based on the diamond shape of the limitations.
To look into a single simulation run you can switch the program from batch execution to simulate a single steering ramp. Follow these instructions:
- Switch the
singlerun
parameter in the header ofmain_gggv_generation.py
fromFalse
toTrue
- Specify the velocity
v
, longitudinal accelerationax
, and the vertical accelerationgt
The vehicle dynamics model included in this repository is a simple validation vehicle model, which can be solved analytically. The model is depicted in the figure below.
The validation vehicle model point mass model with a kinemtaic steering relation. It is force saturated to form a circle, which is moved downwards by 2 mps2 to simulate drag forces.
To use your own vehicle model with this toolchain, you need to provide a model that can be actuated by wheel torques and a steering angle. Furthermore, your model needs to allow external forces to be superimposed onto the center of gravity. The overall simulation process is depicted in the figure below.
- In the
sim_handler
class in the file 'src/sim_handlin.py' class, you will need to instantiacte your vehicle model in the init function of the sim_handler class - Update the following member function of the sim_handler class to your naming conventions:
- get_veh_params()
- set_parameter()
- set_driver_input()
- get_simstate()
- In
main_gggv_generation.py
replace the vehicle step function call