Skip to main content
Glama
nonead

nUR MCP Server

by nonead

movej

Control robot joint movements by sending precise angle, speed, acceleration, and timing parameters to Universal Robots through the nUR MCP Server.

Instructions

发送新的关节姿态到指定IP的机器人,使每个关节都旋转至指定弧度。 IP:机器人地址, q:各关节角度, a:加速度(米每平方秒), v:速度(米每秒), t:移动时长(秒), r:交融半径(米)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipYes
qYes
aNo
vNo
tNo
rNo

Implementation Reference

  • The MCP tool handler for 'movej'. Decorated with @mcp.tool(), it handles the tool execution by linking to the robot, sending the movej command via the UR library, and confirming success using movejConfirm.
    @mcp.tool() def movej(ip: str, q: list, a=1, v=1, t=0, r=0): """发送新的关节姿态到指定IP的机器人,使每个关节都旋转至指定弧度。 IP:机器人地址, q:各关节角度, a:加速度(米每平方秒), v:速度(米每秒), t:移动时长(秒), r:交融半径(米)。""" try: if '连接失败' in link_check(ip): return return_msg(f"与机器人的连接已断开。") cmd = f"movej({q},{a},{v},{t},{r})" logger.info(f"发送脚本:{cmd}") robot_list[ip].movej(q, a, v, t, r) time.sleep(1) result = movejConfirm(ip, q) if result == 1: return return_msg(f"命令 {cmd} 已发送,移动完成。") else: return return_msg(f"命令 {cmd} 已发送,移动失败。") except Exception as e: logger.error(f"发送新的关节姿态到UR机器人失败: {str(e)}") return return_msg(f"发送新的关节姿态到UR机器人: {str(e)}")
  • Helper function used by movej to confirm if the robot has reached the target joint positions and program has stopped.
    def movejConfirm(ip, q): """ movej移动的结果确认 1:移动到位 2:移动结束,但是位置不准确 """ loop_flg = True count = 0 while loop_flg: time.sleep(1) current_pose = round_pose(robot_list[ip].get_actual_joint_positions()) if right_pose_joint(current_pose, q): robot_list[ip].robotConnector.DashboardClient.ur_running() running = robot_list[ip].robotConnector.DashboardClient.last_respond if running == 'Program running: false': return 1 else: robot_list[ip].robotConnector.DashboardClient.ur_running() running = robot_list[ip].robotConnector.DashboardClient.last_respond if running == 'Program running: true': # 尚未移动完成 continue else: # 移动完成 count = count + 1 if count > 5: return 2
  • Helper to round poses for comparison in movejConfirm.
    def round_pose(pose): """给坐标取近似值,精确到三位小数""" pose[0] = round(pose[0], 3) pose[1] = round(pose[1], 3) pose[2] = round(pose[2], 3) pose[3] = round(pose[3], 3) pose[4] = round(pose[4], 3) pose[5] = round(pose[5], 3) return pose
  • Helper to check if current joint pose matches target within tolerance for movejConfirm.
    def right_pose_joint(current_pose, q): """关节的弧度验证,允许0.1的误差,按角度计算大约5度""" if q[0] + 0.1 >= current_pose[0] >= q[0] - 0.1: if q[1] + 0.1 >= current_pose[1] >= q[1] - 0.1: if q[2] + 0.1 >= current_pose[2] >= q[2] - 0.1: if q[3] + 0.1 >= current_pose[3] >= q[3] - 0.1: if q[4] + 0.1 >= current_pose[4] >= q[4] - 0.1: if q[5] + 0.1 >= current_pose[5] >= q[5] - 0.1: return True return False

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nonead/nUR-MCP-SERVER'

If you have feedback or need assistance with the MCP directory API, please join our Discord server