How hkim807/p4p works
Navel collects robot perception and locomotion into raw observation frames, sends them to a receiver, and can derive tracked people, temporal social cues, policy proposals, target locks, and correlated commands. Offline replay supports inspecting recordings and derived state; optional model inference and physical actions extend the flow but are not required by the default collector. The README documents the principal stages; some implementation links below rely on its statements and the SOURCE INDEX rather than complete excerpts.
Main entry points: social_pipeline.py Social pipeline · main.py Sensor collector · server.py HTTP receiver · pipeline.py Tracking pipeline
Components 21
Robot collection
- Sensor collector
robot/navel_client/main.py - SDK adapter
robot/navel_client/adapter.py - HTTP transport
robot/navel_client/transport.py
Receiver and records
- HTTP receiver
app/server.py - Raw frame contract
app/domain/models.py - JSONL recording
app/recording.py
Social processing
- Tracking pipeline
app/pipeline.py - UID track histories
app/state/tracks.py - Social estimator
app/state/estimator.py - Temporal features
app/state/features.py - Social state
app/state/social_models.py - Social pipeline
app/social_pipeline.py
Policy and actions
- Rule policy
app/policy/rules.py - Target lock
app/policy/target_lock.py - Command planner
app/commands.py - Robot decision dispatch
robot/navel_client/decision_dispatch.py
Replay and models
- Recording replay
app/replay/__init__.py - LLM policy
app/policy/llm.py - Ollama client
app/inference/ollama.py - Decision contract
app/domain/model_decision.py
Other components
- Navel robot
Connections 21
- Navel robot → Sensor collector: supplies packets
README.md - Sensor collector → SDK adapter: reads SDK
robot/navel_client/main.py - Sensor collector → HTTP transport: sends frames
README.md - HTTP transport → HTTP receiver: POSTs observations
README.md - HTTP receiver → Raw frame contract: validates
app/server.py - HTTP receiver → JSONL recording: records frames
app/server.py - HTTP receiver → Tracking pipeline: processes frames
app/server.py - Tracking pipeline → JSONL recording: writes raw frames
app/pipeline.py - Tracking pipeline → UID track histories: updates histories
app/pipeline.py - Social pipeline → Tracking pipeline: gets snapshots
app/social_pipeline.py - Social pipeline → Social estimator: estimates state
app/social_pipeline.py - Social estimator → Temporal features: uses features
app/state/estimator.py - Social estimator → Social state: produces state
app/state/estimator.py - Social pipeline → Rule policy: proposes decision
app/social_pipeline.py - Social pipeline → Target lock: resolves lock
app/social_pipeline.py - Social pipeline → Command planner: plans commands
app/social_pipeline.py - Sensor collector → Robot decision dispatch: dispatches decisions
robot/navel_client/main.py - Recording replay → JSONL recording: reads recordings
README.md - LLM policy → Ollama client: requests inference
app/policy/llm.py - LLM policy → Decision contract: validates output
- Ollama client → Decision contract: parses decisions
app/inference/ollama.py