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.
- 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
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
Something missing? Contribute!
✅ Supported · ⏳ Planned · ➖ Not planned · ❌ Out of scope
| 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 | ⏳ |
| Profile | Version | Status |
|---|---|---|
| CCC Digital Key | 3.0 | ✅ |
| Aliro | 1.0 | ✅ |
- Rust: Use the
picacrate. - C/C++: Build
picawith theffifeature. - Python: The
picapackage inpy/picasends and reads UCI over TCP, so you can script tests against the playground.
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-httpRun 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