get_actual_robot_current
Retrieve the current electrical load in amperes from a Universal Robot by specifying its IP address to monitor robot performance and operational status.
Instructions
获取指定IP机器人的电流(安培) IP:机器人地址
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes |
Implementation Reference
- Handler function for the 'get_actual_robot_current' tool. It checks the robot connection via link_check, retrieves the actual robot current using robotModle_list[ip].ActualRobotCurrent(), logs it, and returns the value in a JSON-formatted message. Handles exceptions by logging and returning an error message.@mcp.tool() def get_actual_robot_current(ip: str): """获取指定IP机器人的电流(安培) IP:机器人地址""" try: if '连接失败' in link_check(ip): return return_msg(f"与机器人的连接已断开。") logger.info(f"{robotModle_list[ip].ActualRobotCurrent()}(安培)") return return_msg(f"{robotModle_list[ip].ActualRobotCurrent()}(安培)") except Exception as e: logger.error(f"机器人的电流获取失败: {str(e)}") return return_msg(f"机器人的电流获取失败: {str(e)}")