[Unit]
Description=AGIBOT X2 dashboard agent (ROS 2 to TCP bridge)
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
WorkingDirectory=/home/agi/x2_dashboard_agent
ExecStart=/home/agi/x2_dashboard_agent/run_agent.sh
Restart=always
RestartSec=5
TimeoutStopSec=15
KillMode=mixed
# The robot's own stack takes a while to come up after power-on; the agent
# tolerates an empty graph and fills in as topics appear, so starting early is
# fine and means the dashboard attaches as soon as possible.
StandardOutput=journal
StandardError=journal
# Fast DDS writes a very high volume of discovery chatter (to stdout, alongside
# the agent's own messages, so it cannot simply be dropped). Rate-limiting keeps
# the journal from being swamped while still letting the agent's lines through.
LogRateLimitIntervalSec=30s
LogRateLimitBurst=300
Environment=RCUTILS_LOGGING_SEVERITY=ERROR
Environment=ROS_DOMAIN_ID=0

[Install]
WantedBy=default.target
