AUBO SDK  0.26.0
Loading...
Searching...
No Matches
error_stack.h File Reference

汇总错误码 More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <string>
#include <sstream>
#include <iomanip>
#include <aubo/global_config.h>
#include <aubo/error_stack/hal_error.h>
#include <aubo/error_stack/rtm_error.h>
#include <aubo/error_stack/system_error.h>
Include dependency graph for error_stack.h:

Go to the source code of this file.

Namespaces

namespace  arcs
namespace  arcs::error_stack

Macros

#define _PH1_   "{}"
#define _PH2_   "{}"
#define _PH3_   "{}"
#define _PH4_   "{}"
#define AUBO_SDK_HAL_ERROR_H
#define JOINT_ERRORS
#define TOOL_ERRORS
#define PEDSTRAL_ERRORS
#define SAFETY_INTERFACE_BOARD_ERRORS
#define HARDWARE_INTERFACE_ERRORS
#define HAL_ERRORS
#define AUBO_SDK_RTM_ERROR_H
#define RTM_ERRORS
#define AUBO_SDK_SYSTEM_ERROR_H
#define SYSTEM_ERRORS
#define ARCS_ERROR_CODES
#define _D(n, v, s, r)
#define _D(n, v, s, r)
#define _D(n, v, s, r)
#define _D(n, v, s, r)
#define _D(n, v, s, r)
#define _D(n, v, s, r)

Enumerations

enum  arcs::error_stack::ErrorCodes { arcs::error_stack::ARCS_ERROR_CODES }

Functions

constexpr int ARCS_ABI_EXPORT arcs::error_stack::codeCompose (int aa, int bb, int cccc)
constexpr int ARCS_ABI_EXPORT arcs::error_stack::mod (int x)
int arcs::error_stack::str2ErrorCode (const char *err_code_name)
const char * arcs::error_stack::errorCode2Str (int err_code)
std::ostream & arcs::error_stack::dump (std::ostream &os)

Detailed Description

汇总错误码

Definition in file error_stack.h.

Macro Definition Documentation

◆ _D [1/6]

#define _D ( n,
v,
s,
r )
Value:
os << std::setw(20) << #n << "\t" << v << "\t" << s << "\t" << r \
<< std::endl;

Definition at line 54 of file error_stack.h.

◆ _D [2/6]

#define _D ( n,
v,
s,
r )
Value:
if (err_code == v) \
index = n##_INDEX;

Definition at line 54 of file error_stack.h.

◆ _D [3/6]

#define _D ( n,
v,
s,
r )
Value:
n##_INDEX,

Definition at line 54 of file error_stack.h.

◆ _D [4/6]

#define _D ( n,
v,
s,
r )
Value:
s,

Definition at line 54 of file error_stack.h.

◆ _D [5/6]

#define _D ( n,
v,
s,
r )
Value:
if (strcmp(#n, err_code_name) == 0) \
return v;

Definition at line 54 of file error_stack.h.

◆ _D [6/6]

#define _D ( n,
v,
s,
r )
Value:
n = (int)v,

Definition at line 54 of file error_stack.h.

◆ _PH1_

#define _PH1_   "{}"

Definition at line 18 of file error_stack.h.

◆ _PH2_

#define _PH2_   "{}"

Definition at line 19 of file error_stack.h.

◆ _PH3_

#define _PH3_   "{}"

Definition at line 20 of file error_stack.h.

◆ _PH4_

#define _PH4_   "{}"

Definition at line 21 of file error_stack.h.

◆ ARCS_ERROR_CODES

#define ARCS_ERROR_CODES
Value:
SYSTEM_ERRORS \
JOINT_ERRORS \
SAFETY_INTERFACE_BOARD_ERRORS \
RTM_ERRORS \
TOOL_ERRORS \
PEDSTRAL_ERRORS \
HARDWARE_INTERFACE_ERRORS \
_D(ARCS_MAX_ERROR_CODE, -1, "Max error code", "suggest...")

Definition at line 41 of file error_stack.h.

◆ AUBO_SDK_HAL_ERROR_H

#define AUBO_SDK_HAL_ERROR_H

Definition at line 6 of file error_stack.h.

◆ AUBO_SDK_RTM_ERROR_H

#define AUBO_SDK_RTM_ERROR_H

Definition at line 6 of file error_stack.h.

◆ AUBO_SDK_SYSTEM_ERROR_H

#define AUBO_SDK_SYSTEM_ERROR_H

Definition at line 6 of file error_stack.h.

◆ HAL_ERRORS

#define HAL_ERRORS
Value:
JOINT_ERRORS \
SAFETY_INTERFACE_BOARD_ERRORS \
TOOL_ERRORS \
PEDSTRAL_ERRORS \
HARDWARE_INTERFACE_ERRORS

◆ HARDWARE_INTERFACE_ERRORS

#define HARDWARE_INTERFACE_ERRORS

◆ JOINT_ERRORS

#define JOINT_ERRORS

◆ PEDSTRAL_ERRORS

#define PEDSTRAL_ERRORS
Value:
_D(PKG_LOST, 50001, "Lost package from pedestal", "suggest...") \
_D(PEDSTRAL_OFFLINE, 50002, "pedestal error: pedestal may be offline", "(a) Check pedestal's hardware. (b) Check pedestal's id.") \
_D(PEDESTAL_ERR_BOOTLOADER, 50003, "pedestal error: The pedestal is in bootloader mode. Retry firmware update. ", "suggest...")
#define _D(n, v, s, r)
Definition error_stack.h:54

◆ RTM_ERRORS

#define RTM_ERRORS

◆ SAFETY_INTERFACE_BOARD_ERRORS

#define SAFETY_INTERFACE_BOARD_ERRORS
Value:
_D(IFB_ERR_ROBOTTYPE, 20001, "Robot error type!", "suggest...") \
_D(IFB_ERR_ADXL_SENS, 20002, "Acceleration sensor error!", "suggest...") \
_D(IFB_ERR_EN_LINE, 20003, "Encoder line error!", "suggest...") \
_D(IFB_ERR_ENTER_HDG_MODE, 20004, "Robot enter handguide mode!", "suggest...") \
_D(IFB_ERR_EXIT_HDG_MODE, 20005, "Robot exit handguide mode!", "suggest...") \
_D(IFB_ERR_MAC_DATA_BREAK, 20006, "MAC data break!", "suggest...") \
_D(IFB_ERR_DRV_FIRMWARE_VERSION, 20007, "Motor driver firmware version error!", "suggest...") \
_D(INIT_ERR_EN_DRV, 20008, "Motor driver enable failed!", "suggest...") \
_D(INIT_ERR_EN_AUTO_BACK, 20009, "Motor driver enable auto back failed!", "suggest...") \
_D(INIT_ERR_EN_CUR_LOOP, 20010, "Motor driver enable current loop failed!", "suggest...") \
_D(INIT_ERR_SET_TAG_CUR, 20011, "Motor driver set target current failed!", "suggest...") \
_D(INIT_ERR_RELEASE_BRAKE, 20012, "Motor driver release brake failed!", "suggest...") \
_D(INIT_ERR_EN_POS_LOOP, 20013, "Motor driver enable postion loop failed!", "suggest...") \
_D(INIT_ERR_SET_MAX_ACC, 20014, "Motor set max accelerate failed!", "suggest...") \
_D(SAFETY_ERR_PROTECTION_STOP_TIMEOUT, 20015, "Protective stop timeout!", "suggest...") \
_D(SAFETY_ERR_REDUCED_MODE_TIMEOUT, 20016, "Reduced mode timeout!", "suggest...") \
_D(SYS_ERR_MCU_COM, 20017, "Robot system error: mcu communication error!", "suggest...") \
_D(SYS_ERR_RS485_COM, 20018, "Robot system error: RS485 communication error!", "suggest...") \
_D(IFB_ERR_DISCONNECTED, 20019, "Interface board may be disconnected. Please check connection between IPC and Interface board.", "suggest...")\
_D(IFB_ERR_PAYLOAD_ERROR, 20020, "Payload error.", "suggest...") \
_D(IFB_OFFLINE, 20021, "ifaceboard error: ifaceboard may be offline", "(a) Check ifaceboard's hardware. (b) Check ifaceboard's id.") \
_D(IFB_ERR_BOOTLOADER, 20022, "ifaceboard error: The ifaceboard is in bootloader mode. Retry firmware update. ", "suggest...") \
_D(IFB_SLAVE_OFFLINE, 20023, "interface slave board error: interface slave board may be offline", "(a) Check interface slave board's hardware. (b) Check interface slave board's id.") \
_D(IFB_SLAVE_ERR_BOOTLOADER, 20024, "interface slave board error: The interface slave board is in bootloader mode. Retry firmware update. ", "suggest...")

◆ SYSTEM_ERRORS

#define SYSTEM_ERRORS

◆ TOOL_ERRORS

#define TOOL_ERRORS
Value:
_D(TOOL_FLASH_VERIFY_FAILED, 40001, "Flash write verify failed", "suggest...") \
_D(TOOL_PROGRAM_CRC_FAILED, 40002, "Program flash checksum failed during bootloading", "suggest...") \
_D(TOOL_PROGRAM_CRC_FAILED2, 40003, "Program flash checksum failed at runtime", "suggest...") \
_D(TOOL_ID_UNDIFINED, 40004, "Tool ID is undefined", "suggest...") \
_D(TOOL_ILLEGAL_BL_CMD, 40005, "Illegal bootloader command", "suggest...") \
_D(TOOL_FW_WRONG, 40006, "Wrong firmware at the joint", "suggest...") \
_D(TOOL_HW_INVALID, 40007, "Invalid hardware revision", "suggest...") \
_D(TOOL_SHORT_CURCUIT_H, 40011, "Short circuit detected on Digital Output: " _PH1_ " high side", "suggest...") \
_D(TOOL_SHORT_CURCUIT_L, 40012, "Short circuit detected on Digital Output: " _PH1_ " low side", "suggest...") \
_D(TOOL_AVERAGE_CURR_HIGH, 40013, "10 second Average tool IO Current of " _PH1_ " A is outside of the allowed range.", "suggest...") \
_D(TOOL_POWER_PIN_OVER_CURR, 40014, "Current of " _PH1_ " A on the POWER pin is outside of the allowed range.", "suggest...") \
_D(TOOL_DOUT_PIN_OVER_CURR, 40015, "Current of " _PH1_ " A on the Digital Output pins is outside of the allowed range.", "suggest...") \
_D(TOOL_GROUND_PIN_OVER_CURR, 40016, "Current of " _PH1_ " A on the ground pin is outside of the allowed range.", "suggest...") \
_D(TOOL_RX_FRAMING, 40021, "RX framing error", "suggest...") \
_D(TOOL_RX_PARITY, 40022, "RX Parity error", "suggest...") \
_D(TOOL_48V_LOW, 40031, "48V input is too low", "suggest...") \
_D(TOOL_48V_HIGH, 40032, "48V input is too high", "suggest...") \
_D(TOOL_ERR_OFFLINE, 40033, "tool error: tool may be offline", "(a) Check tool's hardware. (b) Check joint's id.") \
_D(TOOL_ERR_BOOTLOADER, 40034, "tool error: The tool is in bootloader mode. Retry firmware update. ", "suggest...")
#define _PH1_
Definition error_stack.h:18