Skip to content

AgentCore setup: the DOA_Pose graph and agent config

Lives on: the follower Pi 5, in the AgentCore install. Source in this repo under agentcore/agent/ (agent_config.json, graphs/DOA_Pose.json).

What it does

AgentCore runs on the Pi 5 and owns the link to the Cube flight controller. Its behaviour is built from graphs: boxes wired together in a browser editor and saved as JSON. The DOA_Pose graph is the bridge between AgentCore and our DOA app: five times a second it reads the drone's position and heading and sends them to the app, and it prints the app's health and pairing count to the log.

The graph JSON isn't meant to be read by hand, so here's what it does instead:

Start --> Delay (0.2 s, repeat) --> External Process (DOA app, port 8770) --> Print
                                         ^                     |
   Agent's Global Position               |                     | reply
   (lat, lon, hdg, time_boot_ms) --> Create Dictionary         v
                                                       health.state, pair_stats.paired
                                                               |
                                                               v
                                                Print: "OK paired=1234"

Walkthrough

  • Start → Delay → External Process. AgentCore walks a graph from its Start node every frame. The Delay node (0.2 s, repeat on) is what sets the rate: 5 calls a second.
  • Agent's Global Position → Create Dictionary. Takes the latest position message from the Cube and packs lat, lon, hdg (already in degrees) and time_boot_ms into the request.
  • External Process. Sends that dictionary to the DOA app and waits up to 2 s for the reply.
  • Decode → Print. Pulls health.state and pair_stats.paired out of the reply and prints e.g. OK paired=1234 to the agent log, so you can tell at a glance that bearings are being paired.

The graph was generated by a short script (make_pose_graph.py) rather than wired by hand in the editor, so it can be rebuilt exactly.

Agent config: the settings that matter

Setting Value Why
Agent ID rfdf-follow Names this drone in AgentCore
SYS_ID 1 Must match the Cube's MAVLink system ID
Position (GLOBAL_POSITION_INT) rate 5 Hz (was 0.5 Hz) The default was far too slow to tag bearings on a turning drone
Attitude (ATTITUDE) rate 5 Hz Yaw rate
GPS (GPS_RAW_INT), SYSTEM_TIME 1 Hz GPS quality, and GPS time for clock sync later
Graphs at startup DOA_Pose on; ModeControl, ArmCmd, LoadMission, Go off Nothing that can arm or fly the drone starts on its own

Notes

  • AgentCore is provided to the team as release executables; we don't change its code. All of our logic lives in the DOA app, behind the External Process node.
  • The older DOA_Test graph (8 Oct) only checked the Kraken's health; it's kept but no longer starts automatically.