Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 8 commits into
base: v1.0.0
Choose a base branch
from

Conversation

hzheng40
Copy link
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