Skip to content
googlePublic

About

Ultra-Wideband (UWB) and FiRa UCI spatial simulator in Rust

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

57 stars

Watchers

3 watching

Forks

Crate Build workflow License

Pica logo

Pica

Pica is a virtual Ultra-Wideband (UWB) subsystem and spatial simulator implementing the FiRa UCI 2.0 specification.

With it, you can scale testing of UWB software without physical devices. While Pica aims to reproduce chip behavior faithfully, it does not simulate the radio itself.

Why Pica?

  • Uses the same protocol (UCI) that UWB chips do
  • Supports a user-defined distance and angle model
  • Deterministic, repeatable simulation (no internal randomness)
  • Powers UWB in the Android Emulator

How It Works

Here is how Pica is embedded in the Android Emulator through Netsim:

flowchart LR
    subgraph netsim [Netsim]
        pica[Pica] <-->|distance and angle| model[Device position/pose]
    end
    emu1[Android Emulator 1] <-->|UCI| pica
    emu2[Android Emulator 2] <-->|UCI| pica
Loading

Feature Roadmap

Something missing? Contribute!

✅ Supported · ⏳ Planned · ➖ Not planned · ❌ Out of scope

FiRa

Feature Release Status
Two-Way Ranging (TWR) 1.x ✅
Angle of Arrival (AoA) 1.x ✅
Device Test Mode 1.x ❌
Downlink TDoA (DL-TDoA) 2.0 ✅
Data Transfer 2.0 ✅
One-Way AoA (OWR AoA) 2.0 ⏳
Contention-based ranging (ESS-TWR, ADS-TWR) 2.0 ➖
Uplink TDoA (UL-TDoA) 2.0 ➖
Hybrid UWB Scheduling (HUS) 3.0 ➖
Dedicated data transfer 3.0 ⏳
Logical Link data exchange 3.0 ⏳
Downlink TDoA v2 4.0 ⏳

Industry Profiles

Profile Version Status
CCC Digital Key 3.0 ✅
Aliro 1.0 ✅

Language Support

  • Rust: Use the pica crate.
  • C/C++: Build pica with the ffi feature.
  • Python: The pica package in py/pica sends and reads UCI over TCP, so you can script tests against the playground.

Playground and Tests

Run the web playground, then open http://127.0.0.1:3000. UWB software connects on TCP port 7000. To save packet captures, add -- --pcapng-dir <DIR>.

git clone https://github.com/google/pica.git && cd pica
cargo run --bin pica-http

Pica empty scene

Run the tests:

cargo build
cargo test --features ffi
python3 -m venv venv
source venv/bin/activate
pip install ./py/pica/ 'pytest==7.4.4' 'pytest-asyncio==0.23.3'
pytest -v

About

Ultra-Wideband (UWB) and FiRa UCI spatial simulator in Rust

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

57 stars

Watchers

3 watching

Forks

Releases

Used by

Contributors

Languages