# Social-bot Test Bags

This directory holds rosbag2 recordings used for replaying mock sensor data in CI.

## Bag contents

Each test bag records the following topics for **30 seconds** at real-time rate:

| Topic | Type | Rate | Notes |
|---|---|---|---|
| `/camera/color/image_raw` | `sensor_msgs/Image` | 15 Hz | 640×480 RGB8 |
| `/uwb/target` | `geometry_msgs/PoseStamped` | 10 Hz | simulated UWB |
| `/social/faces/detections` | `FaceDetectionArray` | 15 Hz | may be empty |
| `/social/tracking/fused_target` | `FusedTarget` | 10 Hz | single person |
| `/social/persons` | `PersonStateArray` | 5 Hz | one engaged person |
| `/social/orchestrator/state` | `std_msgs/String` | 2 Hz | JSON state |
| `/odom` | `nav_msgs/Odometry` | 20 Hz | zero motion |
| `/tf`, `/tf_static` | `TF2` | varies | camera → base_link |

## Recording a new bag

On hardware with the full social-bot stack running:

```bash
# Record 30s of live sensor data
./bags/record_social_test.sh --duration 30

# Record from mock sensor pub only (no hardware)
MOCK_ONLY=1 ./bags/record_social_test.sh --duration 15 --name social_test_mock
```

## Replaying a bag in CI

The Docker CI entrypoint uses live mock publishers (not rosbag replay) for the
default CI tests. To use a recorded bag instead:

```bash
# In a sourced ROS2 shell:
ros2 bag play bags/social_test_YYYYMMDD_HHMMSS/ --loop --rate 1.0
```

Then run the test suite against the replayed data:

```bash
export SOCIAL_STACK_RUNNING=1
pytest test/ -v -m "not full_stack"
```

## Bag naming convention

`social_test_YYYYMMDD_HHMMSS` — date/time of recording.

Bags committed to this directory should be small (< 50 MB) — use a 5-second
clip or compress images to avoid bloating the repository.  Large reference bags
(> 100 MB) should be stored on the NVMe and referenced by path.
