7.5 Resource Management
7.5.1 Overview
A3-Ultra local resource management currently exposes six types of resources: motions, emoticons, audio, skills, maps, and creative works. Users can create, delete, query, import, and export these resources to meet robot capability configuration and content customization requirements. For detailed supported features, refer to the resource descriptions below.
The following sections describe each resource module and its related functions in detail.
Workflow:
Creation and storage: Users must first place data in the temporary directory /agibot/data/resources/tmp on the HDU node and trigger synchronization through the RPC interface. The system automatically identifies the resource source and persists it into one of the following directories by category:
- User-created resource directory:
/agibot/data/resources/custom - Default resource directory:
/agibot/data/resources/default
Note that the temporary directory /agibot/data/resources/tmp is cleared automatically after the robot restarts. The .gz files generated during export are also part of the tmp directory. Make sure important resources have been synchronized and persisted.
Query and maintenance: The system supports real-time resource queries, including resource lists and detailed resource information. It also provides a delete interface so users can remove resources that are no longer needed and keep resource storage organized and manageable.
Distribution and migration: Users can quickly export and import created resources through the RPC interface, which is suitable for the following scenarios:
- Fast resource backup
- Batch migration across devices
- Efficient reuse of configured resources
Resource description:
| Resource Type | Description | Create/Delete | Import/Export | Query | Update | Display Location |
|---|---|---|---|---|---|---|
| Emoticon | Animations displayed on the head LED | ✔ | ✔ | ✔ | ✔ | AimMaster → Skills → Emoticon |
| Motion | Mostly upper-body actions such as waving, finger-heart, or thumbs-up | ✔ | ✔ | ✔ | Only resource_name can be modified | AimMaster → Skills → Motion |
| Audio | Robot voice resources | ✔ | ✖ | ✔ | ✖ | AimMaster → Skills → Voice |
| Skill | Full-body robot dances | ✖ | ✖ | ✔ | ✖ | AimMaster → Skills → Talent |
| Creative Work | Complex and continuous full-body dances or upper-body action performances created by orchestrating emoticon, motion, audio, and skill modules together. | ✔ | ✔ | ✔ | ✖ | AimMaster → Skills → My Creations |
| Map | Maps used for robot navigation and localization | ✖ | ✔ | ✔ | ✖ | AimMaster → Map |
All of the resources above are stored on the HDU. Users can use these RPC interfaces together with AimMaster.
7.5.2 Partial Parameter Declarations
resource_type values:
RESOURCE_TYPE_MOTION = 1; // Motion
RESOURCE_TYPE_EMOTICON = 2; // Emoticon
RESOURCE_TYPE_AUDIO = 3; // Audio
RESOURCE_TYPE_SKILL = 6; // Skill
RESOURCE_TYPE_MAP = 7; // Map
RESOURCE_TYPE_OFFRING_WORK = 8; // Creative work
xxx_extra_info declarations:
// tmp/xxx means the creation path is /agibot/data/resources/tmp
// HDU paths are used during resource creation
// The comment after each field explains when it can be used. If a field is marked as usable during creation,
// include it when creating the resource. Fields not marked for creation do not need to be provided.
/**
* @brief Emoticon extra information
*/
//resource_type=RESOURCE_TYPE_EMOTICON
"emoticon_extra_info" {
"display_name" {
"zh_CN": "Right-hand heart gesture",
"en_US": "Finger heart_right hand",
}, // Display names in Chinese and English, format: map<string, string> (query)
"emoticon_file_url": "tmp/e.mp4", // Emoticon file URL (create/query/update). tmp/xxx means /agibot/data/resources/tmp on the HDU
"thumbnail_file_url": "tmp/t.mp4", // Thumbnail file URL (create/query/update)
"cover_file_url" = "tmp/1.png", // Cover image URL (create/query/update)
}
/**
* @brief Motion extra information
*/
//resource_type=RESOURCE_TYPE_MOTION
"motion_extra_info":{
"record_file_path":"/agibot/data/home/agi/test/right_hand_thumbs_up_long", // Recording file path on the HDU. "test" is the folder name and "right_hand_thumbs_up_long" is the .macp file name (used only during creation)
"display_name" {
"zh_CN": "Right-hand heart gesture",
"en_US": "Finger heart_right hand",
}, // Display names in Chinese and English (query)
"cover_file_url": "" , // Preview image URL (query)
"preview_video_url":"" ,// Preview video URL (query)
}
/**
* @brief Audio extra information
*/
//resource_type=RESOURCE_TYPE_AUDIO
"audio_extra_info": {
"audio_file_url" :"" // Audio file URL (create/query)
"display_name" {
"zh_CN": "",
"en_US": "",
}, // Display names in Chinese and English (query)
"cover_file_url":"" ,// Preview image URL (query)
}
/**
* @brief Creative work extra information
*/
//resource_type=RESOURCE_TYPE_OFFRING_WORK
"offring_work_extra_info": {
"cover_file_url": "",// Cover file URL (query)
"preview_video_url": "",// Preview file URL (query)
"display_name": {
"display_name_zh": "Test creative work",
"display_name_en": "Test Creative Work"
},// Display names in Chinese and English (query)
"motions": [
{
// Use NormalMotion when the resource in motions.resources is a motion resource.
// Use WholeBodyDance when the resource is a talent/skill resource. An example is shown below as well.
"type": "NormalMotion",
"resources": [
{
"source_type": 1, // 1 means SKILL_DETAIL_SOURCE_TYPE_LOCAL_RESOURCE (local resource), 2 means SKILL_DETAIL_SOURCE_TYPE_SKILL_PACKAGE_RESOURCE (resource included in a skill package)
"path": "/agibot/data/resources/custom/motion/pose_i_am_super_strong/pose_i_am_super_strong.mcap"// Resource file path on the HDU
}
]
}
],
"emoticons": [
{
"resources": [
{
"source_type": 1,
"path": "/agibot/data/resources/custom/emoticon/emoticon_guiding/emoticon.mp4"
}
]
}
],
"audios": [
{
"resources": [
{
"source_type": 1,
"path": "/agibot/data/resources/custom/audio/test/test.wav"
}
]
}
],
}
/**
* @brief Creative work extra information
*/
//resource_type=RESOURCE_TYPE_OFFRING_WORK
"offring_work_extra_info": {
"cover_file_url": "",
"preview_video_url": "",
"display_name": {
"display_name_zh": "Test creative work",
"display_name_en": "Test Creative Work"
},
"motions": [
{
// When the resource in motions is a talent/skill resource, refer to the following example
"type": "WholeBodyDance",
"resources": [
{
"source_type": 1,
"path": "Acceleration Moment"
}
]
}
],
"emoticons": [
{
"resources": [
{
"source_type": 1,
"path": "/agibot/data/resources/custom/emoticon/emoticon_guiding/emoticon.mp4"
}
]
}
],
"audios": [
{
"resources": [
{
"source_type": 1,
"path": "/agibot/data/resources/custom/audio/test/test.wav"
}
]
}
],
}
/**
* @brief Map extra information
*/
//resource_type=RESOURCE_TYPE_MAP
"map_extra_info": {
"map_info": {
"index": 2,
"map_path": "/agibot/data/var/MapManagerModule/1762584133656/",
"width": 1216.0, // Map width and height, in pixels
"height": 1262.0,
"resolution": 20.0, // Actual distance represented by each pixel, in millimeters
"origin": {
"u": 524, // Column index of the world coordinate origin on the map
"v": 594 // Row index of the world coordinate origin on the map
}
},
"topology_info": [ // Topology information, mainly storing robot navigation point information, corresponding to AimMaster → Map → Point settings
{
"topo_msg": {
"cur_path_id": 0,
"cur_point_id": 1,
"cur_region_id": 0,
"hr_points": null,
"navi_points": [
{
"id": 1,
"name": "Waypoint 1",
"pose": {
"x": 7.85, // Unit: meter
"y": -2.15,
"theta": -2.503741636798901 // Unit: radian
},
"type": 1
}
],
"paths": null,
"qr_points": null,
"regions": null,
"rotate_angle": 6.001279822735171,
"user_name": "",
"user_sn": 0
},
"user_name": ""
}
]
},
7.5.3 Create Resource
| Interface Name | pb:/aimdk.protocol.ResourceService/CreateResource |
|---|---|
| Overview | Create resource |
| Interface Type | HTTP JSON RPC |
| URL | http://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/CreateResource |
| Input |
|
| Output |
|
| Example Script | examples/resource_manager/CreateResource.py |
| Remarks |
|
7.5.4 Delete Resource
| Interface Name | pb:/aimdk.protocol.ResourceService/DeleteResource |
|---|---|
| Overview | Delete a resource |
| Interface Type | HTTP JSON RPC |
| URL | http://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/DeleteResource |
| Input |
|
| Output |
|
| Example Script | examples/resource_manager/DeleteResource.py |
| Remarks |
|
7.5.5 Update Emoticon Resource
| Interface Name | pb:/aimdk.protocol.ResourceService/UpdateResource |
|---|---|
| Overview | Update a resource |
| Interface Type | HTTP JSON RPC |
| URL | http://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/UpdateResource |
| Input |
|
| Output |
|
| Example Script | examples/resource_manager/UpdateResource.py |
| Remarks |
7.5.6 Get Resource List
| Interface Name | pb:/aimdk.protocol.ResourceService/GetResourceList |
|---|---|
| Overview | Get the resource list |
| Interface Type | HTTP JSON RPC |
| URL | http://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/GetResourceList |
| Input |
|
| Output |
|
| Example Script | examples/resource_manager/GetResourceList.py |
| Remarks |
7.5.7 Get Single Resource Information
| Interface Name | pb:/aimdk.protocol.ResourceService/GetResource |
|---|---|
| Overview | Get information about a resource |
| Interface Type | HTTP JSON RPC |
| URL | http://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/GetResource |
| Input |
|
| Output |
|
| Example Script | examples/resource_manager/GetResource.py |
| Remarks |
7.5.8 Export Resource
| Interface Name | pb:/aimdk.protocol.ResourceService/ResourceMigrationOut |
|---|---|
| Overview | Export resources |
| Interface Type | HTTP JSON RPC |
| URL | http://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/ResourceMigrationOut |
| Input |
|
| Output |
|
| Example Script | examples/resource_manager/ResourceMigrationOut.py |
| Remarks |
7.5.9 Import Resource
| Interface Name | pb:/aimdk.protocol.ResourceService/ResourceMigrationIn |
|---|---|
| Overview | Import resources |
| Interface Type | HTTP JSON RPC |
| URL | http://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/ResourceMigrationIn |
| Input |
|
| Output |
|
| Example Script | examples/resource_manager/ResourceMigrationIn.py |
| Remarks |
7.5.10 Migration Status
| Interface Name | pb:/aimdk.protocol.ResourceService/GetResourceMigrationTaskStatus |
|---|---|
| Overview | Resource migration status |
| Interface Type | HTTP JSON RPC |
| URL | http://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/GetResourceMigrationTaskStatus |
| Input |
|
| Output |
|
| Example Script | examples/resource_manager/GetResourceMigrationTaskStatus.py |
| Remarks |