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:
- Instantiate
Arm(local_proxy=False) - Call
connect()to establish communication with the controller/pendant - Invoke motion, status, or I/O APIs as required
- Finally call
disconnect()orrelease_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 Name | Arm( local_proxy : bool = False) |
|---|---|
| Description | The Agilebot robot class, containing all available interfaces. When instantiated it prints the SDK version and manual URL. |
| Request Parameters | local_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 Value | StatusCodeEnum: Function execution result |
| Compatible robot software version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
4.1.1 Connect to the Robot
| Method Name | connect(arm_controller_ip: str = COBOT_IP , teach_panel_ip: Optional[str] = None) -> StatusCodeEnum |
|---|---|
| Description | Connect to the Agilebot robot. The method auto-detects cooperative/industrial models, fills in teach pendant IPs, and starts the appropriate proxy service. |
| Request Parameters | arm_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 Value | StatusCodeEnum: 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 version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
4.1.2 Check Connection Status with the Robot
| Method Name | is_connected() -> bool |
|---|---|
| Description | Check whether the connection with the robot is valid |
| Request Parameters | No parameters |
| Return Value | bool: Connection status, True: Connection is valid, False: Connection is invalid |
| Notes | The legacy is_connect() method is deprecated; use is_connected() instead. |
| Compatible robot software version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
4.1.3 Disconnect from the Robot
| Method Name | disconnect() |
|---|---|
| Description | Disconnect from the Agilebot robot |
| Request Parameters | No parameters |
| Return Value | No return |
| Compatible robot software version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
Example Code
#!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 Name | get_arm_model_info() -> tuple[str, StatusCodeEnum] |
|---|---|
| Description | Get the current robot model information |
| Request Parameters | No parameters |
| Return Value | str: Robot model, e.g., "GBT-C5A" StatusCodeEnum: Function execution result |
| Compatible robot software version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
Example Code
#!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 Name | get_robot_status() -> tuple[RobotStatusEnum, StatusCodeEnum] |
|---|---|
| Description | Get the operating status of the Agilebot robot |
| Request Parameters | No parameters |
| Return Value | RobotStatusEnum: Robot operating status StatusCodeEnum: Function execution result |
| Compatible robot software version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
Example Code
#!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 Name | get_ctrl_status() -> tuple[CtrlStatusEnum, StatusCodeEnum] |
|---|---|
| Description | Get the current operating status of the Agilebot robot controller |
| Request Parameters | No parameters |
| Return Value | CtrlStatusEnum: Controller operating status StatusCodeEnum: Function execution result |
| Compatible robot software version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
Example Code
#!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 Name | get_servo_status() -> tuple[ServoStatusEnum, StatusCodeEnum] |
|---|---|
| Description | Get the current status of the Agilebot robot servo controller |
| Request Parameters | No parameters |
| Return Value | ServoStatusEnum: Servo controller status StatusCodeEnum: Function execution result |
| Compatible robot software version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
Example Code
#!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 Name | get_soft_mode() -> tuple[SoftModeEnum, StatusCodeEnum] |
|---|---|
| Description | Get the current soft mode of the Agilebot robot (PC mode manual/auto state) |
| Request Parameters | No parameters |
| Return Value | SoftModeEnum: Soft mode status StatusCodeEnum: Function execution result |
| Compatible robot software version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
4.1.9 Set the Current Soft Mode of the Robot
| Method Name | set_soft_mode( soft_mode : SoftModeEnum) -> StatusCodeEnum |
|---|---|
| Description | Set the current soft mode of the robot (PC mode manual/auto state) |
| Request Parameters | soft_mode : SoftModeEnum Soft mode value |
| Return Value | StatusCodeEnum: Function execution result |
| Compatible robot software version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
Example Code
#!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 Name | get_op_mode() -> tuple[SoftModeEnum, StatusCodeEnum] |
|---|---|
| Description | Retrieve the robot operation mode (manual/auto permissions in PC mode). |
| Request Parameters | None |
| Return Value | SoftModeEnum: Operation mode StatusCodeEnum: Function execution result |
| Notes | If the controller returns an invalid value, the method falls back to SoftModeEnum.UNKNOWN . |
| Compatible robot software version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
4.1.11 Set Robot Operation Mode
| Method Name | set_op_mode( soft_mode : SoftModeEnum) -> StatusCodeEnum |
|---|---|
| Description | Set the robot operation mode. Only supported for virtual robots/simulators. |
| Request Parameters | soft_mode : Target SoftModeEnum, cannot be UNKNOWN . |
| Return Value | StatusCodeEnum: Function execution result |
| Notes | Passing SoftModeEnum.UNKNOWN returns UNSUPPORTED_PARAMETER . |
| Compatible robot software version | Collaborative (Copper): Simulation only Industrial (Bronze): Simulation only |
4.1.12 Upper Computer Acquires Control Authority
| Method Name | acquire_access() |
|---|---|
| Description | The PC acquires control authority, putting the robot into PC mode. Internally starts a heartbeat thread to keep the mode alive. |
| Request Parameters | No parameters |
| Return Value | No return |
| Note | Only industrial robots require this call; collaborative robots and P7A do not. |
| Compatible robot software version | Collaborative (Copper): Not supported Industrial (Bronze): v7.5.0.0+ |
4.1.13 Upper Computer Releases Control Authority
| Method Name | release_access() |
|---|---|
| Description | Release the PC control authority, stopping the PC mode heartbeat and handing control back to the teach pendant. |
| Request Parameters | No parameters |
| Return Value | No return |
| Note | Only industrial robots need this call. |
| Compatible robot software version | Collaborative (Copper): Not supported Industrial (Bronze): v7.5.0.0+ |
Example Code
#!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 Name | get_controller_version() -> tuple[str, StatusCodeEnum] |
|---|---|
| Description | Recommended API to obtain the current controller version. |
| Request Parameters | No parameters |
| Return Value | str: Controller version StatusCodeEnum: Function execution result |
| Notes | If the version is below the recommended level, the SDK prints an upgrade warning during connection. |
| Compatible robot software version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
Example Code
#!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 Name | switch_led_light( mode : bool) -> StatusCodeEnum |
|---|---|
| Description | Set the LED indicator light of the Agilebot robot |
| Request Parameters | mode : bool, True to turn on, False to turn off |
| Return Value | StatusCodeEnum: Function execution result |
| Compatible robot software version | Collaborative (Copper): v7.5.1.3+ Industrial (Bronze): Not supported |
Example Code
#!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 Name | servo_on() -> StatusCodeEnum |
|---|---|
| Description | Power on the servo of the Agilebot robot |
| Request Parameters | No parameters |
| Return Value | StatusCodeEnum: Function execution result |
| Compatible robot software version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
4.1.17 Power Off the Robot Servo
| Method Name | servo_off() -> StatusCodeEnum |
|---|---|
| Description | Power off the servo of the Agilebot robot |
| Request Parameters | No parameters |
| Return Value | StatusCodeEnum: Function execution result |
| Compatible robot software version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
4.1.18 Reset the Robot Servo
| Method Name | servo_reset() -> StatusCodeEnum |
|---|---|
| Description | Reset the servo of the Agilebot robot |
| Request Parameters | No parameters |
| Return Value | StatusCodeEnum: Function execution result |
| Compatible robot software version | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
Example Code
#!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 name | estop() -> StatusCodeEnum |
|---|---|
| Description | Immediately triggers an emergency stop on the current Agilebot robot. |
| Parameters | None |
| Return value | StatusCodeEnum: execution result of the function |
| Compatible robot software versions | Cobot (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
Example Code
#!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")