Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,39 @@ jobs:
- name: Unit tests
run: python -m pytest -v tests/unit_tests

c-drive-tests:
name: C Drive Tests
runs-on: ubuntu-latest
env:
PUFFER_CPU: 1
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo apt-get clean
sudo rm -rf ~/.cache/pip /tmp/* /var/tmp/*

- name: Install pufferlib
env:
TMPDIR: ${{ runner.temp }}/build
PIP_NO_CACHE_DIR: 1
run: |
sudo apt-get update && sudo apt-get install -y build-essential cmake xvfb libgl1-mesa-dev libegl1-mesa-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxxf86vm-dev
python -m pip install -U pip
pip install -e . --no-cache-dir
python setup.py build_ext --inplace --force

- name: C drive unit and render tests
run: make -C tests/drive test render

notebook-tests:
name: Notebook Execution
runs-on: ubuntu-latest
Expand Down Expand Up @@ -147,11 +180,11 @@ jobs:
TMPDIR: ${{ runner.temp }}/build
PIP_NO_CACHE_DIR: 1
run: |
sudo apt-get update && sudo apt-get install -y build-essential cmake
sudo apt-get update && sudo apt-get install -y build-essential cmake libgl1-mesa-dev libegl1-mesa-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxxf86vm-dev
python -m pip install -U pip
pip install -e . --no-cache-dir
python setup.py build_ext --inplace --force

- name: Test simulator performance
run: python tests/smoke_tests/test_simulator_perf.py
run: make -C tests/drive perf
timeout-minutes: 20
35 changes: 20 additions & 15 deletions pufferlib/ocean/drive/datatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,21 +181,26 @@ struct Agent {
float *log_height;
int *log_valid;

// Simulation state (always center-based, even when trajectory control uses the rear axle)
float sim_x; // Vehicle center x-coordinate
float sim_y; // Vehicle center y-coordinate
float sim_z;
float sim_heading;
float cos_heading; // Cached cosf(sim_heading) - updated in move_dynamics
float sin_heading; // Cached sinf(sim_heading) - updated in move_dynamics
float sim_vx; // Vehicle center velocity x-component
float sim_vy; // Vehicle center velocity y-component
float yaw_rate; // Angular velocity used to derive rear-axle velocity
float sim_speed;
float sim_speed_signed;
float sim_length;
float sim_width;
float sim_height;
// Simulation state
float sim_x; // Bounding box center x
float sim_y; // Bounding box center y
float sim_z; // Bounding box center z
float sim_heading; // Bounding box heading
float cos_heading;
float sin_heading;
float sim_vx; // Bounding box velocity x
float sim_vy; // Bounding box velocity y
float yaw_rate; // Angular velocity used to convert between rear and center velocity
float sim_speed; // Bounding box center speed magnitude
float sim_speed_signed; // Bounding box center signed longitudinal speed
float sim_length; // Bounding box length
float sim_width; // Bounding box width
float sim_height; // Bounding box height
float radius; // 0.5 * sqrt(L^2 + W^2); refreshed when L/W change
float prev_x;
float prev_y;
float prev_cos_heading;
float prev_sin_heading;
int sim_valid;

// Route information
Expand Down
Loading
Loading