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 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) diff --git a/robot_modeling/DQ_SerialManipulatorMDH.m b/robot_modeling/DQ_SerialManipulatorMDH.m index ddcac174..b4663e31 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 MDH 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)