# motor_daemon_params.yaml — Configuration for motor_daemon_node (Issue #523)
# W-protocol motor control daemon over /dev/ttyTHS1 (Orin UART to FC).

motor_daemon_node:
  ros__parameters:
    # ── Serial port ──────────────────────────────────────────────────────────
    # Orin UART1 → FC USART6 (PC6/PC7) @ 921600 baud
    serial_port:      /dev/ttyTHS1
    baud_rate:        921600
    reconnect_delay:  2.0        # seconds between reconnect attempts

    # ── TX rate ───────────────────────────────────────────────────────────────
    # Fixed rate at which W<speed>,<steer> is sent regardless of /cmd_vel rate.
    send_rate_hz:     50.0       # 50 Hz

    # ── Safety watchdog ───────────────────────────────────────────────────────
    # If no /cmd_vel received within watchdog_timeout seconds, send W0,0.
    watchdog_timeout: 0.2        # 200ms

    # ── FC status polling ─────────────────────────────────────────────────────
    # How often to send '?' to the FC for a status response.
    status_query_period: 1.0     # 1 Hz

    # ── Twist → ESC scaling ───────────────────────────────────────────────────
    # speed = clamp(linear.x  * speed_scale,  -1000, 1000)
    # steer = clamp(angular.z * steer_scale,  -1000, 1000)
    #
    # Default: 1.0 m/s maps to 1000 ESC units (top speed).
    # Negative steer_scale flips ROS2 CCW+ convention to match ESC direction.
    speed_scale:  1000.0
    steer_scale:  -500.0
