Add camera streaming guide with all access methods
Comprehensive documentation for accessing the DWARF camera streams:
- RTSP URLs and channels (ch0=tele, ch1=wide)
- The critical prerequisite: camera must be opened via WebSocket first
- ffmpeg commands for frame capture, timelapse, and video recording
- mpv and VLC usage with TCP transport
- Python/OpenCV integration example
- Troubleshooting common issues (black image, connection refused, VLC delay)
- Comparison of RTSP vs MJPEG modes across device models
💘 Generated with Crush
Assisted-by: Crush:glm-5.2
This commit is contained in:
@ -71,6 +71,11 @@ dwarfctl power off
|
||||
|
||||
# Monitor notifications (live status events)
|
||||
dwarfctl monitor
|
||||
|
||||
# Visual odometry — image-based orientation (no star/plate solving)
|
||||
dwarfctl orient compare before.jpg after.jpg # measure rotation between 2 frames
|
||||
dwarfctl orient live --cam wide # live pointing tracker from RTSP
|
||||
dwarfctl orient live --fov-h 42 --fov-v 24 # override FoV with measured values
|
||||
```
|
||||
|
||||
## Architecture
|
||||
@ -81,9 +86,13 @@ dwarfctl/
|
||||
├── proto/dwarf.pb.go # generated Go bindings (24948 lines)
|
||||
├── internal/
|
||||
│ ├── transport/client.go # WebSocket client + WsPacket envelope
|
||||
│ └── api/
|
||||
│ ├── commands.go # 323 command IDs + module routing
|
||||
│ └── client.go # typed Telescope API (camera/motor/astro/...)
|
||||
│ ├── api/
|
||||
│ │ ├── commands.go # 323 command IDs + module routing
|
||||
│ │ └── client.go # typed Telescope API (camera/motor/astro/...)
|
||||
│ └── odometry/ # FFT phase-correlation visual odometry
|
||||
│ ├── fft.go # radix-2 Cooley-Tukey FFT (1D + 2D)
|
||||
│ ├── odometry.go # Estimate() — shift between 2 frames → degrees
|
||||
│ └── tracker.go # Tracker — cumulative orientation integrator
|
||||
└── cmd/dwarfctl/main.go # cobra CLI
|
||||
```
|
||||
|
||||
@ -114,9 +123,47 @@ protoc --go_out=. --go_opt=paths=source_relative dwarf.proto
|
||||
|
||||
## Roadmap
|
||||
|
||||
- [x] **Visual odometry** — image-based orientation via FFT phase correlation (`orient`)
|
||||
- [ ] BLE discovery + handshake (DwarfPing/DwarfEcho)
|
||||
- [ ] RTSP preview viewer
|
||||
- [ ] Interactive REPL mode
|
||||
- [ ] Schedule plan management
|
||||
- [ ] OTA firmware update
|
||||
- [ ] Full Notify event parsing (typed)
|
||||
- [ ] Closed-loop tracking: feed `orient` output into motor corrections
|
||||
|
||||
## Visual odometry (`orient`)
|
||||
|
||||
The `orient` command estimates the telescope's pointing rotation by comparing
|
||||
wide-angle frames using **FFT phase correlation**. It does NOT use star
|
||||
identification or plate solving — it works on any textured scene (sky, horizon,
|
||||
clouds, daytime landscape), making it suitable for:
|
||||
|
||||
- **Daytime airplane tracking** — the wide cam sees sky/horizon texture
|
||||
- **Nighttime satellite tracking** — the wide cam sees star fields as texture
|
||||
|
||||
### How it works
|
||||
|
||||
1. Grab two wide-angle frames (via RTSP `ffmpeg` grab, same as `preview grab`)
|
||||
2. Downscale both to a square grid (default 256×256, power of two)
|
||||
3. Compute the 2-D FFT of each, then the normalized cross-power spectrum
|
||||
4. The inverse FFT gives a correlation surface; its peak = image-plane shift
|
||||
5. Sub-pixel refinement via parabolic interpolation
|
||||
6. Convert pixel shift → degrees using the camera field of view
|
||||
|
||||
For a static alt-az mount, the accumulated shifts give the cumulative pointing
|
||||
orientation relative to the starting frame — no absolute encoders or polar
|
||||
alignment needed.
|
||||
|
||||
### Field of view calibration
|
||||
|
||||
The default FoV (8.0°×6.5°) comes from the DWARF Mini's display values in
|
||||
`DEVICE_MODELS.md`, but the firmware-reported live FoV can differ. To calibrate:
|
||||
slew the motors by a known angle and compare with the measured rotation. Override
|
||||
with `--fov-h` / `--fov-v` once you have measured values.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- **ffmpeg** must be installed (for RTSP frame capture)
|
||||
- The wide camera must be opened first (`camera open --cam wide`) — `orient live`
|
||||
does this automatically.
|
||||
|
||||
Reference in New Issue
Block a user