Skip to content

Separate scan and pose update, non-scan dependent collision checking#105

Draft
hzheng40 wants to merge 8 commits intov1.0.0from
dev_scan_update
Draft

Separate scan and pose update, non-scan dependent collision checking#105
hzheng40 wants to merge 8 commits intov1.0.0from
dev_scan_update

Conversation

@hzheng40
Copy link
Copy Markdown
Member

@hzheng40 hzheng40 commented Jan 1, 2024

Separated scan and pose updates.

Map collision check via rasterizing car rectangles, and checking whether the enclosed pixels are occupied in the map.
Vectorization doesn't work with numba since some functions not available.
Tried filtering out occupied points based on proximity to the vehicles being checked, jit requires constant shape so hard to implement without significant slow down.

Currently, when number of vehicles is small, using the scan is still faster than not using. Not using scan is faster after ~4 vehicles.

Also, the fastest implementation introduces dependency on JAX (CPU only now). Not sure if this is the right PR to do it.

Implemented 3 different collision checking methods:

  1. jax jit with loops
  2. jax jit vectorized
  3. numba jit with loops

Benchmarking with 5 seconds sim time:

  • 1 vehicle:
    • jax jit loops: ~0.25s
    • jax jit vectorized: ~0.25s
    • numba jit loops: ~0.34s
    • with scan: ~0.23s
  • 5 vehicles:
    • jax jit loops: ~0.78s
    • jax jit vectorized: ~0.65s
    • numba jit loops: ~1.55s
    • with scan: ~1.68s
  • 30 vehicles:
    • jax jit loops: ~4.15s
    • jax jit vectorized: ~3.45s
    • numba jit loops: ~8.99s
    • with scan: ~30.8s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant