From 5eaf077fb7323e9723ba57d7f04bc17f623afe29 Mon Sep 17 00:00:00 2001 From: Falloimitator <160591701+Falloimitator@users.noreply.github.com> Date: Fri, 23 May 2025 17:13:26 +0300 Subject: [PATCH] set params --- main.py | 10 ++++++---- utils.py | 13 +++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index f7b9ee7..bc07698 100644 --- a/main.py +++ b/main.py @@ -33,10 +33,12 @@ config = { def main(): robot = RobotClient(HOST, PORT) - robot.set_joint_maxacc(2) - robot.set_joint_maxvelc(2) -# robot.move_linear_cartesian(config["pre_grasp_position"]) - robot.move_to_pose(config["pre_grasp_position"]) + #robot.set_joint_maxacc(3) + #robot.set_joint_maxvelc(3) + #robot.set_end_max_line_velc(0.6) + robot.set_end_max_line_acc(0.8) + robot.move_linear_cartesian(config["pre_grasp_position"]) +# robot.move_to_pose(config["pre_grasp_position"]) # robot.move_to_pose(config["grasp_position"]) # robot.move_to_pose(config["post_grasp_position"]) robot.close() diff --git a/utils.py b/utils.py index 7d17e4f..7594a7c 100644 --- a/utils.py +++ b/utils.py @@ -258,6 +258,19 @@ class RobotClient: ret = self._send_single_json(cmd) if ret.get("msg") != "succ": raise RuntimeError(f"set_joint_maxvelc failed: {ret}") + + def set_end_max_line_velc(self, vel: float): + cmd = {"command": "set_end_max_line_velc", "end_maxvelc": vel} + ret = self._send_single_json(cmd) + if ret.get("msg") != "succ": + raise RuntimeError(f"set_end_max_line_velc failed: {ret}") + + def set_end_max_line_acc(self, vel: float): + cmd = {"command": "set_end_max_line_acc", "end_maxacc": vel} + ret = self._send_single_json(cmd) + if ret.get("msg") != "succ": + raise RuntimeError(f"set_end_max_line_acc failed: {ret}") + def close(self): self.sock.close()