2. Software System Overview
2. Software System Overview
2.1 Basic Startup Mode
The robot's industrial control system consists of MDU and HDU, both running Ubuntu 24.04. The MDU acts as the robot's "cerebellum" and the HDU as the "brain." Both use systemd as the system service manager. On startup, the PM (Process Manager) and SM (State Manager) modules are launched, which then cooperate to start other module processes. The SM manages the enabling and disabling of process lists under different system modes.
The configuration file paths for PM and SM are /agibot/software/v0/entry/launch/A3_T2D5_ZY3_L.yaml (for both HDU & MDU, the yaml name varies by model) and agibot/software/v0/config/sm/sm_config.yaml (for MDU). The former lists the default processes to start, while the latter specifies which functional groups are enabled in each system mode.
2.2 Module Function Overview
| Module Type | Controller | Module Name | Description |
|---|---|---|---|
| Public/Basic Service | MDU | mosquitto (MQTT Gateway) | MQTT gateway node, interfaces with AimMaster and onboard software |
| MDU & HDU | iox_roudi (iceoryx Shared Memory Center) | Central scheduling for iceoryx communication, provides data storage location | |
| aimrte-tool-record_playback (Bag Recorder) | Used for continuous recording of bag files | ||
| setting (Settings Module) | Provides basic controller settings, such as WiFi, Bluetooth, etc. | ||
| Management Module | MDU | SM (System State Management Module) | Responsible for switching system states and managing process lists |
| HDU & MDU | EM (Process Management Module) | Responsible for starting processes and querying process status | |
| Functional Module | MDU | hds, health_monitor (Health Diagnosis Module) | Receives fault information reported by each module |
| motion_control (Motion Control Module) | Responsible for overall robot motion control, issues motion commands | ||
| skillpilot (Skill Module) | Interfaces for light strip, actions, expressions, and task management | ||
| motion_player (Action Playback Module) | Provides action playback capability | ||
| hal_ethercat (Hardware Abstraction Layer) | Handles EtherCAT communication with MCU, transmits hardware status and control commands | ||
| gateway (Gateway Communication) | Forwards external requests to internal modules | ||
| HDU | hal_audio (Audio Playback Module) | Provides atomic audio playback capability for agent calls | |
| resource_manager (Resource Management Module) | Unified management of onboard actions, expressions, broadcast, and other resource files | ||
| agent (Interaction Module) | Unified management of robot interaction capabilities | ||
| hdu_camera (Camera Module) | Responsible for managing robot camera functions |
2.2.1 System Modes
The modules activated and started in each system mode differ, as shown below (excerpt from sm_config.yaml):
# System States
system_modes:
"Startup":
next_mode_list: [ "Ready", "OTA", "Poweroff" ]
active_FG_list: [ "System", "HAL", "EStop", "MoCap", "Gateway", "OTA" ]
action_list:
- [ DIFF ]
- [ activate recordbag0 ]
- [ activate recordbag1 ]
"Poweroff":
next_mode_list: []
active_FG_list: []
action_list:
- [ open Poweroff ]
"Reboot":
next_mode_list: []
active_FG_list: []
action_list:
- [ open Reboot ]
# System ready state, will start business management modules and HAL
"Ready":
next_mode_list: [ "Manual", "EStop", "Poweroff" ]
active_FG_list: [ "System", "HAL", "EStop", "MoCap", "Gateway", "Motion", "OTA" ]
action_list:
- [ DIFF ]
- [ activate recordbag0 ]
- [ activate recordbag1 ]
- [ activate agent ]
- [ activate motion_player ]
# post_process:
# - level: 34
# action_list: [ [ forbid Manual ] ]
# OTA state, will start the OTA functional group to complete OTA-related functions
"OTA":
next_mode_list: [ "Reboot", "Ready", "Poweroff" ]
active_FG_list: [ "System", "HAL", "MoCap", "Gateway", "Motion", "OTA" ]
action_list:
- [ DIFF ]
- [ activate recordbag0 ]
- [ activate recordbag1 ]
- [ deactivate agent ]
- [ activate mc ]
- [ deactivate motion_player ]
# Manual state, will start remote control and MC functional groups
"Manual":
next_mode_list: [ "OTA", "Auto", "Reset", "EStop", "Poweroff", "MotionStream", "DataCollection", "FreeExploration", "Mapping", "Manipulator", "Lock" ]
active_FG_list: [ "System", "HAL", "EStop", "MoCap", "Gateway", "Motion", "OTA" ]
action_list:
- [ DIFF ]
- [ activate recordbag0 ]
- [ activate recordbag1 ]
- [ activate agent ]
- [ activate mc ]
- [ activate motion_player ]
child_modes:
- mode_name: "Safety" # State entered by calling the enable script under tools
extra_next_modes: [ "OTA", "Reset" ]
action_list:
- [ close Motion ]
- [ close EStop ]
post_process:
- level: 47
action_list: [ [ fallback mc ] ]
# Lock state
"Lock":
next_mode_list: [ "Manual" ]
active_FG_list: [ "System", "HAL", "EStop", "MoCap", "Gateway", "Motion", "OTA" ]
action_list:
- [ DIFF ]
- [ activate recordbag0 ]
- [ activate recordbag1 ]
- [ deactivate agent ]
- [ activate mc ]
- [ deactivate motion_player ]
post_process:
- level: 47
action_list: [ [ fallback mc ] ]
# Reset state, used to restore factory settings
"Reset":
next_mode_list: [ "Reboot", "Poweroff" ]
active_FG_list: [ "System", "OTA", "Gateway" ]
action_list:
- [ DIFF ]
# Emergency stop state, used for emergency stop
"EStop":
next_mode_list: [ "Ready", "OTA", "Poweroff" ]
active_FG_list: [ "System", "HAL", "EStop", "MoCap", "Gateway", "Motion", "OTA" ]
action_list:
- [ DIFF ]
- [ activate recordbag0 ]
- [ activate recordbag1 ]
- [ activate agent ]
- [ deactivate mc ]
- [ activate motion_player ]
# Real-time teleoperation state, used for real-time teleoperation
"MotionStream":
next_mode_list: [ "Manual", "EStop", "Poweroff", "DataCollection" ]
active_FG_list: [ "System", "HAL", "EStop", "MoStream", "Gateway", "Motion", "OTA" ]
action_list:
- [ DIFF ]
- [ activate recordbag0 ]
- [ activate recordbag1 ]
- [ activate agent ]
- [ activate mc ]
decision: # System decision layer
Auto_transToReady: true # If false, you need to call the one-click activation script at the appropriate time
Auto_transToManual: true
type: 1
2.2.2 Module Disabling Method (Caution)
If you need to replace certain functional modules for secondary development, you need to configure the system to disable those modules.
Modules are managed by either A3_T2D5_ZY3_L.yaml or sm_config.yaml. Modules managed by the former are started by default at boot and are not managed by sm afterwards, remaining resident; modules managed by the latter are switched between different system modes.
- To disable modules managed by A3_T2D5_ZY3_L.yaml (i.e., those in default_apps), simply remove them from default_apps.
- To disable modules managed by sm, add a deactivate line in the corresponding system mode to disable the specified module.
- Please back up A3_T2D5_ZY3_L.yaml and sm_config.yaml in the relevant directory before making any changes.
For example, to disable the motion_player module, follow these steps: First, back up A3_T2D5_ZY3_L.yaml (MDU) and sm_config.yaml.
cp /agibot/software/v0/entry/launch/A3_T2D5_ZY3_L.yaml \
/agibot/software/v0/entry/launch/A3_T2D5_ZY3_L_backup.yaml
cp /agibot/software/v0/config/sm/sm_config.yaml \
agibot/software/v0/config/sm/sm_config_backup.yaml
In A3_T2D5_ZY3_L.yaml (MDU), remove the motion_player module from the default_apps list:
@@ -22,7 +22,6 @@ process_manager:
"health_monitor0",
"recordbag0",
- "motion_player",
"hds",
"setting0",
"mc",
# "pnc",
# "uwb_fusion",
"hal_ethercat",
"hal_elink",
"skillpilot",
"ota_master",
"gateway",
"ota_service0",
Then in sm_config.yaml (MDU), remove motion_player from the group in SystemManagerModule, set MoCap config to empty, and remove activate/deactivate operations for motion_player in each state:
@@ -14,7 +14,7 @@ SystemManagerModule:
- group: [motion_player, mc, hal_ethercat, poweroff0, reboot0, setting0, recordbag0, health_monitor0, hds, gateway, ota_master, ota_service0]
+ group: [mc, hal_ethercat, poweroff0, reboot0, setting0, recordbag0, health_monitor0, hds, gateway, ota_master, ota_service0]
@@ -36,7 +36,7 @@ SystemManagerModule:
"RC":
[ "rc" ]
"MoCap":
- [ "motion_player" ]
+ []
"MoStream":
[ "motion_streamer" ]
@@ -78,7 +78,6 @@ SystemManagerModule:
"Ready":
next_mode_list: [ "Manual", "EStop", "Poweroff" ]
active_FG_list: [ "System", "HAL", "EStop", "MoCap", "Gateway", "Motion", "OTA" ]
action_list:
- [ DIFF ]
- [ activate recordbag0 ]
- [ activate recordbag1 ]
- - [ activate motion_player ]
@@ -93,7 +93,6 @@ SystemManagerModule:
"OTA":
next_mode_list: [ "Reboot", "Ready", "Poweroff" ]
active_FG_list: [ "System", "HAL", "MoCap", "Gateway", "Motion", "OTA" ]
action_list:
- [ DIFF ]
- [ activate recordbag0 ]
- [ activate recordbag1 ]
- [ deactivate agent ]
- [ activate mc ]
- - [ deactivate motion_player]
@@ -105,7 +105,6 @@ SystemManagerModule:
"Manual":
next_mode_list: [ "OTA", "Auto", "Reset", "EStop", "Poweroff", "MotionStream", "DataCollection", "FreeExploration", "Mapping", "Manipulator", "Lock" ]
active_FG_list: [ "System", "HAL", "EStop", "MoCap", "Gateway", "Motion", "OTA" ]
action_list:
- [ DIFF ]
- [ activate recordbag0 ]
- [ activate recordbag1 ]
- [ activate agent ]
- [ activate mc ]
- - [ activate motion_player ]
@@ -126,7 +126,6 @@ SystemManagerModule:
"Lock":
next_mode_list: [ "Manual" ]
active_FG_list: [ "System", "HAL", "EStop", "MoCap", "Gateway", "Motion", "OTA" ]
action_list:
- [ DIFF ]
- [ activate recordbag0 ]
- [ activate recordbag1 ]
- [ deactivate agent ]
- [ activate mc ]
- - [ deactivate motion_player ]
@@ -148,7 +148,6 @@ SystemManagerModule:
"EStop":
next_mode_list: [ "Ready", "OTA", "Poweroff" ]
active_FG_list: [ "System", "HAL", "EStop", "MoCap", "Gateway", "Motion", "OTA" ]
action_list:
- [ DIFF ]
- [ activate recordbag0 ]
- [ activate recordbag1 ]
- [ activate agent ]
- [ deactivate mc ]
- - [ activate motion_player ]