# stm32_cmd_params.yaml — Configuration for stm32_cmd_node (Issue #119)
# Binary-framed Jetson↔STM32 bridge at 921600 baud.

# ── Serial port ────────────────────────────────────────────────────────────────
# Use /dev/stm32-bridge if the udev rule is applied:
#   SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740",
#   SYMLINK+="stm32-bridge", MODE="0660", GROUP="dialout"
serial_port:      /dev/ttyACM0
baud_rate:        921600
reconnect_delay:  2.0        # seconds between USB reconnect attempts

# ── Heartbeat ─────────────────────────────────────────────────────────────────
# HEARTBEAT frame sent every heartbeat_period seconds.
# STM32 fires watchdog and reverts to safe state if no frame received for 500ms.
heartbeat_period: 0.2        # 200ms → well within 500ms STM32 watchdog

# ── Watchdog (Jetson-side) ────────────────────────────────────────────────────
# If no /cmd_vel message received for watchdog_timeout seconds,
# send SPEED_STEER(0,0) to stop the robot.
watchdog_timeout: 0.5        # 500ms

# ── Twist velocity scaling ────────────────────────────────────────────────────
# speed = clamp(linear.x  * speed_scale, -1000, 1000)  (m/s → ESC units)
# steer = clamp(angular.z * steer_scale, -1000, 1000)  (rad/s → ESC units)
#
# Default: 1 m/s → 1000 ESC units, ±2 rad/s → ±1000 steer.
# Negative steer_scale flips ROS2 CCW+ convention to match ESC steer direction.
# Tune speed_scale to set the physical top speed.
speed_scale:  1000.0
steer_scale:  -500.0
