Skip to content

4.1 Basic Robot Operations

Overview

The Arm class encapsulates most high-frequency interfaces related to Jiebote robots, handling connection management, status queries, and control-command delivery. Typical usage:

  1. Instantiate Arm(local_proxy=False)
  2. Call connect() to establish communication with the controller/pendant
  3. Invoke motion, status, or I/O APIs as required
  4. Finally call disconnect() or release_access() to free resources

No manual configuration is needed; the class automatically checks SDK version, identifies controller type, selects the proxy service, and logs the chosen communication path.

When local_proxy=True , ensure the local machine is on the same subnet and the controller IP is reachable. For industrial robots, if you need to keep the PC mode active, call acquire_access() after connecting and promptly call release_access() afterward to avoid locking the pendant’s control authority.

Constructor

Method NameArm( local_proxy : bool = False)
DescriptionThe Agilebot robot class, containing all available interfaces. When instantiated it prints the SDK version and manual URL.
Request Parameterslocal_proxy : bool Whether to launch a local controller proxy service. Default False .
- True : start the proxy locally (requires the controller IP, not a domain).
- False : use the proxy service on the controller/teach pendant (robot software ≥ v7.7 with the proxy installed).
Return ValueStatusCodeEnum: Function execution result
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

4.1.1 Connect to the Robot

Method Nameconnect(arm_controller_ip: str = COBOT_IP , teach_panel_ip: Optional[str] = None) -> StatusCodeEnum
DescriptionConnect to the Agilebot robot. The method auto-detects cooperative/industrial models, fills in teach pendant IPs, and starts the appropriate proxy service.
Request Parametersarm_controller_ip : str Controller IP (defaults to the COBOT_IP constant).
teach_panel_ip : Optional[str] Teach pendant IP for industrial robots. When omitted, the method auto-assigns the default pendant IP or reuses the controller IP.
Return ValueStatusCodeEnum: Function execution result
Notes- Local proxy is started only if local_proxy=True and a valid IP address is provided; Airbot domains only support HTTP and cannot work with the local proxy.
- Invalid IP/domain values return INVALID_IP_ADDRESS .
- A failure to contact the controller returns CONTROLLER_CONNECTION_ERROR with details.
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

4.1.2 Check Connection Status with the Robot

Method Nameis_connected() -> bool
DescriptionCheck whether the connection with the robot is valid
Request ParametersNo parameters
Return Valuebool: Connection status, True: Connection is valid, False: Connection is invalid
NotesThe legacy is_connect() method is deprecated; use is_connected() instead.
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

4.1.3 Disconnect from the Robot

Method Namedisconnect()
DescriptionDisconnect from the Agilebot robot
Request ParametersNo parameters
Return ValueNo return
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

Example Code

arm/connect_disconnect.py
py
#!python
"""
Copyright © 2016 Agilebot Robotics Ltd. All rights reserved.
Instruction: Arm类下的基础通讯连接断开示例 / Example of a basic communication connection
"""

from Agilebot import Arm, StatusCodeEnum

# [ZH] 初始化捷勃特机器人
# [EN] Initialize the Agilebot robot
arm = Arm()
# [ZH] 连接捷勃特机器人
# [EN] Connect to the Agilebot robot
ret = arm.connect("10.27.1.254")
if ret == StatusCodeEnum.OK:
    print("机器人连接成功 / Robot connected successfully")
else:
    print(f"机器人连接失败,错误代码 / Robot connection failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 检查连接状态
# [EN] Check connection status
connect_status = arm.is_connected()
# [ZH] 打印结果
# [EN] Print the result
print(f"当前连接状态 / Current connection status: {connect_status}")

# [ZH] 断开捷勃特机器人连接
# [EN] Disconnect from the Agilebot robot
arm.disconnect()
print("机器人断开连接成功 / Robot disconnected successfully")

4.1.4 Get the Current Robot Model

Method Nameget_arm_model_info() -> tuple[str, StatusCodeEnum]
DescriptionGet the current robot model information
Request ParametersNo parameters
Return Valuestr: Robot model, e.g., "GBT-C5A"
StatusCodeEnum: Function execution result
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

Example Code

arm/get_arm_model_info.py
py
#!python
"""
Copyright © 2016 Agilebot Robotics Ltd. All rights reserved.
Instruction: Arm类下的型号获取示例 / Example of model info acquisition
"""

from Agilebot import Arm, StatusCodeEnum

# [ZH] 初始化捷勃特机器人
# [EN] Initialize the Agilebot robot
arm = Arm()
# [ZH] 连接捷勃特机器人
# [EN] Connect to the Agilebot robot
ret = arm.connect("10.27.1.254")
if ret == StatusCodeEnum.OK:
    print("机器人连接成功 / Robot connected successfully")
else:
    print(f"机器人连接失败,错误代码 / Robot connection failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 获取型号
# [EN] Get the robot model
model_info, ret = arm.get_arm_model_info()
# [ZH] 检查是否成功
# [EN] Check if successful
if ret == StatusCodeEnum.OK:
    print("获取型号成功 / Get robot model successfully")
    print(f"机器人型号 / Robot model: {model_info}")
else:
    print(f"获取型号失败,错误代码 / Get robot model failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 断开捷勃特机器人连接
# [EN] Disconnect from the Agilebot robot
arm.disconnect()

4.1.5 Get the Robot's Operating Status

Method Nameget_robot_status() -> tuple[RobotStatusEnum, StatusCodeEnum]
DescriptionGet the operating status of the Agilebot robot
Request ParametersNo parameters
Return ValueRobotStatusEnum: Robot operating status
StatusCodeEnum: Function execution result
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

Example Code

arm/get_robot_status.py
py
#!python
"""
Copyright © 2016 Agilebot Robotics Ltd. All rights reserved.
Instruction: Arm类下的机器人状态获取示例 / Example of obtaining robot status
"""

from Agilebot import Arm, StatusCodeEnum

# [ZH] 初始化捷勃特机器人
# [EN] Initialize the Agilebot robot
arm = Arm()
# [ZH] 连接捷勃特机器人
# [EN] Connect to the Agilebot robot
ret = arm.connect("10.27.1.254")
if ret == StatusCodeEnum.OK:
    print("机器人连接成功 / Robot connected successfully")
else:
    print(f"机器人连接失败,错误代码 / Robot connection failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 获取机器人运行状态
# [EN] Get the robot running status
state, ret = arm.get_robot_status()
# [ZH] 检查是否成功
# [EN] Check if successful
if ret == StatusCodeEnum.OK:
    print("获取机器人运行状态成功 / Get robot running status successful")
    print(f"机器人运行状态 / Robot running status: {state.msg}")
else:
    print(f"获取机器人运行状态失败,错误代码 / Get robot running status failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 断开捷勃特机器人连接
# [EN] Disconnect from the Agilebot robot
arm.disconnect()
print("机器人断开连接成功 / Robot disconnected successfully")

4.1.6 Get the Current Controller Operating Status

Method Nameget_ctrl_status() -> tuple[CtrlStatusEnum, StatusCodeEnum]
DescriptionGet the current operating status of the Agilebot robot controller
Request ParametersNo parameters
Return ValueCtrlStatusEnum: Controller operating status
StatusCodeEnum: Function execution result
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

Example Code

arm/get_ctrl_status.py
py
#!python
"""
Copyright © 2016 Agilebot Robotics Ltd. All rights reserved.
Instruction: Arm类下的获取运动控制器运行状态示例 / Example of the operating status of the controller
"""

from Agilebot import Arm, StatusCodeEnum

# [ZH] 初始化捷勃特机器人
# [EN] Initialize the Agilebot robot
arm = Arm()
# [ZH] 连接捷勃特机器人
# [EN] Connect to the Agilebot robot
ret = arm.connect("10.27.1.254")
if ret == StatusCodeEnum.OK:
    print("机器人连接成功 / Robot connected successfully")
else:
    print(f"机器人连接失败,错误代码 / Robot connection failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 获取运动控制器运行状态
# [EN] Get the controller running status
state, ret = arm.get_ctrl_status()
# [ZH] 检查是否成功
# [EN] Check if successful
if ret == StatusCodeEnum.OK:
    print("获取运动控制器运行状态成功 / Get controller running status successful")
    print(f"运动控制器运行状态 / Controller running status: {state.msg}")
else:
    print(f"获取运动控制器运行状态失败,错误代码 / Get controller running status failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 断开捷勃特机器人连接
# [EN] Disconnect from the Agilebot robot
arm.disconnect()
print("机器人断开连接成功 / Robot disconnected successfully")

4.1.7 Get the Current Servo Controller Status

Method Nameget_servo_status() -> tuple[ServoStatusEnum, StatusCodeEnum]
DescriptionGet the current status of the Agilebot robot servo controller
Request ParametersNo parameters
Return ValueServoStatusEnum: Servo controller status
StatusCodeEnum: Function execution result
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

Example Code

arm/get_servo_status.py
py
#!python
"""
Copyright © 2016 Agilebot Robotics Ltd. All rights reserved.
Instruction: Arm类下的伺服状态获取示例 / Example of obtaining servo status
"""

from Agilebot import Arm, StatusCodeEnum

# [ZH] 初始化捷勃特机器人
# [EN] Initialize the Agilebot robot
arm = Arm()
# [ZH] 连接捷勃特机器人
# [EN] Connect to the Agilebot robot
ret = arm.connect("10.27.1.254")
if ret == StatusCodeEnum.OK:
    print("机器人连接成功 / Robot connected successfully")
else:
    print(f"机器人连接失败,错误代码 / Robot connection failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 获取伺服控制器状态
# [EN] Get the servo controller status
state, ret = arm.get_servo_status()
# [ZH] 检查是否成功
# [EN] Check if successful
if ret == StatusCodeEnum.OK:
    print("获取伺服控制器状态成功 / Get servo controller status successful")
    print(f"伺服控制器状态 / Servo controller status: {state.msg}")
else:
    print(f"获取伺服控制器状态失败,错误代码 / Get servo controller status failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 断开捷勃特机器人连接
# [EN] Disconnect from the Agilebot robot
arm.disconnect()
print("机器人断开连接成功 / Robot disconnected successfully")

4.1.8 Get the Current Soft Mode of the Robot

Method Nameget_soft_mode() -> tuple[SoftModeEnum, StatusCodeEnum]
DescriptionGet the current soft mode of the Agilebot robot (PC mode manual/auto state)
Request ParametersNo parameters
Return ValueSoftModeEnum: Soft mode status
StatusCodeEnum: Function execution result
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

4.1.9 Set the Current Soft Mode of the Robot

Method Nameset_soft_mode( soft_mode : SoftModeEnum) -> StatusCodeEnum
DescriptionSet the current soft mode of the robot (PC mode manual/auto state)
Request Parameterssoft_mode : SoftModeEnum Soft mode value
Return ValueStatusCodeEnum: Function execution result
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

Example Code

arm/soft_mode.py
py
#!python
"""
Copyright © 2016 Agilebot Robotics Ltd. All rights reserved.
Instruction: Arm类下的机器人软状态获取示例 / Example of obtaining the soft state of a robot
"""

from Agilebot import Arm, SoftModeEnum, StatusCodeEnum

# [ZH] 初始化捷勃特机器人
# [EN] Initialize the Agilebot robot
arm = Arm()
# [ZH] 连接捷勃特机器人
# [EN] Connect to the Agilebot robot
ret = arm.connect("10.27.1.254")
if ret == StatusCodeEnum.OK:
    print("机器人连接成功 / Robot connected successfully")
else:
    print(f"机器人连接失败,错误代码 / Robot connection failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 设置机器人当前的软状态为手动限速模式
# [EN] Set the robot's current soft state to manual limit mode
ret = arm.set_soft_mode(SoftModeEnum.MANUAL_LIMIT)
# [ZH] 检查是否成功
# [EN] Check if successful
if ret == StatusCodeEnum.OK:
    print(
        "设置机器人当前的软状态为手动限速模式成功 / Set the robot's current soft state to manual limit mode successfully"
    )
else:
    print(
        f"设置机器人当前的软状态为手动限速模式失败,错误代码 / Set the robot's current soft state to manual limit mode failed, error code: {ret.errmsg}"
    )
    arm.disconnect()
    exit(1)

# [ZH] 获取机器人当前的软状态
# [EN] Get the robot's current soft state
state, ret = arm.get_soft_mode()
# [ZH] 检查是否成功
# [EN] Check if successful
if ret == StatusCodeEnum.OK:
    print("获取机器人当前的软状态成功 / Get the robot's current soft state successfully")
    print(f"机器人当前的软状态 / Robot current soft state: {state.name}")
else:
    print(f"获取机器人当前的软状态失败,错误代码 / Get the robot's current soft state failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 断开捷勃特机器人连接
# [EN] Disconnect from the Agilebot robot
arm.disconnect()
print("机器人断开连接成功 / Robot disconnected successfully")

4.1.10 Get Robot Operation Mode

Method Nameget_op_mode() -> tuple[SoftModeEnum, StatusCodeEnum]
DescriptionRetrieve the robot operation mode (manual/auto permissions in PC mode).
Request ParametersNone
Return ValueSoftModeEnum: Operation mode
StatusCodeEnum: Function execution result
NotesIf the controller returns an invalid value, the method falls back to SoftModeEnum.UNKNOWN .
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

4.1.11 Set Robot Operation Mode

Method Nameset_op_mode( soft_mode : SoftModeEnum) -> StatusCodeEnum
DescriptionSet the robot operation mode. Only supported for virtual robots/simulators.
Request Parameterssoft_mode : Target SoftModeEnum, cannot be UNKNOWN .
Return ValueStatusCodeEnum: Function execution result
NotesPassing SoftModeEnum.UNKNOWN returns UNSUPPORTED_PARAMETER .
Compatible robot software versionCollaborative (Copper): Simulation only
Industrial (Bronze): Simulation only

4.1.12 Upper Computer Acquires Control Authority

Method Nameacquire_access()
DescriptionThe PC acquires control authority, putting the robot into PC mode. Internally starts a heartbeat thread to keep the mode alive.
Request ParametersNo parameters
Return ValueNo return
NoteOnly industrial robots require this call; collaborative robots and P7A do not.
Compatible robot software versionCollaborative (Copper): Not supported
Industrial (Bronze): v7.5.0.0+

4.1.13 Upper Computer Releases Control Authority

Method Namerelease_access()
DescriptionRelease the PC control authority, stopping the PC mode heartbeat and handing control back to the teach pendant.
Request ParametersNo parameters
Return ValueNo return
NoteOnly industrial robots need this call.
Compatible robot software versionCollaborative (Copper): Not supported
Industrial (Bronze): v7.5.0.0+

Example Code

arm/access_operate.py
py
#!python
"""
Copyright © 2016 Agilebot Robotics Ltd. All rights reserved.
Instruction: Arm类下的操作权限获取示例 / Example of obtaining operation permissions
"""

from Agilebot import Arm, StatusCodeEnum

# [ZH] 初始化捷勃特机器人
# [EN] Initialize the Agilebot robot
arm = Arm()
# [ZH] 连接捷勃特机器人
# [EN] Connect to the Agilebot robot
ret = arm.connect("10.27.1.254")

# [ZH] 检查是否连接成功
# [EN] Check if connection is successful
if ret == StatusCodeEnum.OK:
    print("机器人连接成功 / Robot connected successfully")
else:
    print(f"机器人连接失败,错误代码 / Robot connection failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 获取权限
# [EN] Acquire access
arm.acquire_access()

# [ZH] 返还权限
# [EN] Release access
arm.release_access()

# [ZH] 断开捷勃特机器人连接
# [EN] Disconnect from the Agilebot robot
arm.disconnect()
print("机器人断开连接成功 / Robot disconnected successfully")

4.1.14 Get the Robot Controller Version

Method Nameget_controller_version() -> tuple[str, StatusCodeEnum]
DescriptionRecommended API to obtain the current controller version.
Request ParametersNo parameters
Return Valuestr: Controller version
StatusCodeEnum: Function execution result
NotesIf the version is below the recommended level, the SDK prints an upgrade warning during connection.
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

Example Code

arm/get_version.py
py
#!python
"""
Copyright © 2016 Agilebot Robotics Ltd. All rights reserved.
Instruction: Arm类下的运动控制器版本获取示例 / Example of obtaining the controller version
"""

from Agilebot import Arm, StatusCodeEnum

# [ZH] 初始化捷勃特机器人
# [EN] Initialize the Agilebot robot
arm = Arm()
# [ZH] 连接捷勃特机器人
# [EN] Connect to the Agilebot robot
ret = arm.connect("10.27.1.254")
if ret == StatusCodeEnum.OK:
    print("机器人连接成功 / Robot connected successfully")
else:
    print(f"机器人连接失败,错误代码 / Robot connection failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 获取运动控制器版本
# [EN] Get the controller version
version_info, ret = arm.get_controller_version()
# [ZH] 检查是否成功
# [EN] Check if successful
if ret == StatusCodeEnum.OK:
    print("获取运动控制器版本成功 / Get controller version successful")
    print(f"运动控制器版本 / Controller version: {version_info}")
else:
    print(f"获取运动控制器版本失败,错误代码 / Get controller version failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 断开捷勃特机器人连接
# [EN] Disconnect from the Agilebot robot
arm.disconnect()
print("机器人断开连接成功 / Robot disconnected successfully")

4.1.15 Set the Robot LED Indicator Light

Method Nameswitch_led_light( mode : bool) -> StatusCodeEnum
DescriptionSet the LED indicator light of the Agilebot robot
Request Parametersmode : bool, True to turn on, False to turn off
Return ValueStatusCodeEnum: Function execution result
Compatible robot software versionCollaborative (Copper): v7.5.1.3+
Industrial (Bronze): Not supported

Example Code

arm/switch_led_light.py
py
#!python
"""
Copyright © 2016 Agilebot Robotics Ltd. All rights reserved.
Instruction: Arm类下的机器人灯环状态获取示例 / Example of obtaining the status of the LED
"""

import time

from Agilebot import Arm, StatusCodeEnum

# [ZH] 初始化捷勃特机器人
# [EN] Initialize the Agilebot robot
arm = Arm()
# [ZH] 连接捷勃特机器人
# [EN] Connect to the Agilebot robot
ret = arm.connect("10.27.1.254")
if ret == StatusCodeEnum.OK:
    print("机器人连接成功 / Robot connected successfully")
else:
    print(f"机器人连接失败,错误代码 / Robot connection failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 控制LED灯光关闭
# [EN] Control LED light off
ret = arm.switch_led_light(mode=False)
# [ZH] 检查是否成功
# [EN] Check if successful
if ret == StatusCodeEnum.OK:
    print("LED灯光关闭成功 / Control LED light off successfully")
else:
    print(f"LED灯光关闭失败,错误代码 / Control LED light off failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

time.sleep(5)

# [ZH] 控制LED灯光开启
# [EN] Control LED light on
ret = arm.switch_led_light(mode=True)
# [ZH] 检查是否成功
# [EN] Check if successful
if ret == StatusCodeEnum.OK:
    print("LED灯光开启成功 / Control LED light on successfully")
else:
    print(f"LED灯光开启失败,错误代码 / Control LED light on failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 断开捷勃特机器人连接
# [EN] Disconnect from the Agilebot robot
arm.disconnect()
print("机器人断开连接成功 / Robot disconnected successfully")

4.1.16 Power On the Robot Servo

Method Nameservo_on() -> StatusCodeEnum
DescriptionPower on the servo of the Agilebot robot
Request ParametersNo parameters
Return ValueStatusCodeEnum: Function execution result
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

4.1.17 Power Off the Robot Servo

Method Nameservo_off() -> StatusCodeEnum
DescriptionPower off the servo of the Agilebot robot
Request ParametersNo parameters
Return ValueStatusCodeEnum: Function execution result
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

4.1.18 Reset the Robot Servo

Method Nameservo_reset() -> StatusCodeEnum
DescriptionReset the servo of the Agilebot robot
Request ParametersNo parameters
Return ValueStatusCodeEnum: Function execution result
Compatible robot software versionCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

Example Code

arm/servo_operate.py
py
#!python
"""
Copyright © 2016 Agilebot Robotics Ltd. All rights reserved.
Instruction: Arm类下的控制伺服操作示例 / Eexample of control servo operation example
"""

import time

from Agilebot import Arm, StatusCodeEnum

# [ZH] 初始化捷勃特机器人
# [EN] Initialize the Agilebot robot
arm = Arm()
# [ZH] 连接捷勃特机器人
# [EN] Connect to the Agilebot robot
ret = arm.connect("10.27.1.254")
if ret == StatusCodeEnum.OK:
    print("机器人连接成功 / Robot connected successfully")
else:
    print(f"机器人连接失败,错误代码 / Robot connection failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 机器人伺服重置
# [EN] Robot servo reset
ret = arm.servo_reset()
if ret == StatusCodeEnum.OK:
    print("伺服重置成功 / Servo reset successfully")
else:
    print(f"伺服重置失败,错误代码 / Servo reset failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)
time.sleep(5)

# [ZH] 机器人伺服下电
# [EN] Robot servo power off
ret = arm.servo_off()
if ret == StatusCodeEnum.OK:
    print("伺服下电成功 / Servo power off successfully")
else:
    print(f"伺服下电失败,错误代码 / Servo power off failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)
time.sleep(5)

# [ZH] 机器人伺服上电
# [EN] Robot servo power on
ret = arm.servo_on()
if ret == StatusCodeEnum.OK:
    print("伺服上电成功 / Servo power on successfully")
else:
    print(f"伺服上电失败,错误代码 / Servo power on failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 断开捷勃特机器人连接
# [EN] Disconnect from the Agilebot robot
arm.disconnect()
print("机器人断开连接成功 / Robot disconnected successfully")

4.1.19 Emergency Stop

Method nameestop() -> StatusCodeEnum
DescriptionImmediately triggers an emergency stop on the current Agilebot robot.
ParametersNone
Return valueStatusCodeEnum: execution result of the function
Compatible robot software versionsCobot (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

Example Code

arm/estop.py
py
#!python
"""
Copyright © 2016 Agilebot Robotics Ltd. All rights reserved.
Instruction: Arm类下的紧急停止示例 / Example of emergency stop
"""

from Agilebot import Arm, StatusCodeEnum

# [ZH] 初始化捷勃特机器人
# [EN] Initialize the Agilebot robot
arm = Arm()
# [ZH] 连接捷勃特机器人
# [EN] Connect to the Agilebot robot
ret = arm.connect("10.27.1.254")
if ret == StatusCodeEnum.OK:
    print("机器人连接成功 / Robot connected successfully")
else:
    print(f"机器人连接失败,错误代码 / Robot connection failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 机器人紧急停止
# [EN] Robot emergency stop
ret = arm.estop()
if ret == StatusCodeEnum.OK:
    print("机器人紧急停止成功 / Robot emergency stop successfully")
else:
    print(f"机器人紧急停止失败,错误代码 / Robot emergency stop failed, error code: {ret.errmsg}")
    arm.disconnect()
    exit(1)

# [ZH] 断开捷勃特机器人连接
# [EN] Disconnect from the Agilebot robot
arm.disconnect()
print("机器人断开连接成功 / Robot disconnected successfully")