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:
|
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:
Invalid input sources: Commands from unregistered or disabled input sources are discarded.
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.
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.
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
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 theinterruptparameter (see Priority and Interruption Mechanism for Preset Motions)interrupt = false: first-come, first-served; later requests are rejectedinterrupt = 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 |
|---|---|---|
|
|
Query the current control input source |
|
|
Configure input source |
GetCurrentInputSourceros2-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
McInputSourceros2-msg @ mc/motion/msg/McInputSource.msgstring 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)
SetMcInputSourceros2-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_sourceADD (1001)
Add new input source
name,priority,timeoutMODIFY (1002)
Modify existing input source
name,priority,timeoutDELETE (1003)
Delete input source
nameENABLE (2001)
Enable input source
nameDISABLE (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:
C++ Examples:
Python Examples:
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.