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 TypeDescriptionCreate/DeleteImport/ExportQueryUpdateDisplay Location
EmoticonAnimations displayed on the head LEDAimMaster → Skills → Emoticon
MotionMostly upper-body actions such as waving, finger-heart, or thumbs-upOnly resource_name can be modifiedAimMaster → Skills → Motion
AudioRobot voice resourcesAimMaster → Skills → Voice
SkillFull-body robot dancesAimMaster → Skills → Talent
Creative WorkComplex and continuous full-body dances or upper-body action performances created by orchestrating emoticon, motion, audio, and skill modules together.

AimMaster → Skills → My Creations
MapMaps 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:

plain
  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:

thrift
// 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 Namepb:/aimdk.protocol.ResourceService/CreateResource
OverviewCreate resource
Interface Type HTTP JSON RPC
URLhttp://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/CreateResource
Input
text
{
    "header": {
        "timestamp": {
            "seconds": "0",
            "nanos": 0,
            "ms_since_epoch": "1744598548952"
        },
        "control_source": 0
    },
    "resource":{
       "duration":3000,
       "resource_name": "test",
       "resource_type": 2,
       "tags":["showroom_guide","dynamic_obstacle_avoidance"],
       "emoticon_extra_info":{
          "emoticon_file_url":"tmp/e.mp4",
          "thumbnail_file_url":"tmp/t.mp4",
          "cover_file_url":"tmp/1.png"
        }
    }
}
  • resource_type: You can provide either the numeric value or the enum name. For example, 2 corresponds to RESOURCE_TYPE_EMOTICON. For the full mapping, refer to section 7.5.2. Using the enum name is recommended; numeric values are kept only for compatibility.
  • resource_name: Resource name
  • tags: Tags
  • The xxxx_extra_info field must match resource_type. See the partial parameter declarations for details.
  • After a resource is created, it is assigned a resource_id. This field is auto-incremented by the system and does not need to be provided during creation.
Output
text
{
  "header": {
    "code": "0",
    "msg": "Resource create success",
    "trace_id": "",
    "domin": ""
  }
}
  • The output content is consistent with the Get Resource List interface.
  • On success, msg is Resource create success.
  • On failure, msg is Failed to create emoticon. The resource type in the message changes according to the actual resource type, for example motion for motion resources.
Example Scriptexamples/resource_manager/CreateResource.py
Remarks
  • Skill resources cannot be created.

7.5.4 Delete Resource

Interface Namepb:/aimdk.protocol.ResourceService/DeleteResource
OverviewDelete a resource
Interface Type HTTP JSON RPC
URLhttp://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/DeleteResource
Input
text
{
    "header": {
        "timestamp": {
            "seconds": "0",
            "nanos": 0,
            "ms_since_epoch": "1744598548952"
        },
        "control_source": 0
    },
    "resource":{
       "resource_name": "test",
       "resource_type": 2,
       "resource_id": "1",
    }
}
  • Either resource_id or resource_name must be provided.
  • resource_type must be provided; otherwise all resources are deleted by default. For example, 2 means RESOURCE_TYPE_EMOTICON. See section 7.5.2 for details.
Output
text
{
  "header": {
    "code": "1441801",
    "msg": "Resource delete success",
    "trace_id": "",
    "domin": ""
  }
}
  • On success, msg is Resource delete success.
  • On failure, msg is Failed to delete resource.
Example Scriptexamples/resource_manager/DeleteResource.py
Remarks
  • Deleting skill resources is not supported.

7.5.5 Update Emoticon Resource

Interface Namepb:/aimdk.protocol.ResourceService/UpdateResource
OverviewUpdate a resource
Interface Type HTTP JSON RPC
URLhttp://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/UpdateResource
Input
text
{
    "header": {
        "timestamp": {
            "seconds": "0",
            "nanos": 0,
            "ms_since_epoch": "1744598548952"
        },
        "control_source": 0
    },
    "resource": {
        "resource_id": 10001,
        "resource_type": "RESOURCE_TYPE_EMOTICON",
        "resource_name": "2222222222222222",
        "emoticon_extra_info":{
           "emoticon_file_url":"",
           "thumbnail_file_url":"",
           "cover_file_url":""
        }
    }
}
  • Except for emoticon resources, motion resources can only update resource_name. Updating other resource types is not currently supported. If you attempt to update other resource types, the output may still indicate success, but the resource information will remain unchanged when queried.
  • Modifying resource_id or resource_type is not supported.
Output
text

{
  "header": {
    "code": "0",
    "msg": "Resource update success",
    "trace_id": "",
    "domin": ""
  }
}
  • On success, msg is Resource update success.
  • On failure, msg is Failed to get original resource, usually because resource_id was entered incorrectly.
Example Scriptexamples/resource_manager/UpdateResource.py
Remarks

7.5.6 Get Resource List

Interface Namepb:/aimdk.protocol.ResourceService/GetResourceList
OverviewGet the resource list
Interface Type HTTP JSON RPC
URLhttp://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/GetResourceList
Input
text
{
    "header": {
        "timestamp": {
            "seconds": "0",
            "nanos": 0,
            "ms_since_epoch": "1744598548952"
        },
        "control_source": 0
    },
    "resource_type": "RESOURCE_TYPE_EMOTICON",
}
  • resource_type: Refer to section 7.5.2 for the available resource_type values.
Output
text
{
  "header": {
    "code": "0",
    "msg": "Resource list get success",
    "trace_id": "",
    "domin": ""
  },
  "resources": [
    {
      "id": 36,
      "resource_id": 16,
      "resource_key": "",
      "resource_version": "",
      "resource_name": "emoticon_language_change",
      "duration": 3000,
      "resource_type": "RESOURCE_TYPE_EMOTICON",
      "resource_path": "/agibot/data/resources/default/emoticon/emoticon_language_change/emoticon.mp4",
      "source": "default",
      "charge_type": "CHARGE_TYPE_FREE",
      "is_change": false,
      "create_time_stamp": "1767785325",
      "update_time_stamp": "1767785325",
      "expire_time_stamp": "0",
      "last_used_time_stamp": "0",
      "md5": "4a605dcb92af92adeaf874e1e4970ea2",
      "description": "Emoticon used when switching between Chinese and English",
      "tags": [],
      "scenes": [],
      "emoticon_extra_info": {
        "display_name": {
          "zh_CN": "Language Switch",
          "en_US": "Language switch"
        },
        "emoticon_file_url": "default/emoticon/emoticon_language_change/emoticon.mp4", // Under /agibot/data/resources/ on ORIN
        "thumbnail_file_url": "default/emoticon/emoticon_language_change/thumbnail.mp4",
        "cover_file_url": "default/emoticon/emoticon_language_change/cover.png"
      },
      "usagerights": ["Agent"]
    },
    {
      "id": 51,
      "resource_id": 22,
      "resource_name": "emoticon_voice_rejection",
      "duration": 4000,
      "resource_type": "RESOURCE_TYPE_EMOTICON",
      "description": "Used when user speech is rejected; intended for voice interaction only",
      "emoticon_extra_info": {
        "display_name": {
          "zh_CN": "Speech Rejection",
          "en_US": "Voice rejection"
        }
      },
      "usagerights": ["Agent", "AimMaster"]
    }
    // ... several resources omitted here
  ],
  "tags": [],
  "scenes": [
    "normal-emoticon_list",
    "task-associated_emoticon"
  ],
  "usagerights": [
    "Agent",
    "AimMaster"
  ]
}
  • resource_id: Resource ID
  • resource_name: Resource name
  • double duration: Resource duration in milliseconds. This does not need to be provided when importing or creating through AimMaster, but it must be provided when creating directly through the API without import.
  • resource_type: Resource type. See section 7.5.2.
  • resource_path: Resource path
  • source: Resource source. Currently only custom and default are supported.
  • is_change: Whether modification is supported
  • create_time_stamp: Creation timestamp
  • update_time_stamp: Update timestamp
  • md5: MD5 of the primary resource file
  • description: Description
  • tags: Tags
  • scenes: Scenes
  • emoticon_extra_info: One of the xxx_extra_info fields described in section 7.5.2.
  • usagerights: Usage permissions
  • The remaining output fields are redundant and can generally be ignored.
Example Scriptexamples/resource_manager/GetResourceList.py
Remarks

7.5.7 Get Single Resource Information

Interface Namepb:/aimdk.protocol.ResourceService/GetResource
OverviewGet information about a resource
Interface Type HTTP JSON RPC
URLhttp://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/GetResource
Input
text
{
    "header": {
        "timestamp": {
            "seconds": "0",
            "nanos": 0,
            "ms_since_epoch": "1744598548952"
        },
        "control_source": 0
    },
    "resource_type": "RESOURCE_TYPE_EMOTICON",
    "resource_id": "1",
    "resource_name": "emoticon_prompt_words"    
    "source": "custom"
}
  • resource_type: RESOURCE_TYPE_EMOTICON indicates the emoticon type. The type definition is the same as in Get Resource List.
  • resource_type: Required.
  • resource_id: Corresponds to the resource_id returned in the resource list.
  • resource_name: Corresponds to the resource_name returned in the resource list.
  • source: Indicates the resource source, either custom or default. Resources created through RPC are generally custom.
  • Either resource_id or resource_name must be provided. If resource_name is provided, source must also be provided. The default source is default. Resources created through RPC must use source=custom. If resource_id is provided, source is not required. Using resource_id is recommended.
Output
text
{
  "header": {
    "code": "0",
    "msg": "Resource get success",
    "trace_id": "",
    "domin": ""
  },
  "resource": {
    "id": 34,
    "resource_id": 1,
    "resource_key": "",
    "resource_version": "",
    "resource_name": "emoticon_prompt_words",
    "duration": 3000,
    "resource_type": "RESOURCE_TYPE_EMOTICON",
    "resource_path": "/agibot/data/resources/default/emoticon/emoticon_prompt_words/emoticon.mp4",
    "source": "default",
    "charge_type": "CHARGE_TYPE_FREE",
    "is_change": false,
    "create_time_stamp": "1767785325",
    "update_time_stamp": "1767785325",
    "expire_time_stamp": "0",
    "last_used_time_stamp": "0",
    "md5": "efc6bbed41993c078f85cd9231365544",
    "description": "Typically used in explanatory scenarios to tell the user the robot's current wake word",
    "tags": [],
    "scenes": [],
    "emoticon_extra_info": {
      "display_name": {
        "zh_CN": "Wake Word",
        "en_US": "Prompt words"
      },
      "emoticon_file_url": "default/emoticon/emoticon_prompt_words/emoticon.mp4",
      "thumbnail_file_url": "default/emoticon/emoticon_prompt_words/thumbnail.mp4",
      "cover_file_url": "default/emoticon/emoticon_prompt_words/cover.png"
    },
    "usagerights": [
      "Agent"
    ]
  }
}

  • The output content is consistent with the Get Resource List interface.
Example Scriptexamples/resource_manager/GetResource.py
Remarks

7.5.8 Export Resource

Interface Namepb:/aimdk.protocol.ResourceService/ResourceMigrationOut
OverviewExport resources
Interface Type HTTP JSON RPC
URLhttp://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/ResourceMigrationOut
Input
text
{
    "header": {
        "timestamp": {
            "seconds": "0",
            "nanos": 0,
            "ms_since_epoch": "1744598548952"
        },
        "control_source": 0
    },
    "resource_type": "RESOURCE_TYPE_EMOTICON",
    "resource_list": ["sample_resource"]
}
  • resource_list: Fill in the resource_name values of the resources to export. Multiple names can be provided at once, but they must belong to the same resource category. If not provided, all resources of that category are exported. resource_id is not supported here.
  • Only motion and emoticon resources can be exported.
Output
text
{
  "header": {
    "code": "0",
    "msg": "Resource migration out processing!",
    "trace_id": "",
    "domin": ""
  },
  "migration_type": "MIGRATION_TYPE_UNKNOWN",
  "task_id": "f3da3e78-1cb5-47ed-9c11-593030d2fe80"
}

  • The export file directory can be checked through the migration status interface and is usually under /agibot/data/resources/tmp.
  • If resource_list contains a resource that does not exist, the response returns "msg": "No resource found".
  • task_id: Used to query the migration file name through the migration status interface.
  • migration_type is currently unused.
Example Scriptexamples/resource_manager/ResourceMigrationOut.py
Remarks

7.5.9 Import Resource

Interface Namepb:/aimdk.protocol.ResourceService/ResourceMigrationIn
OverviewImport resources
Interface Type HTTP JSON RPC
URLhttp://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/ResourceMigrationIn
Input
text
{
    "header": {
        "timestamp": {
            "seconds": "0",
            "nanos": 0,
            "ms_since_epoch": "1744598548952"
        },
        "control_source": 0
    },
    "migration_file": {
        "file_url": "tmp/1767839589.gz"
    }
}
  • file_url: Located under /agibot/data/resources/tmp.
  • There is no type parameter.
Output
text
{
    "header": {
        "code": "0",
        "msg": "Resource migration task status get success",
        "trace_id": "",
        "domin": ""
    },
    "task_id":"23123123"
}

Example Scriptexamples/resource_manager/ResourceMigrationIn.py
Remarks

7.5.10 Migration Status

Interface Namepb:/aimdk.protocol.ResourceService/GetResourceMigrationTaskStatus
OverviewResource migration status
Interface Type HTTP JSON RPC
URLhttp://10.42.10.10:51049/rpc/aimdk.protocol.ResourceService/GetResourceMigrationTaskStatus
Input
text
{
    "header": {
        "timestamp": {
            "seconds": "0",
            "nanos": 0,
            "ms_since_epoch": "1744598548952"
        },
        "control_source": 0
    },
    "task_id": "65987072-f9e6-495f-99ed-df1a437fd337"
}
  • task_id: Obtained from the output of the resource export interface.
Output
text
{
    "header": {
        "code": "0",
        "msg": "Resource migration task status get success",
        "trace_id": "",
        "domin": ""
    },
    "status": "MIGRATION_TASK_STATUS_COMPLETED",
    "migration_file": {
        "file_url": "tmp/1765265387.gz",
        "client_md5": "ce857c64507b1d8c19cbfccb3bc9106b"
    }
}
  • file_url: Directory of the exported file, usually under /agibot/data/resources/tmp.
  • On x86, the exported file can be downloaded with wget http://10.42.10.10:64515/tmp/1769135144.gz.
Example Scriptexamples/resource_manager/GetResourceMigrationTaskStatus.py
Remarks