5.1.3 MC Control Signal Configuration

MC control signal configuration provides unified management of multiple input sources, ensuring the robot always responds to the highest-priority control signal.

Control signal configuration is one of the core features of the AgiBot X2 AimDK, enabling unified management and priority arbitration among multiple control sources. This mechanism ensures that when multiple control inputs are active, the robot safely and reliably responds to the command with the highest priority.

Key Features

  • Dynamic Management: Control input sources can be flexibly added, removed, enabled, or disabled at runtime.

  • Conflict Arbitration: When multiple sources are active, priority-based arbitration ensures a single source holds control.

  • Failover Protection: Automatically switches away from an abnormal or timed-out input source to maintain control continuity.

System-Provided Input Sources

The system-provided control input sources are listed below:

source

Description

Priority

Timeout threshold (unit: ms)

linkswarm

Linkswarm swarm control (Linkswarm-dedicated; when enabled, it is exclusively selected as the current input source regardless of priority)

90

1000

rc

Remote controller

80

1000

app_proxy

Agibot Go mobile app

60

1000

vr

Teleoperation module (reserved)

70

1000

interaction

AgiBot Interaction module

50

1000

pnc

AgiBot Planner module

40

1000

Attention

linkswarm has exclusive behavior: once Linkswarm is enabled, it is exclusively selected as the current input source regardless of priority; during this period, control commands from all other input sources (including secondary-development high-priority sources) are discarded until Linkswarm exits.

Warning

Do not add, modify, delete, enable, or disable any system-provided input source (especially linkswarm, which is Linkswarm-dedicated), nor use a system-provided input source in the input source field of control messages. Directly operating or using system-provided input sources may cause control conflicts, robot loss of control, and other unpredictable behavior. Users bear all consequences.

Arbitration Workflow

Input Source Arbitration and Management Rules:

  1. Invalid input sources: Commands from unregistered or disabled input sources are discarded.

  2. Zero command handling: Zero commands (all control values are zero) from all input sources (including the current source) are accepted, but do not reset the timeout timer.

  3. Timeout mechanism: Timeout is calculated based on the last non-zero command. After timeout, command data is cleared (robot stops), but the input source remains unchanged.

  4. Input source switching: A new input source must simultaneously meet all the following conditions to take over control:

    • Input source is registered and enabled

    • Sent a valid (non-zero) command

    • And meets any one of the following conditions:

      • No current input source

      • Current input source has timed out

      • New input source has higher priority than the current source

  5. Command execution: Valid (non-zero) commands from the current input source are applied to robot control.

Note: After a system restart, all input-source priority states reset.

Warning

The priority arbitration mechanism described above applies only to continuous control commands (such as locomotion and pose control).

The following command types are not subject to priority arbitration:

  • Discrete action commands (such as SetMcPresetMotion): behavior depends on the interrupt parameter (see Priority and Interruption Mechanism for Preset Motions)

    • interrupt = false: first-come, first-served; later requests are rejected

    • interrupt = true: interrupts the current motion (no priority comparison)

  • Motion mode commands (such as SetMcAction): constrained by the safety protection mechanism. See Safety Protection Mechanism.

Input Source Management Services

Note

linkswarm has exclusive behavior: once Linkswarm is enabled, it is exclusively selected regardless of priority, and control commands from all other input sources (including secondary-development registered sources) are discarded. Secondary-development registered input sources cannot seize control while Linkswarm is active. See System-Provided Input Sources.

Service Name

Data Type

Description

/aimdk_5Fmsgs/srv/GetCurrentInputSource

GetCurrentInputSource

Query the current control input source

/aimdk_5Fmsgs/srv/SetMcInputSource

SetMcInputSource

Configure input source

  • GetCurrentInputSource ros2-srv @ mc/motion/srv/GetCurrentInputSource.srv

    # Get current control input source
    # Service: /aimdk_5Fmsgs/srv/GetCurrentInputSource
    
    # Request
    CommonRequest request        # Standard request header
    
    ---
    
    # Response
    CommonTaskResponse response  # response.header.code = 0 indicates success
    McInputSource input_source   # Current input source
    
    • McInputSource ros2-msg @ mc/motion/msg/McInputSource.msg

      string name               # Name of the currently selected input source, e.g. rc / vr / app_proxy / ...
      int32 priority             # Configured priority (0-100)
      int32 timeout              # Configured timeout (ms)
      
  • SetMcInputSource ros2-srv @ mc/motion/srv/SetMcInputSource.srv

    # Service: /aimdk_5Fmsgs/srv/SetMcInputSource
    
    # Request
    CommonRequest request        # Common request header
    McInputAction action         # Operation type (action.value:
                                 #   1001 (INPUTACTION_ADD add input source)
                                 #   1002 (INPUTACTION_MODIFY modify input source)
                                 #   1003 (INPUTACTION_DELETE delete input source)
                                 #   2001 (INPUTACTION_ENABLE enable input source)
                                 #   2002 (INPUTACTION_DISABLE disable input source))
    McInputSource input_source   # Input source
    
    ---
    
    # Response
    
    CommonTaskResponse response  # response.header.code == 0 means success
    

    Operation Type (Value)

    Description

    Required field(s) in input_source

    ADD (1001)

    Add new input source

    name, priority, timeout

    MODIFY (1002)

    Modify existing input source

    name, priority, timeout

    DELETE (1003)

    Delete input source

    name

    ENABLE (2001)

    Enable input source

    name

    DISABLE (2002)

    Disable input source

    name

Secondary-development modules should register a custom control source via SetMcInputSource and set its priority, avoiding name collisions with built-in input sources.

Naming convention: to distinguish from system-provided input sources (e.g. rc, app_proxy, linkswarm, which have no prefix), secondary-development input sources should use the sdk_ prefix (e.g. sdk_my_app, sdk_keyboard_ctrl), avoiding name collisions with system-provided sources by design.

Priority Reference:

Priority Range

Usage

100-81

System-level control (emergency stop, safety modes)

80-60

High-level control (remote controller, mobile app)

59-40

Mid-level control (voice, gestures)

39-20

Low-level control (SDK custom development)

19-0

Backup control (debugging, testing)

Secondary-development input sources default to the 20-39 range (low-level control); to exceed the APP (priority 60) or remote controller (priority 80) and seize control, set a higher priority in the 40-100 range.

Programming Examples

For detailed programming examples and code explanations, refer to:

Notes

Important

MC control signal configuration is available only in X2_AimDK v0.7 and later; it is not supported in v0.6 or earlier.

Caution

As standard ROS DO NOT handle cross-host service (request-response) well, please refer to SDK examples to use open interfaces in a robust way (with protection mechanisms e.g. exception safety and retransmission)

While the robot is in Stable Standing Mode or Locomotion Mode, DO NOT launch ROS nodes in rapid bulk (no more than 2 nodes per second is recommended), as a large number of nodes joining DDS discovery within a short period causes communication congestion and degrades motion control real-time performance, which may cause the robot to lose balance and fall

Note

Before the motion-control system receives any valid input (e.g., after power-on with no movement and all commanded velocities being zero), querying the current input source may return empty.