# saltybot_curiosity

Autonomous curiosity behavior for SaltyBot — frontier exploration when idle.

## Features

- **Idle Detection**: Activates after >60s without people
- **Frontier Exploration**: Random walk toward unexplored areas
- **Sound Localization**: Turns toward detected sounds
- **Object Interest**: Approaches colorful/moving objects
- **Self-Narration**: TTS commentary during exploration
- **Safety**: Respects geofence, avoids obstacles
- **Auto-Timeout**: Returns home after 10 minutes
- **Curiosity Level**: Configurable 0-1.0 activation probability

## Launch

```bash
ros2 launch saltybot_curiosity curiosity.launch.py
```

## Parameters

- `curiosity_level`: 0.0-1.0 probability of exploring when idle (default: 0.7)
- `idle_threshold_sec`: seconds of idle before activation (default: 60)
- `exploration_max_duration_sec`: max exploration time in seconds (default: 600)
- `exploration_radius_m`: search radius in meters (default: 5.0)
- `pan_tilt_step_deg`: pan-tilt sweep step (default: 15)
- `min_sound_activity`: sound detection threshold (default: 0.1)

## Topics

### Publishes

- `/saltybot/curiosity_state` (String): State updates
- `/saltybot/tts_request` (String): Self-narration text
- `/saltybot/pan_tilt_cmd` (String): Pan-tilt commands
- `/cmd_vel` (Twist): Velocity commands (if direct movement)

### Subscribes

- `/saltybot/audio_direction` (Float32): Sound bearing (degrees)
- `/saltybot/audio_activity` (Bool): Sound detected
- `/saltybot/person_detections` (Detection2DArray): People nearby
- `/saltybot/object_detections` (Detection2DArray): Interesting objects
- `/saltybot/battery_percent` (Float32): Battery level
- `/saltybot/geofence_status` (String): Geofence boundary info

## State Machine

```
IDLE → (is_idle && should_explore) → EXPLORING
EXPLORING → (timeout || person detected) → RETURNING
RETURNING → IDLE
```

## Issue #470
Implements autonomous curiosity exploration as specified in Issue #470.
