API 说明 ============================ Dobot 工控机主控支持的 API ++++++++++++++++++++++++++++++++++++++++++ +--------+-------------------------+----------+ | 指令号 | 命令 | 支持情况 | +========+=========================+==========+ | 100 | 获取机械臂程序版本号 | 支持 | +--------+-------------------------+----------+ | 101 | 发送速度数据 | 支持 | +--------+-------------------------+----------+ | 102 | 发送加速度数据 | 支持 | +--------+-------------------------+----------+ | 103 | 发送圆滑过渡参数 | 支持 | +--------+-------------------------+----------+ | 104 | 发送工具坐标系(TCP)参数 | 支持 | +--------+-------------------------+----------+ | 105 | 设置数字量输出 | 支持 | +--------+-------------------------+----------+ | 106 | SetJointsMovej | 支持 | +--------+-------------------------+----------+ | 107 | SetCartMovel | 支持 | +--------+-------------------------+----------+ | 108 | SetJoinsMovel | 支持 | +--------+-------------------------+----------+ | 109 | SetCartMovej | 支持 | +--------+-------------------------+----------+ | 110 | MovejSequence | 支持 | +--------+-------------------------+----------+ | 111 | MovelSequence | 支持 | +--------+-------------------------+----------+ | 112 | SetJointsMovejDo | 支持 | +--------+-------------------------+----------+ | 113 | SetCartMovelDo | 支持 | +--------+-------------------------+----------+ | 114 | SetJointsMovelDo | 不支持 | +--------+-------------------------+----------+ | 115 | SetJointsMovejGroupDo | 不支持 | +--------+-------------------------+----------+ | 116 | SetCartMovelGroupDo | 不支持 | +--------+-------------------------+----------+ | 117 | SetJointsMovelGroupDo | 不支持 | +--------+-------------------------+----------+ | 118 | MovelUntil | 不支持 | +--------+-------------------------+----------+ | 119 | 获取数字量输入状态 | 支持 | +--------+-------------------------+----------+ | 120 | 获取数字量输出状态 | 不支持 | +--------+-------------------------+----------+ | 121 | 获取模拟量输入口数值 | 支持 | +--------+-------------------------+----------+ | 122 | 获取机械臂当前角度 | 支持 | +--------+-------------------------+----------+ | 123 | 获取机械臂当前位姿 | 支持 | +--------+-------------------------+----------+ | 200 | 机械臂后台发送状态 | 支持 | +--------+-------------------------+----------+ Dobot 机械臂主控支持的 API +++++++++++++++++++++++++++++++++++ .. function:: xyzMasterConnect() :noindex: 连接到工控机服务器 .. function:: xyzMasterClose() :noindex: 断开与工控机服务器的连接 .. function:: xyzSwitchApp(app_name) :noindex: 切换应用 :param app_name: 应用名称 :type app_name: string :return: error_code :rtype: number .. function:: xyzSwitchFlow(flow_name) :noindex: 切换流图 :param flow_name: 流图名称 :type flow_name: string :return: error_code :rtype: number .. function:: xyzSwitchItem(ws_id, obj_name) :noindex: 切换工件 :param ws_id: 工作空间 id :type ws_id: number :param obj_name: 工件名称 :type obj_name: string :return: error_code :rtype: number .. function:: xyzSwitchTool(tool_name) :noindex: 切换工具 :param tool_name: 工具名称 :type tool_name: string :return: error_code :rtype: number .. function:: xyzReqCapImg(vision_service_id) :noindex: 请求拍照 :param vision_service_id: 需要进行拍照的视觉服务 id :type vision_service_id: number :return: error_code :rtype: number :return token: 获取拍照结果的凭据 :type token: number .. function:: xyzGetCapImg(token) :noindex: 获取拍照结果 :param token: 请求拍照时返回的 token :type token: number :return: error_code :rtype: number .. function:: xyzCapImg(vision_service_id) :noindex: 拍照 :param vision_service_id: 需要进行拍照操作的工作空间id :type vision_service_id: number :return: error_code :rtype: number .. function:: xyzReqGraspPose(ws_id) :noindex: 请求抓取位姿 :param ws_id: 需要获取抓取位姿的工作空间id :type ws_id: number :return: error_code :rtype: number :return token: 获取抓取位姿结果的凭据 :type token: number .. function:: xyzGetGraspPose(token) :noindex: 获取抓取位姿 :param token: 请求抓取目标位姿时返回的token :type token: number :return: error_code :rtype: number :return: pose :rtype: table :return: pose_num :rtype: number :return: pipeline_num :rtype: number :return: register_num :rtype: number .. function:: xyzReqObjPose(ws_id) :noindex: 请求物体位姿 :param ws_id: 需要获取物体位姿的工作空间id :type ws_id: number :return: error_code :rtype: number :return token: 获取物体位姿结果的凭据 :type token: number .. function:: xyzGetObjPose(token) :noindex: 获取物体位姿 :param token: 请求物体位姿时得到的token :type token: num :return: error_code :rtype: number :return: pose :rtype: table :return: pose_num :rtype: number :return: pose_type :rtype: number .. function:: xyzResetTask() :noindex: 重置视觉 :return: error_code :rtype: number .. function:: xyzSendCurrentJoints() :noindex: 发送当前关节位姿 :return: error_code :rtype: number .. function:: xyzSendCurrentCartPose() :noindex: 发送当前笛卡尔空间位姿 :return: error_code :rtype: number .. function:: xyzReqPick() :noindex: 请求pick动作规划 :return: error_code :rtype: number .. function:: xyzReqPlace() :noindex: 请求place动作规划 :return: error_code :rtype: number .. function:: xyzReqPickPlace(ws_id) :noindex: 请求pick和place规划 :param ws_id: 需要请求pick和place规划的工作空间id :type ws_id: number :return: error_code :rtype: number .. function:: xyzGetPickin(ws_id) :noindex: 获取取料入框轨迹 :param ws_id: 需要获取pick in轨迹的工作空间id :type ws_id: number :return: error_code :rtype: number :return: pipeline_num :rtype: number :return: register_num :rtype: number :return: wp_num :rtype: number :return: wp_type :rtype: array :return: wp :rtype: 2d-array .. function:: xyzGetPickout(ws_id) :noindex: 获取取料出框轨迹 :param ws_id: 需要获取pick out轨迹的工作空间id :type ws_id: number :return: error_code :rtype: number :return: pipeline_num :rtype: number :return: register_num :rtype: number :return: wp_num :rtype: number :return: wp_type :rtype: array :return: wp :rtype: 2d-array .. function:: xyzGetPlacein(ws_id) :noindex: 获取放料入框轨迹 :param ws_id: 需要获取place in轨迹的工作空间id :type ws_id: number :return: error_code :rtype: number :return: pipeline_num :rtype: number :return: register_num :rtype: number :return: wp_num :rtype: number :return: wp_type :rtype: array :return: wp :rtype: 2d-array .. function:: xyzGetPlaceout(ws_id) :noindex: 获取放料出框轨迹(注:该函数不需要传入参数,仅更新全局变量) :param ws_id: 需要获取place out轨迹的工作空间id :type ws_id: number :return: error_code :rtype: number :return: pipeline_num :rtype: number :return: register_num :rtype: number :return: wp_num :rtype: number :return: wp_type :rtype: array :return: wp :rtype: 2d-array .. function:: xyzSwitchStrat(strat_name) :noindex: 请求切换策略 :param strat_name: 策略名称 :type strat_name: string :return: error_code :rtype: number .. function:: xyzUpdateTotePose() :noindex: 料箱重定位 :param V_POSE: 料箱位姿(全局变量) :return: error_code :rtype: number :return: pose :rtype: table .. function:: xyzUpdateObjPoseOnHand() :noindex: 工件在上手的二次定位 :return: error_code :rtype: number .. function:: xyzUpdateObjPoseToHand() :noindex: 工件不在手上的二次定位,获取二次抓取的轨迹 :return: error_code :rtype: number :return: pipeline_num :rtype: number :return: register_num :rtype: number :return: wp_num :rtype: number :return: wp_type :rtype: array :return: wp :rtype: 2d-array .. function:: xyzGetObjPoseType() :noindex: 获取工件姿态类型 :return: error_code :rtype: number :return: pose_type :rtype: number .. function:: xyzResetPalletStatus() :noindex: 重置工业码垛状态 :return: error_code :rtype: number .. function:: xyzExecuteTraj(num_of_waypoints, type_of_waypoints, waypoints) :noindex: 执行段轨迹 :param num_of_waypoints: 轨迹点的个数 :type num_of_waypoints: number :param type_of_waypoints: 轨迹点类型数组 :type type_of_waypoints: array :param waypoints[]: 轨迹点数组 :type waypoints[]: 2d-array :return: error_code :rtype: number .. function:: xyzCalculateGraspPose(ws_id) :noindex: 计算抓取位姿 :param ws_id: 工作空间 id :type ws_id: number :return: error_code :rtype: number :return: pose :rtype: table :return: pose_num :rtype: number :return: pipeline_num :rtype: number :return: register_num :rtype: number .. function:: FUNC num xyzCalculateObjectPose(ws_id) :noindex: 计算物体位姿 :param ws_id: 工作空间 id :type ws_id: number :return: error_code :rtype: number :return: pose :rtype: table :return: obj_num :rtype: number :return: pose_type :rtype: number