PDF
AGVC SDK  0.8.0
AGVC SDK

Overview

AGVC SDK provides a complete set of interfaces for controlling and managing AGV systems. Applications can communicate with AGV controllers through the AGVC API entry points to perform map management, path planning, motion control, charging, system status monitoring, and other operations.

Contents

  • Quick Start
  • SDK Architecture
  • Usage Examples
  • Namespace
  • Error Handling
  • Deprecated List
  • Supported Programming Languages

Quick Start

Basic Workflow

// 1. Initialize the AGV SDK client
auto rpc = std::make_shared<agvc_interface::RpcClient>();
// 2. Configure AGV communication
// 2.1 Set request timeout
rpc->setRequestTimeout(100);
// 2.2 Connect to the AGV
rpc->connect("192.168.192.100", 30104);
// 2.3 Log in
rpc->login("aa", "bb");
// 3. Use AGV interfaces
// 3.1 Query AGV details
rpc->getAgvDetails();
// 3.2 Get laser point cloud
rpc->getLaserPointCloud();

SDK Architecture

Module Structure

AGVC_API (main entry)
├── Map
├── Station
├── Path
├── Navigation
├── Charging
├── AgvInfo
└── System

Usage Examples

Get Robot Details

// Establish communication
auto rpc = std::make_shared<agvc_interface::RpcClient>();
rpc->setRequestTimeout(100);
rpc->connect("192.168.192.100", 30104);
rpc->login("aa", "bb");
// Get AGV details
auto agv_details = rpc->getAgvDetails();

Create a Map

// Acquire control priority
rpc->setPriority("aa", "");
// Switch to mapping mode
header.id = "123sdaw-asdafas-zff";
auto ret = rpc->changeRunningMode(mode, header);
// Query the execution status of the asynchronous changeRunningMode interface
agvc_interface::AsyncInterfaceResultStatus async_result = rpc->getAsyncInterfaceResultStatus();
// If the asynchronous interface is still running, keep querying until it finishes
while (change_running_mode_status == agvc_interface::ChangeRunningModeStatus::RUNNING)
{
change_running_mode_status = rpc->getAsyncInterfaceResultStatus().change_running_mode_status.status;
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
// Query the final result after the asynchronous operation finishes
ret = rpc->changeRunningMode(mode, header);
// Check the result
if (ret == 10100000) {
std::cout << "Mapping mode switched successfully";
} else {
std::cout << "Failed to switch mapping mode, error code: " << ret;
}
RunningMode
agv 运行模式
Definition type.h:80
@ MAPPING
建图模式
Definition type.h:83
FeedbackStatus ChangeRunningModeStatus
切换运行模式异步接口状态,调用接口 changeRunningMode 后的状态
Definition type.h:248
异步接口运行状态 暂时存在14个异步接口:saveMap, switchMap, changeRunningMode, relocation, sendBase64PngMapToAgv getGrid...
Definition type.h:620
ChangeModeWorkingStatus change_running_mode_status
切换运行模式(changeRunningMode)接口的执行状态
Definition type.h:624
ChangeRunningModeStatus status
接口changeRunningMode的运行状态 NONE -接口未执行 RUNNING-执行中,FINISH-执行结束
Definition type.h:509
头部信息
Definition type.h:426
std::string id
uuid
Definition type.h:427

Save a Map

// Acquire control priority
rpc->setPriority("aa", "");
// Configure map header
map_header.id = "test_save_map";
map_header.map_id = map_id;
map_header.name = "test1";
map_header.stamp = 1;
auto ret = rpc->saveMap(map_header);
// Query the execution status of the asynchronous saveMap interface
agvc_interface::AsyncInterfaceResultStatus async_result = rpc->getAsyncInterfaceResultStatus();
auto save_map_status = ret.save_map_status.status;
// If the asynchronous interface is still running, keep querying until it finishes
{
save_map_status = rpc->getAsyncInterfaceResultStatus().save_map_status.status;
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
// Query the final result after the asynchronous operation finishes
ret = rpc->saveMap(map_header);
// Check the result
if (ret == 10100000) {
std::cout << "Map saved successfully";
} else {
std::cout << "Failed to save map, error code: " << ret;
}
SaveMapWorkingStatus save_map_status
保存地图(saveMap)接口的执行状态
Definition type.h:622
int64_t stamp
时间戳,UTC时间(1970年01月01日00时00分00秒~至今),单位:纳秒
Definition type.h:429
std::string name
名称
Definition type.h:428
std::string map_id
当前地图的id,形式为uuid:例如a5e7c6de-4463-443e-8b25-ccbfd6a27aee, 与地图文件名字相同
Definition type.h:430
SaveMapStatus status
接口SaveMap的运行状态,NONE -接口未执行 RUNNING-执行中,FINISH-执行结束
Definition type.h:491

Namespace

All interfaces are defined in the following namespace:

namespace agvc_interface {
// Interface definitions
}

Error Handling

Most interface methods return integer error codes. 10100000 indicates success, while other values indicate specific errors that can be queried through the error-code interface. Some interfaces may throw AuboException exceptions.

Deprecated List

For deprecated APIs and fields, see Deprecated List.

Supported Programming Languages

  • C++
  • Python
  • JSON-RPC

Related Files