# RF Mapping

Work in progress.

### Finding Sensors

Determine the serial port for the sensor(s):

```bash
ls /dev/tty.*
ls /dev/cu.*
```

### Testing the Low Level Mac BLE scan

In `system_hw_test`:

```bash
uv run ble.py
```

### Testing the BLE Scan

Test host computer BLE scan and data storage to local file:

```bash
uv run src/run.py test_ble
```

### Testing the BLE scan plus Arduino BLE/GPS

Host computer BLE scan plus Arduino based GPS and BLE:

```bash
uv run src/run.py test_ble_gps
```

### Testing the Entire Solution

Combines autonomy, VILA, two BLE sources, GPS, odometry, and enhanced GPS:

```bash
uv run src/run.py unitree_go2_mapper
```

You should see a list of nearby BLE sources, such as BLE Beacons. The system will write location and RF data to file, and, if possible, to a cloud endpoint.

### Example Data

This is a draft format and will change frequently.

```bash
{"machine_id": "Go2LA", "gps_time_utc": "16:49:17:0", "gps_lat": "48.40016937N", "gps_lon": "2.11868286E", "gps_alt": 24.2, "update_time_local": 1748450961.5663621, "odom_x": 0.0, "odom_y": 0.0, "odom_yaw": 0.0, "rf_data": [{"timestamp": 1748450960.705354, "address": "B79E3B51-4AA7-26BE-8B9A-7FC3E4EA44D9", "name": "PHANTOM", "rssi": -54}, {"timestamp": 1748450960.683191, "address": "D881E444-0FA1-A248-89ED-9600216C4813", "name": "ET-2850 Series", "rssi": -55}, {"timestamp": 1748450960.392791, "address": "48E778A7-0281-6784-3CD2-3517CE1E61F4", "name": "Bose Flex 2 SoundLink", "rssi": -68}]}
```

### Local YOLO

In `system_hw_test`:

```bash
uv run yolo.py
```

At the top level, run:

```bash
uv run src/run.py yolo
```
