From 9e4b2f8c5797632301a9a55216fbb0ac89d48056 Mon Sep 17 00:00:00 2001 From: "Pierre Manceron (phylliade)" Date: Sun, 28 Jul 2024 20:26:00 +0200 Subject: [PATCH] Refactor tests and bump version --- src/ikpy/_version.py | 2 +- tests/{test_dh_UR10.py => test_chain_dh.py} | 26 +++++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) rename tests/{test_dh_UR10.py => test_chain_dh.py} (71%) diff --git a/src/ikpy/_version.py b/src/ikpy/_version.py index 6c61f23..36f7773 100644 --- a/src/ikpy/_version.py +++ b/src/ikpy/_version.py @@ -1 +1 @@ -__version__ = '3.3.4' +__version__ = '3.4' diff --git a/tests/test_dh_UR10.py b/tests/test_chain_dh.py similarity index 71% rename from tests/test_dh_UR10.py rename to tests/test_chain_dh.py index 275a251..848741c 100644 --- a/tests/test_dh_UR10.py +++ b/tests/test_chain_dh.py @@ -39,15 +39,17 @@ def create_dh_robot(robot): chain = Chain(links, name=robot.robot_name) return chain -robot = UR10() -chain = create_dh_robot(robot) -frame = [[1.112918581, -0.209413742, 0.19382176], [0.0, 1.0, 0.0]] -target_position, target_orientation = frame -joint_angles = chain.inverse_kinematics(target_position=target_position, target_orientation=target_orientation, orientation_mode="Z") - -print(joint_angles) - -fig, ax = plot.init_3d_figure() -chain.plot(robot.home_config, ax) -chain.plot(joint_angles, ax) -plt.show() \ No newline at end of file + +def test_dh_chain(): + robot = UR10() + chain = create_dh_robot(robot) + frame = [[1.112918581, -0.209413742, 0.19382176], [0.0, 1.0, 0.0]] + target_position, target_orientation = frame + joint_angles = chain.inverse_kinematics(target_position=target_position, target_orientation=target_orientation, orientation_mode="Z") + + print(joint_angles) + + fig, ax = plot.init_3d_figure() + chain.plot(robot.home_config, ax) + chain.plot(joint_angles, ax) + plt.savefig("out/UR10.png")