From c7a78856aa593e1821ba1b6a2a70f1d2ba1e3d4f Mon Sep 17 00:00:00 2001 From: Frederico Afonso Date: Fri, 20 Jun 2025 14:03:40 +0100 Subject: [PATCH 1/4] [DQ_SerialManipulator.m] Add abstract method 'get_link_transformation()' --- robot_modeling/DQ_SerialManipulator.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/robot_modeling/DQ_SerialManipulator.m b/robot_modeling/DQ_SerialManipulator.m index 7b4b5ce5..0d73773b 100644 --- a/robot_modeling/DQ_SerialManipulator.m +++ b/robot_modeling/DQ_SerialManipulator.m @@ -86,6 +86,11 @@ st = get_supported_joint_types(); end + methods (Abstract) + % This method returns the corresponding dual quaternion for a given link's parameters. + get_link_transformation(q, ith); + end + methods (Access = protected) function check_joint_types(obj) % CHECK_JOINT_TYPES() throws an exception if the joint types From ba021a4da9f3830dffb4a83b70e58041d185a865 Mon Sep 17 00:00:00 2001 From: Frederico Afonso Date: Fri, 20 Jun 2025 14:06:10 +0100 Subject: [PATCH 2/4] [DQ_SerialManipulatorDH.m] Override abstract method 'get_link_transformation()' from 'DQ_SerialManipulator' class --- robot_modeling/DQ_SerialManipulatorDH.m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/robot_modeling/DQ_SerialManipulatorDH.m b/robot_modeling/DQ_SerialManipulatorDH.m index e63db4b0..3b361cb3 100644 --- a/robot_modeling/DQ_SerialManipulatorDH.m +++ b/robot_modeling/DQ_SerialManipulatorDH.m @@ -203,6 +203,22 @@ obj.set_joint_types(A(5,:)); end + function x = get_link_transformation(obj, q, ith) + % This method exposes the protected method get_link2dq(), + % which calculates the corresponding dual quaternion for a + % given link's DH parameters. + % Usage: + % get_link_transformation(q, ith) + % q: The joint value. + % ith: The link number. + % + % Example: + % robot = KukaLwr4Robot.kinematics(); + % x = robot.get_link_transformation(pi/2, 3); + + x = get_link2dq(obj, q, ith); + end + function ret = get_parameters(obj, parameterType) % This method returns a vector containing the DH parameters. % Usage: get_parameters(parameterType) From d8790c972585f5569a37ced83e48a904f985df21 Mon Sep 17 00:00:00 2001 From: Frederico Afonso Date: Fri, 20 Jun 2025 14:06:36 +0100 Subject: [PATCH 3/4] [DQ_SerialManipulatorMDH.m] Override abstract method 'get_link_transformation()' from 'DQ_SerialManipulator' class --- robot_modeling/DQ_SerialManipulatorMDH.m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/robot_modeling/DQ_SerialManipulatorMDH.m b/robot_modeling/DQ_SerialManipulatorMDH.m index ddcac174..d65e459e 100644 --- a/robot_modeling/DQ_SerialManipulatorMDH.m +++ b/robot_modeling/DQ_SerialManipulatorMDH.m @@ -198,6 +198,22 @@ obj.set_joint_types(A(5,:)); end + function x = get_link_transformation(obj, q, ith) + % This method exposes the protected method get_link2dq(), + % which calculates the corresponding dual quaternion for a + % given link's DH parameters. + % Usage: + % get_link_transformation(q, ith) + % q: The joint value. + % ith: The link number. + % + % Example: + % robot = ComauSmartSixRobot.kinematics(); + % x = robot.get_link_transformation(pi/2, 3); + + x = get_link2dq(obj, q, ith); + end + function ret = get_parameters(obj, parameterType) % This method returns a vector containing the DH parameters. % Usage: get_parameters(parameterType) From 365aa23b5dec1b5cd9791859612316e7765b49b7 Mon Sep 17 00:00:00 2001 From: Frederico Afonso Date: Fri, 20 Jun 2025 14:15:11 +0100 Subject: [PATCH 4/4] [DQ_SerialManipulatorMDH.m] Fix minor typo in the description of the method 'get_link_transformation()' --- robot_modeling/DQ_SerialManipulatorMDH.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robot_modeling/DQ_SerialManipulatorMDH.m b/robot_modeling/DQ_SerialManipulatorMDH.m index d65e459e..b4663e31 100644 --- a/robot_modeling/DQ_SerialManipulatorMDH.m +++ b/robot_modeling/DQ_SerialManipulatorMDH.m @@ -201,7 +201,7 @@ function x = get_link_transformation(obj, q, ith) % This method exposes the protected method get_link2dq(), % which calculates the corresponding dual quaternion for a - % given link's DH parameters. + % given link's MDH parameters. % Usage: % get_link_transformation(q, ith) % q: The joint value.