Skip to content

AGVC Python SDK User Function Interface and Data Structure Specification Document

Version information

  • Version number: 0.1.0
  • Date of issue: August 25, 2025

1 Introduction

This document provides developers with detailed descriptions of the interfaces and data structures for the AGVC Python SDK. With this document, developers can learn how to call the functional modules of AGVC, including setting the system time, managing stations and paths, operating maps, and controlling AGV operating modes. This document is intended for all developers who use the AGVC Python SDK for AGV development and integration.

2. Data types

2.1 Enumerations

2.1.1 Running mode enumeration type: RunningMode

RunningMode is used to indicate the current running mode of the AGV.

Running modeValueDescription
NONE0-
START1Start mode.
MAPPING2Mapping mode.
NAVIGATE3Navigation mode.
CHARGING4Automatic charging mode.
MAINTAIN5Maintenance mode.
STOP6Stop mode.

2.1.2 Path shape enumeration type: PathShape

PathShape is used to indicate the shape of the AGV travel path.

Path shapeValueDescription
NONE0-
LINE1Straight line.
ARC2Arc.
BEZIER3Bezier curve.

2.1.3 Map format enumeration type: MapFormat

MapFormat is used to indicate the storage format of the map.

Map formatValueDescription
NONE0-
OCCUPANCY_GRID1Occupancy grid map.
BASE64_PNG2Base64-encoded PNG map.

2.1.4 Virtual area enumeration type: MapVirtualAreaType

MapVirtualAreaType is used to indicate the type of virtual area in the map.

Virtual area typeValueDescription
NONE0-
OBSTACLE1Virtual wall.
SLOW_DOWN2Deceleration zone.
INFLATE3Inflation zone.

2.1.5 Virtual area shape enumeration: MapVirtualAreaShape

MapVirtualAreaShape is used to indicate the geometry of a virtual area in the map.

ShapeValueDescription
NONE0-
LINE1Straight line.
ARC2Arc.
CIRCLE3Circle.
POLYGON4Polygon.

2.1.6 AGV navigation enumeration type: NavType

NavType is used to indicate the navigation type of an AGV.

Navigation typeValueDescription
NONE0-
FREE_TO_POSE1Free navigation to any point.
FREE_TO_STATION2Free navigation to a station.
PATH_TO_STATION3Path navigation to a station.

2.1.7 Automatic charging enumeration type: AutoChargingType

AutoChargingType is used to indicate the automatic charging type of an AGV.

Charging typeValueDescription
NONE0-
LOW_POWER_TO_BOARD1Automatic docking when the battery level is low (determined by a preset threshold).
HIGH_POWER_LEAVE_BOARD2Automatic undocking when the battery level is high (determined by a preset threshold).
FORCE_TO_BOARD3Forced automatic docking (regardless of battery level and threshold).
FORCE_LEAVE_BOARD4Forced automatic undocking (regardless of battery level and threshold).

2.1.8 Operation feedback enumeration type: FeedbackStatus

FeedbackStatus is used to indicate the feedback status after an operation is executed.

Status typeValueDescription
NONE0-
FINISHED1Succeeded.
FAILED2Failed.
RUNNING3Running.
PAUSED4Paused.
CANCELED5Canceled.

2.1.9 Firmware update operation enumeration: FirmwareUpdateMode

FirmwareUpdateMode is used to indicate the update configuration for the module firmware.

Configuration typeValueDescription
NONE0Firmware not updated by default.
UPDATE1Update firmware.
FORCED_UPDATE2Forced update of firmware.
NOT_UPDATE3Not update firmware.

2.1.10 Script runtime state enumeration: ScriptRuntimeState

ScriptRuntimeState is used to indicate the runtime state of a script.

StatusValueDescription
RUNNING0Running.
PAUSED1Paused.
STOPPED2Stopped.
ABORTING3Aborting.

2.1.11 Calibration type enumeration: CalibrationType

CalibrationType is used to indicate the calibration type of an AGV.

TypeValueDescription
NONE0-
LASER_ODOM1Laser-odometer calibration.

2.1.12 AGV navigation state enumeration: NavStatus

NavStatus is an alias for FeedbackStatus and is used to indicate the navigation state of an AGV.

Status typeValueDescription
NONE0-
FINISHED1Navigation finished.
FAILED2Navigation failed.
RUNNING3Navigation running.
PAUSED4Navigation paused.
CANCELED5Navigation canceled.

2.1.13 Save Map asynchronous interface status: SaveMapStatus

SaveMapStatus is an alias for FeedbackStatus and is used to indicate the Save Map interface status.

Status typeValueDescription
NONE0Save Map interface not running.
FINISHED1Save Map interface running finished.
FAILED2Invalid value.
RUNNING3Map being saved.
PAUSED4Invalid value.
CANCELED5Invalid value.

2.1.14 Switch Map asynchronous interface status: SwitchMapStatus

SwitchMapStatus is an alias for FeedbackStatus and is used to indicate the Switch Map interface status.

Status typeValueDescription
NONE0Switch Map interface not running.
FINISHED1Switch Map interface running finished.
FAILED2Invalid value.
RUNNING3Map being switched.
PAUSED4Invalid value.
CANCELED5Invalid value.

2.1.15 Change Running Mode asynchronous interface status: ChangeRunningModeStatus

ChangeRunningModeStatus is an alias for FeedbackStatus and indicates the Change Running Mode interface status.

Status typeValueDescription
NONE0Change Running Mode interface not running.
FINISHED1Change Running Mode interface running finished.
FAILED2Invalid value.
RUNNING3Running mode being changed.
PAUSED4Invalid value.
CANCELED5Invalid value.

2.1.16 Relocation status: RelocationStatus

RelocationStatus is an alias for FeedbackStatus and indicates the Relocation interface status.

Status typeValueDescription
NONE0Relocation interface not running.
FINISHED1Relocation interface running finished.
FAILED2Invalid value.
RUNNING3Relocating.
PAUSED4Invalid value.
CANCELED5Invalid value.

2.1.17 Upload Png Map Information interface status: SetPngMapAllInfoStatus

SetPngMapAllInfoStatus is an alias for FeedbackStatus and indicates the Upload All Png Map Information interface status.

Status typeValueDescription
NONE0Set Map Information interface not running.
FINISHED1Set Map Information interface running finished.
FAILED2Invalid value.
RUNNING3Map information being uploaded.
PAUSED4Invalid value.
CANCELED5Invalid value.

2.1.18 Get Png Map Information interface status: GetPngMapAllInfoStatus

GetPngMapAllInfoStatus is an alias for FeedbackStatus and indicates the Get All Png Map Information interface status.

Status typeValueDescription
NONE0Get Png Map Information interface not running.
FINISHED1Get Png Map Information interface running finished.
FAILED2Invalid value.
RUNNING3Png map information being got.
PAUSED4Invalid value.
CANCELED5Invalid value.

2.1.19 Get Grid Map interface status: GetGridMapStatus

GetGridMapStatus is an alias for FeedbackStatus and indicates the Get Grid Map interface status.

Status typeValueDescription
NONE0Get Grid Map interface not running.
FINISHED1Get Grid Map interface running finished.
FAILED2Invalid value.
RUNNING3Grid map being got.
PAUSED4Invalid value.
CANCELED5Invalid value.

2.1.20 Send Grid Map interface status: SendGridMapStatus

SendGridMapStatus is an alias for FeedbackStatus and indicates the Send Grid Map interface status.

Status typeValueDescription
NONE0Send Grid Map interface not running.
FINISHED1Send Grid Map interface running finished.
FAILED2Invalid value.
RUNNING3Grid map being sent.
PAUSED4Invalid value.
CANCELED5Invalid value.

2.1.21 Get Png Map interface status: GetPngMapStatus

GetPngMapStatus is an alias for FeedbackStatus and indicates the Get Png Map interface status.

Status typeValueDescription
NONE0Get Png Map interface not running.
FINISHED1Get Png Map interface running finished.
FAILED2Invalid value.
RUNNING3Png map being got.
PAUSED4Invalid value.
CANCELED5Invalid value.

2.1.22 Send Png Map interface status: SendPngMapStatus

SendPngMapStatus is an alias for FeedbackStatus and indicates the Send Png Map interface status.

Status typeValueDescription
NONE0Send Png Map interface status not running.
FINISHED1Send Png Map interface status running finished.
FAILED2Invalid value.
RUNNING3Png map being sent.
PAUSED4Invalid value.
CANCELED5Invalid value.

2.1.23 Set Grid Map Information interface status: SetGridMapAllInfoStatus

SetGridMapAllInfoStatus is an alias for FeedbackStatus and indicates the Set All Grid Map Information interface status.

Status typeValueDescription
NONE0Send All Grid Map Information interface not running.
FINISHED1Send All Grid Map Information interface running finished.
FAILED2Invalid value.
RUNNING3All grid map information being sent.
PAUSED4Invalid value.
CANCELED5Invalid value.

2.1.24 Get Grid Map Information interface status: GetGridMapAllInfoStatus

GetGridMapAllInfoStatus is an alias for FeedbackStatus and indicates the Get All Grid Map Information interface status.

Status typeValueDescription
NONE0Get All Grid Map Information interface not running.
FINISHED1Get All Grid Map Information interface running finished.
FAILED2Invalid value.
RUNNING3All grid map information being got.
PAUSED4Invalid value.
CANCELED5Invalid value.

2.1.25 Calibration status enumeration: CalibrationStatus

CalibrationStatus is an alias for FeedbackStatus and indicates the Calibration interface status.

Status typeValueDescription
NONE0-
FINISHED1Calibration finished.
FAILED2Calibration failed.
RUNNING3Collecting data.
PAUSED4Invalid value.
CANCELED5Calibration canceled.

2.2 Structure

2.2.1 2D point structure: Point2d

Attribute nameTypeDescription
xfloatUnit m
yfloatUnit m

2.2.2 2D pose structure: Pose2d

Attribute nameTypeDescription
xdoubleUnit m
ydoubleUnit m
yawdoubleUnit rad

2.2.3 Speed structure: Speed

Attribute nameTypeDescription
vdoubleUnit m
wdoubleUnit rad/s

2.2.4 Header information structure: Header

Attribute nameTypeDescription
idstrUniversally unique identifier (UUID).
namestrName.
stampint64Timestamp (UTC time, unit: ns).
map_idstrCurrent map ID.
error_codeintError code (-1 by default).

2.2.5 AGV information structure: AgvDetails

Attribute nameTypeDescription
namestrAGV name.
versionstrVersion number of the current control program.
MFDstrManufacture date.
SNstrSerial number.
communication_versionintbridge Version information.
battery_versionintBattery version information.
loop_timesintBattery cycle count.
surplus_capacityfloatRemaining battery capacity.
left_motor_firmware_versionintLeft motor firmware version.
right_motor_firmware_versionintRight motor firmware version.
master_board_firmware_versionintInterface board firmware version information.
hardware_abstraction_versionintHardware abstraction layer version information.
error_code_versionintError code version.
max_speedfloatMaximum linear speed allowed for the AGV.
max_angularfloatMaximum angular speed allowed for the AGV.

2.2.6 AGV running information structure: RunningInfo

Attribute nameTypeDescription
headerHeaderAGV's SN, name, current time, and map ID.
running_modeRunningModeCurrent running mode of the AGV.
current_speedSpeedCurrent driving speed {v w}, in {m/s rad/s}.
location_scoreint8Current location score, [0-100].
total_distdoubleTotal distance traveled, in m.
current_distdoubleDistance traveled in the current session, in m.
total_running_timedoubleTotal running time, in s.
current_running_timedoubleRunning time of the current session, in s.
battery_voltagedoubleBattery voltage, in V.
battery_currentdoubleBattery current, in A.
remaining_voltageint8Remaining battery level, in percentage (%), [0-100].
battery_statusint8Battery status: 0- None, 1- Discharging, 2- Charging, 3- Fully charged, 4- Charging urgently needed.
safety_edge_statusint8Safety edge status: 0- None, 1- Front-left collision, 2- Front-right collision, 3- Rear-left collision, 4- Rear-right collision.
low_batteryboolWhether the battery level is low.
pauseboolWhether the AGV is in a paused state.
emergency_stopboolWhether the AGV is in an emergency stop state.
blockedboolWhether the AGV is blocked by an obstacle.
localization_lossboolWhether localization is lost.
fault_alarmboolFault alarm (motor fault, sensor fault, battery fault). For detailed fault information, see the log.

2.2.7 Save Map asynchronous interface status structure: SaveMapWorkingStatus

Attribute nameTypeDescription
headerHeaderheader.id represents the ID of the issued saveMap command.
statusSaveMapStatusRunning status of the SaveMap interface: NONE- Not running, RUNNING- Running, FINISH- Finished.

2.2.8 Switch Map asynchronous interface status structure: SwitchMapWorkingStatus

Attribute nameTypeDescription
headerHeaderheader.id represents the ID of the issued switchMap command.
statusSwitchMapStatusRunning status of the switchMap interface: NONE- Not running, RUNNING- Running, FINISH- Finished.

2.2.9 Change Running Mode asynchronous interface status structure: ChangeModeWorkingStatus

Attribute nameTypeDescription
headerHeaderheader.id represents the ID of the issued changeRunningMode command.
statusChangeRunningModeStatusRunning status of the changeRunningMode interface: NONE- Not running, RUNNING- Running, FINISH- Finished.

2.2.10 Relocation asynchronous interface status structure: RelocationWorkingStatus

Attribute nameTypeDescription
headerHeaderheader.id represents the ID of the issued Relocation command.
statusRelocationStatusRunning status of the Relocation interface: NONE- Not running, RUNNING- Running, FINISH- Finished.

2.2.11 Set Png Map Information asynchronous interface status structure: SetPngMapAllInfoWorkingStatus

Attribute nameTypeDescription
headerHeaderheader.id represents the ID of the issued setPngMapAllInfo command.
statusSetPngMapAllInfoStatusRunning status of the setPngMapAllInfo interface: NONE- Not running, RUNNING- Running, FINISH- Finished.

2.2.12 Get Png Map Information asynchronous interface status structure: GetPngMapAllInfoWorkingStatus

Attribute nameTypeDescription
headerHeaderheader.id represents the ID of the issued getPngMapAllInfo command.
statusGetPngMapAllInfoStatusRunning status of the getPngMapAllInfo interface: NONE- Not running, RUNNING- Running, FINISH- Finished.

2.2.13 Get Grid Map asynchronous interface status structure: GetGridMapWorkingStatus

Attribute nameTypeDescription
headerHeaderheader.id represents the ID of the issued getGridMapFromAgv command.
statusGetGridMapStatusRunning status of the getGridMapFromAgv interface: NONE- Not running, RUNNING- Running, FINISH- Finished.

2.2.14 Send Grid Map asynchronous interface status structure: SendGridMapWorkingStatus

Attribute nameTypeDescription
headerHeaderheader.id represents the ID of the issued sendGridMapToAgv command.
statusSendGridMapStatusRunning status of the sendGridMapToAgv interface: NONE- Not running, RUNNING- Running, FINISH- Finished.

2.2.15 Get Png Map asynchronous interface status structure: GetPngMapWorkingStatus

Attribute nameTypeDescription
headerHeaderheader.id represents the ID of the issued getBase64PngMapFromAgv command.
statusGetPngMapStatusRunning status of the getBase64PngMapFromAgv interface: NONE- Not running, RUNNING- Running, FINISH- Finished.

2.2.16 Send Png Map asynchronous interface status structure: SendPngMapWorkingStatus

Attribute nameTypeDescription
headerHeaderheader.id represents the ID of the issued sendBase64PngMapToAgv command.
statusSendPngMapStatusRunning status of the sendBase64PngMapToAgv interface: NONE- Not running, RUNNING- Running, FINISH- Finished.

2.2.17 Set Grid Map Information asynchronous interface status structure: SetGridMapAllInfoWorkingStatus

Attribute nameTypeDescription
headerHeaderheader.id represents the ID of the issued setGridMapAllInfo command.
statusSetGridMapAllInfoStatusRunning status of the setGridMapAllInfo interface: NONE- Not running, RUNNING- Running, FINISH- Finished.

2.2.18 Get Grid Map Information asynchronous interface status structure: GetGridMapAllInfoWorkingStatus

Attribute nameTypeDescription
headerHeaderheader.id represents the ID of the issued getGridMapAllInfo command.
statusGetGridMapAllInfoStatusRunning status of the getGridMapAllInfo interface: NONE- Not running, RUNNING- Running, FINISH- Finished.

2.2.19 Asynchronous interface running status structure: AsyncInterfaceResultStatus

Attribute nameTypeDescription
headerHeaderAGV's SN, name, current time, and map ID.
save_map_statusSaveMapWorkingStatusRunning status of the saveMap interface.
switch_map_statusSwitchMapWorkingStatusExecution status of the switch map (switchMap) interface.
change_running_mode_statusChangeModeWorkingStatusRunning status of the changeRunningMode interface.
relocation_statusRelocationWorkingStatusRunning status of the relocation interface.
get_grid_map_statusGetGridMapWorkingStatusRunning status of the getGridMapFromAgv interface.
send_grid_map_statusSendGridMapWorkingStatusRunning status of the sendGridMapToAgv interface.
get_png_map_statusGetPngMapWorkingStatusRunning status of the getBase64PngMapFromAgv interface.
send_png_map_statusSendPngMapWorkingStatusRunning status of the sendBase64PngMapToAgv interface.
set_png_all_statusSetPngMapAllInfoWorkingStatusRunning status of the setPngMapAllInfo interface.
get_png_all_statusGetPngMapAllInfoWorkingStatusRunning status of the getPngMapAllInfo interface.
set_grid_all_statusSetGridMapAllInfoWorkingStatusRunning status of the setGridMapAllInfo interface.
get_grid_all_statusGetGridMapAllInfoWorkingStatusRunning status of the getGridMapAllInfo interface.

3. Function interfaces

3.1.1 Set log handler

python
def setLogHandler(handler: callable)

Parameters:

  • handler callable: A user-defined log handling function, defined as follows:
python
def handler(level: int, filename: str, line: int, message: str)
  • level int: Log level, value range:
    • 0: FATAL (Critical Error)
    • 1: ERROR (Error)
    • 2: WARNING (Warning)
    • 3: INFO (Information)
    • 4: DEBUG (Debugging)
    • 5: BACKTRACE (Trace)
  • filename str: File name
  • line int: Code line number
  • message str: Log message

Return value:

  • None

Description:

  • This function allows you to customize the log handling logic, overriding the default log handling method.

3.1.2 Connect to the RPC service

python
def connect(ip: str = "", port: int = 0) -> int

Parameters:

  • ip str, optional: IP address of the RPC service, which is an empty string by default, indicating the use of a Unix domain socket.
  • port int, optional: Port number of the RPC service, which is 0 by default, indicating the use of a Unix domain socket.

Return value:

  • int: Connection result code:
    • 0: Connected successfully
    • -8: Connection failed, RPC connection refused
    • -15: Connection failed, SDK version incompatible with the server version

Description:

  • Connect to the specified RPC service. If both ip and port are empty, a Unix domain socket is used for communication.

3.1.3 Disconnect from the RPC service

python
def disconnect() -> int

Parameters:

  • None

Return value:

  • int: Operation result code:
    • 0: Disconnected successfully
    • -1: Disconnection failed

Description:

  • Disconnect from the RPC service.

3.1.4 Check if connected to the RPC service

python
def hasConnected() -> bool

Parameters:

  • None

Return value:

  • bool: Whether it is connected to the RPC service.
    • True: Connected
    • False: Not connected

Description:

  • Check whether it is currently connected to the RPC service.

3.1.5 Log in to the RPC service

python
def login(usrname: str, passwd: str) -> int

Parameters:

  • usrname str: User name
  • passwd str: Password

Return value:

  • int: Login result code:
    • 0: Logged in successfully

Description:

  • Log in to the RPC service with the specified user name and password.

3.1.6 Log out of the RPC service

python
def logout() -> int

Parameters:

  • None

Return value:

  • int: Logout result code:
    • 0: Logged out successfully

Description:

  • Log out of the RPC service.

3.1.7 Check if logged in

python
def hasLogined() -> bool

Parameters:

  • None

Return value:

  • bool: Whether it is logged in.
    • True: Logged in
    • False: Not logged in

Description:

  • Check whether it is currently logged in to the RPC service.

3.1.8 Set the RPC request timeout

python
def setRequestTimeout(timeout: int = 10) -> int

Parameters:

  • timeout int, optional: Request timeout in milliseconds, which is 10 by default.

Return value:

  • int: Setting result code:
    • 0: Set successfully

Description:

  • Set the timeout for RPC requests.

3.1.9 Set event handling

python
def setEventHandler(cb: callable) -> int

Parameters:

  • cb callable: Event handling function, defined as follows:
python
def cb(event: int)
  • event int: Event type, value range:
    • 0: Connected
    • 1: Disconnected

Return value:

  • int: Setting result code:
    • 0: Set successfully

Description:

  • Set the event handling function to process events for the RPC connection. When an event occurs, the registered callback function is automatically called and the corresponding event type parameter is passed in.

Note:

  • If a Python exception is thrown during the execution of the callback function, it will be caught and output to the standard error stream, but it will not affect the execution of the main program.
  • The framework automatically handles the Python Global Interpreter Lock (GIL) to ensure thread safety.
  • The callback function should be kept as lightweight as possible to avoid long-term blocking that could affect the efficiency of event handling.

3.1.10 Set exception throwing

python
def setExceptionFree(enable: bool) -> int

Parameters:

  • enable bool: Whether to enable exception throwing.

Return value:

  • int: Setting result code:
    • 0: Set successfully

Description:

  • Set whether to throw an exception when it occurs.

3.1.11 Get error code

python
def errorCode() -> int

Parameters:

  • None

Return value:

  • int: Error code of the last operation.

Description:

  • Get the error code of the last operation.

3.2.1 Set AGV system time

python
def set_system_clock(stamp: str) -> int

Parameters:

  • stamp str: Timestamp string in the format YYYY-MM-DDTHH:mm:ss.ssZ, for example, "2017-04-15T11:40:03.12Z".

Return value:

  • int: Setting result code:
    • 0: Set successfully
    • Others: Error code

Description:

  • Set the system clock of the AGV.

3.2.2 Get AGV details

python
def get_agv_details() -> AgvDetails

Parameters:

  • None

Return value:

  • AgvDetails(dict): A dictionary containing the detailed information of the AGV.

Description:

  • Query the detailed information of the AGV, including its name, version, and production date.

3.2.3 Get AGV running information

python
def get_running_info() -> RunningInfo

Parameters:

  • None

Return value:

  • RunningInfo(dict): A dictionary containing the running information of the AGV.

Description:

  • Query the detailed information of the AGV, including its running speed, battery level, and localization score.

3.2.4 Get current pose of AGV

python
def get_agv_current_pose() -> Pose2d

Parameters:

  • None

Return value:

  • Pose2d(dict): A dictionary containing the current pose of the AGV.

Description:

  • Query the current pose of the AGV, including its position and attitude.

3.2.5 Get current lidar point cloud data

python
def get_laser_point_cloud() -> list<Point2d>

Parameters:

  • None

Return value:

  • Point2dlist: A list containing the current lidar point cloud data.

Description:

  • Query the current lidar point cloud data.

3.2.6 Get the running status of asynchronous interfaces

python
def get_async_interface_result_status() -> AsyncInterfaceResultStatus

Parameters:

  • None

Return value:

  • AsyncInterfaceResultStatus: Containing the running status of all asynchronous interfaces.

Description:

  • Querying the running status of an asynchronous interface does not represent the running result of the interface itself.

3.2.7 Get all station information

python
def get_all_stations() -> list<StationMark>

Parameters:

  • None

Return value:

  • list[StationMark]: A list containing information of all stations. Each element is a StationMark type station object.