2.1 Status Codes and Common Types
Float32 / Float64
Header file: include/common.h
| Name | Definition |
|---|---|
Float32 | float |
Float64 | double |
STATUS_CODE
STATUS_CODE is the common SDK return value. This page lists only high-frequency status codes; the complete enum is defined by the SDK headers.
| Status Code | Value | Typical Scenario |
|---|---|---|
OK | 0 | Call succeeded |
CONNECTION_TIMEOUT | -3 | Network connection timed out |
INVALID_IP_ADDRESS | -17 | Arm::Connect() / SubPub::Connect() received an invalid IP |
FAILED_TO_DOWNLOAD_SAME_NAME_FILE | -21 | The target file already exists during download and overwriting=false |
FILE_NOTEXIST | -25 | Controller file does not exist |
INVALID_PARAMETER | -27 | Input parameter failed local validation |
NOT_FOUND | -28 | Target data was not found |
LOCAL_PROXY_UNSUPPORTED | -29 | Local proxy mode does not support the current input environment |
BUFFER_TOO_SMALL | -30 | C99 out buffer is too small |
NOT_CONNECTED | -35 | Connection has not been established or has already been disconnected |
SUB_PUB_RECEIVE_TIMEOUT | -37 | SubPub::Receive() did not receive a message before timeout |
CONTROLLER_ERROR | -254 | Controller returned an error |
OTHER_ERR | -255 | Generic failure fallback |
Reading Guidance
- C++17 query APIs usually return
std::pair<T, STATUS_CODE> - When
STATUS_CODE != OK, do not continue consuming the data value - Some APIs return a "failure data value + status code" pair, for example:
Info::GetSoftMode()returnsSoftModeEnum::UNKNOWNon failureInfo::GetOpMode()returnsOpModeEnum::UNKNOWNon failureSubPub::Receive()returns an emptyJson::Value+SUB_PUB_RECEIVE_TIMEOUTon timeout
RobotType
Header file: include/arm_api.h
| Enum | Value | Description |
|---|---|---|
RobotType::UNKNOWN | 0 | Unrecognized |
RobotType::COBOT | 1 | Collaborative robot |
RobotType::PUMA | 2 | PUMA robot |
RobotType::SCARA | 3 | SCARA robot |
Arm::Connect() fills the robotType field after a successful connection. Identification rules:
- Models containing
GBT-Care identified asCOBOT - Models containing
GBT-Sare identified asSCARA - Other recognized models are classified as
PUMAby default
Runtime Status Enums
| Header File | Type |
|---|---|
include/ctrl_status_enum.h | CtrlStatusEnum |
include/robot_status_enum.h | RobotStatusEnum |
include/servo_status_enum.h | ServoStatusEnum |
include/soft_mode_enum.h | SoftModeEnum |
include/op_mode_enum.h | OpModeEnum |
These enums are return types of ControllerInfo query APIs. They convert controller status codes into readable states; unrecognized values are mapped to the corresponding UNKNOWN item.
CtrlStatusEnum
Represents the motion-controller runtime state, corresponding to Info::GetCtrlStatus() .
| Enum | Value | Description |
|---|---|---|
CtrlStatusEnum::CTRL_INIT | 0 | Motion controller is initializing |
CtrlStatusEnum::CTRL_ENGAGED | 1 | Motion controller is engaged |
CtrlStatusEnum::CTRL_ESTOP | 2 | Motion controller is in emergency stop |
CtrlStatusEnum::CTRL_TERMINATED | 3 | Motion controller is terminated |
CtrlStatusEnum::CTRL_ANY_TO_ESTOP | 101 | Intermediate state: another state is switching to emergency stop |
CtrlStatusEnum::CTRL_ESTOP_TO_ENGAGED | 102 | Intermediate state: emergency stop is switching to engaged |
CtrlStatusEnum::CTRL_ESTOP_TO_TERMINATED | 103 | Intermediate state: emergency stop is switching to terminated |
CtrlStatusEnum::CTRL_UNKNOWN | -1 | Unknown state |
RobotStatusEnum
Represents the robot body runtime state, corresponding to Info::GetRobotStatus() .
| Enum | Value | Description |
|---|---|---|
RobotStatusEnum::ROBOT_IDLE | 0 | Robot is idle |
RobotStatusEnum::ROBOT_RUNNING | 1 | Robot is running |
RobotStatusEnum::ROBOT_TEACHING | 2 | Robot is in teach mode |
RobotStatusEnum::ROBOT_DRAG | 3 | Robot is in drag mode |
RobotStatusEnum::ROBOT_FORCE_DRAG | 4 | Robot is in force-drag mode |
RobotStatusEnum::ROBOT_IDLE_TO_RUNNING | 101 | Intermediate state: idle is switching to running |
RobotStatusEnum::ROBOT_IDLE_TO_TEACHING | 102 | Intermediate state: idle is switching to teach mode |
RobotStatusEnum::ROBOT_RUNNING_TO_IDLE | 103 | Intermediate state: running is switching to idle |
RobotStatusEnum::ROBOT_TEACHING_TO_IDLE | 104 | Intermediate state: teach mode is switching to idle |
RobotStatusEnum::ROBOT_UNKNOWN | -1 | Unknown state |
ServoStatusEnum
Represents servo status, corresponding to Info::GetServoStatus() .
| Enum | Value | Description |
|---|---|---|
ServoStatusEnum::SERVO_IDLE | 1 | Servo is idle |
ServoStatusEnum::SERVO_RUNNING | 2 | Servo is running |
ServoStatusEnum::SERVO_DISABLE | 3 | Servo is disabled |
ServoStatusEnum::SERVO_WAIT_READY | 4 | Servo is waiting to become ready |
ServoStatusEnum::SERVO_WAIT_DOWN | 5 | Servo is waiting to power down |
ServoStatusEnum::SERVO_INIT | 10 | Servo is initializing |
ServoStatusEnum::SERVO_UNKNOWN | -1 | Unknown state |
SoftModeEnum
Represents controller soft_op_mode , corresponding to Info::GetSoftMode() / Info::SetSoftMode() .
| Enum | Value | Description |
|---|---|---|
SoftModeEnum::UNKNOWN | 0 | Unknown mode |
SoftModeEnum::AUTO | 1 | Automatic mode |
SoftModeEnum::MANUAL_LIMIT | 2 | Manual limited-speed mode |
SoftModeEnum::MANUAL | 3 | Manual mode |
OpModeEnum
Represents controller user_op_mode , corresponding to Info::GetOpMode() / Info::SetOpMode() .
| Enum | Value | Description |
|---|---|---|
OpModeEnum::UNKNOWN | 0 | Unknown operation mode |
OpModeEnum::AUTO | 1 | Automatic operation mode |
OpModeEnum::MANUAL_LIMIT | 2 | Manual limited-speed operation mode |
OpModeEnum::MANUAL | 3 | Manual operation mode |
LanguageType / RobotAlarm
Header file: include/alarm_types.h
LanguageType
LanguageType selects the language returned by alarm queries and is currently used by Alarm::GetAllActiveAlarms() . The SDK converts the enum into the alarm service's language parameter: Chinese is cn , English is en .
| Enum Value | Value | Description |
|---|---|---|
LanguageType::Chinese | 0 | Request Chinese alarm descriptions |
LanguageType::English | 1 | Request English alarm descriptions |
RobotAlarm
RobotAlarm is the alarm detail structure. Alarm::GetAllActiveAlarms() returns std::vector<RobotAlarm> , while Alarm::GetTopAlarm() returns a single RobotAlarm . If there is no active alarm, the string fields in the returned structure are usually empty.
| Field | Meaning |
|---|---|
user_code | User-side alarm code |
inner_code | Controller-side alarm code |
name | Alarm name |
reason | Reason |
suggest | Suggested handling |
consequence | Impact |
ext_desc | Extended description |
SignalType / SignalValue
Header file: include/signal_types.h
SignalType
SignalType distinguishes the IO types currently supported by the SDK. It covers digital signals, group signals, remote-control signals, wrist IO, and analog signals, so Signals can use one unified entry point to express "which IO type to read" and "which IO type to write".
| Enum | Value | Type | Description |
|---|---|---|---|
DI | 1 | Digital input | Digital Input |
DO | 2 | Digital output | Digital Output |
UI | 3 | Dedicated input | User Input |
UO | 4 | Dedicated output | User Output |
RI | 5 | Remote input | Remote Input |
RO | 6 | Remote output | Remote Output |
GI | 7 | Group input | Group Input |
GO | 8 | Group output | Group Output |
TAI | 9 | Wrist analog input | Tool Analog Input |
TDI | 10 | Wrist digital input | Tool Digital Input |
TDO | 11 | Wrist digital output | Tool Digital Output |
AI | 12 | Analog input | Analog Input |
AO | 13 | Analog output | Analog Output |
SDK Usage Scope
Signals::Read()supports allSignalTypevalues listed above.Signals::Write(type, index, int32_t value)supports onlyDO,RO,GO, andTDO.Signals::Write(type, index, Float64 value)supports onlyAO.Signals::MultiRead()/MultiWrite()support onlyDO.- Port numbers passed to
Signalsfollow controller-side numbering.
SignalValue
SignalValue provides readable constants for digital writes, so callers do not have to pass raw 0 or 1 values. For example, when writing DO, SignalValue::ON means set and SignalValue::OFF means reset.
| Constant | Value | Description |
|---|---|---|
SignalValue::OFF | 0 | Off, reset, or low level |
SignalValue::ON | 1 | On, set, or high level |