From c9e84a7021320f178a459350658177120ffd1c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Wed, 14 May 2025 17:50:23 +0100 Subject: [PATCH 01/17] [DQ_JointType] Added a new class to represent the joint types. --- .../dqrobotics/robot_modeling/DQ_JointType.h | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 include/dqrobotics/robot_modeling/DQ_JointType.h diff --git a/include/dqrobotics/robot_modeling/DQ_JointType.h b/include/dqrobotics/robot_modeling/DQ_JointType.h new file mode 100644 index 0000000..b57ff71 --- /dev/null +++ b/include/dqrobotics/robot_modeling/DQ_JointType.h @@ -0,0 +1,43 @@ +/** +(C) Copyright 2011-2025 DQ Robotics Developers + +This file is part of DQ Robotics. + + DQ Robotics is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + DQ Robotics is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with DQ Robotics. If not, see . + +Contributors: +1. Juan Jose Quiroz Omana (juanjose.quirozomana@manchester.ac.uk) + - Responsible for the original implementation. +*/ + + +#pragma once + +namespace DQ_robotics +{ +class DQ_JointType +{ +public: + enum TYPE{ + REVOLUTE = 0, + PRISMATIC, + SPHERICAL, + CYLINDRICAL, + PLANAR, + SIX_DOF, + HELICAL + }; +}; + +} From f05192dbc1aa88cbc67854d1a5e5d98dd7a372e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Wed, 14 May 2025 18:52:10 +0100 Subject: [PATCH 02/17] [DQ_JointType.h] Updated the class to support switch and boolean comparisons --- .../dqrobotics/robot_modeling/DQ_JointType.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/dqrobotics/robot_modeling/DQ_JointType.h b/include/dqrobotics/robot_modeling/DQ_JointType.h index b57ff71..fefdf30 100644 --- a/include/dqrobotics/robot_modeling/DQ_JointType.h +++ b/include/dqrobotics/robot_modeling/DQ_JointType.h @@ -29,7 +29,7 @@ namespace DQ_robotics class DQ_JointType { public: - enum TYPE{ + enum JOINT_TYPE{ REVOLUTE = 0, PRISMATIC, SPHERICAL, @@ -38,6 +38,23 @@ class DQ_JointType SIX_DOF, HELICAL }; + // This definition enables switch cases and comparisons. + constexpr operator JOINT_TYPE() const { return joint_type_; } +private: + JOINT_TYPE joint_type_; + +public: + /** + * @brief DQ_JointType Default constructor method. + */ + DQ_JointType() = default; + + /** + * @brief DQ_JointType Constructor method + * @param joint_type The joint type. Example: REVOLUTE, PRISMATIC, + * SPHERICAL, CYLINDRICAL, PLANAR, SIX_DOF, or HELICAL. + */ + DQ_JointType(const JOINT_TYPE& joint_type): joint_type_{joint_type}{}; }; } From edfa46d57566cafb93eede9c2c185697029584bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Wed, 14 May 2025 18:57:08 +0100 Subject: [PATCH 03/17] [DQ_SerialManipulator.{h,cpp}] Added the _check_joint_types(), and {set,get}_joint_{type, types} methods. --- .../robot_modeling/DQ_SerialManipulator.h | 15 ++++- src/robot_modeling/DQ_SerialManipulator.cpp | 62 +++++++++++++++++++ 2 files changed, 75 insertions(+), 2 deletions(-) diff --git a/include/dqrobotics/robot_modeling/DQ_SerialManipulator.h b/include/dqrobotics/robot_modeling/DQ_SerialManipulator.h index 0f577ea..65e504d 100644 --- a/include/dqrobotics/robot_modeling/DQ_SerialManipulator.h +++ b/include/dqrobotics/robot_modeling/DQ_SerialManipulator.h @@ -1,6 +1,6 @@ #pragma once /** -(C) Copyright 2011-2022 DQ Robotics Developers +(C) Copyright 2011-2025 DQ Robotics Developers This file is part of DQ Robotics. @@ -20,9 +20,14 @@ This file is part of DQ Robotics. Contributors: 1. Murilo M. Marinho (murilomarinho@ieee.org) 2. Mateus Rodrigues Martins (martinsrmateus@gmail.com) + +3. Juan Jose Quiroz Omana (juanjose.quirozomana@manchester.ac.uk) + - Added the joint_types member, and the following methods: + _check_joint_types(), and {set,get}_joint_{type, types}. */ #include +#include namespace DQ_robotics { @@ -31,8 +36,9 @@ class DQ_SerialManipulator: public DQ_Kinematics { protected: DQ curr_effector_; - + std::vector joint_types_; DQ_SerialManipulator(const int& dofs); + void _check_joint_types() const; public: DQ get_effector() const; DQ set_effector(const DQ& new_effector); @@ -46,6 +52,10 @@ class DQ_SerialManipulator: public DQ_Kinematics VectorXd get_upper_q_dot_limit() const; void set_upper_q_dot_limit(const VectorXd &upper_q_dot_limit); + DQ_JointType get_joint_type(const int& ith_joint) const; + std::vector get_joint_types() const; + void set_joint_type(const DQ_JointType& joint_type, const int& ith_joint); + void set_joint_types(const std::vector& joint_types); //Virtual virtual MatrixXd raw_pose_jacobian(const VectorXd& q_vec) const; @@ -56,6 +66,7 @@ class DQ_SerialManipulator: public DQ_Kinematics virtual MatrixXd raw_pose_jacobian(const VectorXd& q_vec, const int& to_ith_link) const = 0; virtual MatrixXd raw_pose_jacobian_derivative(const VectorXd& q, const VectorXd& q_dot, const int& to_ith_link) const = 0; virtual DQ raw_fkm(const VectorXd& q_vec, const int& to_ith_link) const = 0; + virtual std::vector get_supported_joint_types() const = 0; //Overrides from DQ_Kinematics virtual DQ fkm(const VectorXd& q_vec) const override; //Override from DQ_Kinematics diff --git a/src/robot_modeling/DQ_SerialManipulator.cpp b/src/robot_modeling/DQ_SerialManipulator.cpp index cc2192a..1fdd6e9 100644 --- a/src/robot_modeling/DQ_SerialManipulator.cpp +++ b/src/robot_modeling/DQ_SerialManipulator.cpp @@ -18,7 +18,12 @@ This file is part of DQ Robotics. Contributors: 1. Murilo M. Marinho (murilomarinho@ieee.org) + 2. Mateus Rodrigues Martins (martinsrmateus@gmail.com) + +3. Juan Jose Quiroz Omana (juanjose.quirozomana@manchester.ac.uk) + - Added the joint_types member, and the following methods: + _check_joint_types(), and {set,get}_joint_{type, types}. */ #include @@ -40,6 +45,21 @@ DQ_SerialManipulator::DQ_SerialManipulator(const int &dim_configuration_space): dim_configuration_space_ = dim_configuration_space; } +/** + * @brief DQ_SerialManipulator::_check_joint_types throws an exception if the joint types are + * different from the supported joints. + */ +void DQ_SerialManipulator::_check_joint_types() const +{ + std::vector types = get_joint_types(); + std::vector supported_types = get_supported_joint_types(); + std::string msg = "Unsupported joint types."; + for (size_t i=0;i DQ_SerialManipulator::get_joint_types() const +{ + return joint_types_; +} + +/** + * @brief DQ_SerialManipulator::set_joint_type sets the joint type of the ith joint + * @param joint_type The joint_type. + * @param ith_joint The index to a joint. + */ +void DQ_SerialManipulator::set_joint_type(const DQ_JointType &joint_type, const int &ith_joint) +{ + _check_to_ith_link(ith_joint); + joint_types_.at(ith_joint) = joint_type; + _check_joint_types(); +} + +/** + * @brief DQ_SerialManipulator::set_joint_types sets the joint types. + * @param joint_types A vector containing the joint types. + */ +void DQ_SerialManipulator::set_joint_types(const std::vector &joint_types) +{ + joint_types_ = joint_types; + _check_joint_types(); +} + DQ DQ_SerialManipulator::raw_fkm(const VectorXd& q_vec) const { _check_q_vec(q_vec); From 69e96efd073d6df3c6ab109f0d1ba2342f6b80de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Thu, 15 May 2025 10:03:10 +0100 Subject: [PATCH 04/17] [DQ_SerialManipulatorDenso] Added the get_supported_joint_types() method --- .../DQ_SerialManipulatorDenso.h | 10 ++++-- .../DQ_SerialManipulatorDenso.cpp | 35 +++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/include/dqrobotics/robot_modeling/DQ_SerialManipulatorDenso.h b/include/dqrobotics/robot_modeling/DQ_SerialManipulatorDenso.h index 7df807f..f6b0a1b 100644 --- a/include/dqrobotics/robot_modeling/DQ_SerialManipulatorDenso.h +++ b/include/dqrobotics/robot_modeling/DQ_SerialManipulatorDenso.h @@ -1,6 +1,6 @@ #pragma once /** -(C) Copyright 2021-2022 DQ Robotics Developers +(C) Copyright 2011-2025 DQ Robotics Developers This file is part of DQ Robotics. @@ -17,8 +17,13 @@ This file is part of DQ Robotics. You should have received a copy of the GNU Lesser General Public License along with DQ Robotics. If not, see . + Contributors: -- Murilo M. Marinho (murilomarinho@ieee.org) +1. Murilo M. Marinho (murilomarinho@ieee.org) + - Responsible for the original implementation. + +2. Juan Jose Quiroz Omana (juanjose.quirozomana@manchester.ac.uk) + - Added the get_supported_joint_types() method. */ #include @@ -33,6 +38,7 @@ class DQ_SerialManipulatorDenso: public DQ_SerialManipulator DQ _denso2dh(const double& q, const int& ith) const; public: + std::vector get_supported_joint_types()const override; // Deprecated on 22.04, will be removed on the next release. [[deprecated("Use ? instead.")]] VectorXd get_as() const; diff --git a/src/robot_modeling/DQ_SerialManipulatorDenso.cpp b/src/robot_modeling/DQ_SerialManipulatorDenso.cpp index 71eee93..e4e8ba8 100644 --- a/src/robot_modeling/DQ_SerialManipulatorDenso.cpp +++ b/src/robot_modeling/DQ_SerialManipulatorDenso.cpp @@ -1,3 +1,29 @@ +/** +(C) Copyright 2011-2025 DQ Robotics Developers + +This file is part of DQ Robotics. + + DQ Robotics is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + DQ Robotics is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with DQ Robotics. If not, see . + +Contributors: +1. Murilo M. Marinho (murilomarinho@ieee.org) + - Responsible for the original implementation. + +2. Juan Jose Quiroz Omana (juanjose.quirozomana@manchester.ac.uk) + - Added the get_supported_joint_types() method. +*/ + #include namespace DQ_robotics { @@ -29,6 +55,15 @@ DQ DQ_SerialManipulatorDenso::_denso2dh(const double &q, const int &ith) const return z_rot*q_t*q_alpha*q_beta; } +/** + * @brief DQ_SerialManipulatorDenso::get_supported_joint_types gets the supported joint types. + * @return A vector containing the supported joint types. + */ +std::vector DQ_SerialManipulatorDenso::get_supported_joint_types() const +{ + return {DQ_JointType::REVOLUTE}; +} + VectorXd DQ_SerialManipulatorDenso::get_as() const { return denso_matrix_.row(0); From 4f37b32479abbe92f3ce59cd5d2ff4f741899f43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Thu, 15 May 2025 10:12:04 +0100 Subject: [PATCH 05/17] [DQ_SerialManipulatorDH.{h,cpp}] Added the get_supported_joint_types() method --- .../robot_modeling/DQ_SerialManipulatorDH.h | 16 ++++++++++------ src/robot_modeling/DQ_SerialManipulatorDH.cpp | 12 +++++++++++- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/include/dqrobotics/robot_modeling/DQ_SerialManipulatorDH.h b/include/dqrobotics/robot_modeling/DQ_SerialManipulatorDH.h index 09964cf..56e01d4 100644 --- a/include/dqrobotics/robot_modeling/DQ_SerialManipulatorDH.h +++ b/include/dqrobotics/robot_modeling/DQ_SerialManipulatorDH.h @@ -23,6 +23,7 @@ This file is part of DQ Robotics. 2. Juan Jose Quiroz Omana (juanjqogm@gmail.com) - Added methods to get and set the DH parameters. + - Added the get_supported_joint_types() method. */ @@ -49,13 +50,16 @@ class DQ_SerialManipulatorDH: public DQ_SerialManipulator const int& to_ith_link, const double& parameter); + std::vector get_supported_joint_types()const override; + // Deprecated on 22.04, will be removed on the next release. - enum [[deprecated("Use ? instead.")]] JOINT_TYPES{ JOINT_ROTATIONAL=0, JOINT_PRISMATIC }; - [[deprecated("Use ? instead.")]] VectorXd get_thetas() const; - [[deprecated("Use ? instead.")]] VectorXd get_ds() const; - [[deprecated("Use ? instead.")]] VectorXd get_as() const; - [[deprecated("Use ? instead.")]] VectorXd get_alphas() const; - [[deprecated("Use ? instead.")]] VectorXd get_types() const; + enum [[deprecated("Use DQ_JointType instead.")]] JOINT_TYPES{ JOINT_ROTATIONAL=0, JOINT_PRISMATIC }; + + [[deprecated("Use get_parameters(DQ_ParameterDH::THETA) instead.")]] VectorXd get_thetas() const; + [[deprecated("Use get_parameters(DQ_ParameterDH::D) instead.")]] VectorXd get_ds() const; + [[deprecated("Use get_parameters(DQ_ParameterDH::A) instead.")]] VectorXd get_as() const; + [[deprecated("Use get_parameters(DQ_ParameterDH::ALPHA) instead.")]] VectorXd get_alphas() const; + [[deprecated("Use get_joint_types() instead.")]] VectorXd get_types() const; DQ_SerialManipulatorDH()=delete; DQ_SerialManipulatorDH(const MatrixXd& dh_matrix); diff --git a/src/robot_modeling/DQ_SerialManipulatorDH.cpp b/src/robot_modeling/DQ_SerialManipulatorDH.cpp index 6020509..206968b 100644 --- a/src/robot_modeling/DQ_SerialManipulatorDH.cpp +++ b/src/robot_modeling/DQ_SerialManipulatorDH.cpp @@ -20,8 +20,9 @@ This file is part of DQ Robotics. 1. Murilo M. Marinho (murilomarinho@ieee.org) - Responsible for the original implementation. -2. Juan Jose Quiroz Omana (juanjqogm@gmail.com) +2. Juan Jose Quiroz Omana (juanjose.quirozomana@manchester.ac.uk) - Added methods to get and set the DH parameters. + - Added the get_supported_joint_types() method. */ #include @@ -198,6 +199,15 @@ void DQ_SerialManipulatorDH::set_parameter(const DQ_ParameterDH ¶meter_type, } } +/** + * @brief DQ_SerialManipulatorDH::get_supported_joint_types gets the supported joint types. + * @return A vector containing the supported joint types. + */ +std::vector DQ_SerialManipulatorDH::get_supported_joint_types() const +{ + return {DQ_JointType::REVOLUTE, DQ_JointType::PRISMATIC}; +} + /** * @brief This protected method computes the dual quaternion related with the time derivative of the From 451e7e58c44f153529491310e883ef53686be4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Thu, 15 May 2025 10:13:07 +0100 Subject: [PATCH 06/17] [DQ_SerialManipulatorMDH.{h,cpp}] Added the get_supported_joint_types() method --- .../robot_modeling/DQ_SerialManipulatorMDH.h | 16 ++++++++++------ src/robot_modeling/DQ_SerialManipulatorMDH.cpp | 13 ++++++++++++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/include/dqrobotics/robot_modeling/DQ_SerialManipulatorMDH.h b/include/dqrobotics/robot_modeling/DQ_SerialManipulatorMDH.h index 3795ecd..d48f77d 100644 --- a/include/dqrobotics/robot_modeling/DQ_SerialManipulatorMDH.h +++ b/include/dqrobotics/robot_modeling/DQ_SerialManipulatorMDH.h @@ -23,6 +23,7 @@ This file is part of DQ Robotics. 2. Juan Jose Quiroz Omana (juanjqogm@gmail.com) - Added methods to get and set the DH parameters. + - Added the get_supported_joint_types() method. */ #include @@ -48,13 +49,16 @@ class DQ_SerialManipulatorMDH: public DQ_SerialManipulator const int& to_ith_link, const double& parameter); + std::vector get_supported_joint_types()const override; + // Deprecated on 22.04, will be removed on the next release. - enum [[deprecated("Use ? instead.")]] JOINT_TYPES{ JOINT_ROTATIONAL=0, JOINT_PRISMATIC }; - [[deprecated("Use ? instead.")]] VectorXd get_thetas() const; - [[deprecated("Use ? instead.")]] VectorXd get_ds() const; - [[deprecated("Use ? instead.")]] VectorXd get_as() const; - [[deprecated("Use ? instead.")]] VectorXd get_alphas() const; - [[deprecated("Use ? instead.")]] VectorXd get_types() const; + enum [[deprecated("Use DQ_JointType instead.")]] JOINT_TYPES{ JOINT_ROTATIONAL=0, JOINT_PRISMATIC }; + + [[deprecated("Use get_parameters(DQ_ParameterDH::THETA) instead.")]] VectorXd get_thetas() const; + [[deprecated("Use get_parameters(DQ_ParameterDH::D) instead.")]] VectorXd get_ds() const; + [[deprecated("Use get_parameters(DQ_ParameterDH::A) instead.")]] VectorXd get_as() const; + [[deprecated("Use get_parameters(DQ_ParameterDH::ALPHA) instead.")]] VectorXd get_alphas() const; + [[deprecated("Use get_joint_types() instead.")]] VectorXd get_types() const; DQ_SerialManipulatorMDH()=delete; DQ_SerialManipulatorMDH(const MatrixXd& mdh_matrix); diff --git a/src/robot_modeling/DQ_SerialManipulatorMDH.cpp b/src/robot_modeling/DQ_SerialManipulatorMDH.cpp index 3196355..b19ebf9 100644 --- a/src/robot_modeling/DQ_SerialManipulatorMDH.cpp +++ b/src/robot_modeling/DQ_SerialManipulatorMDH.cpp @@ -20,8 +20,9 @@ This file is part of DQ Robotics. 1. Murilo M. Marinho (murilomarinho@ieee.org) - Responsible for the original implementation. -2. Juan Jose Quiroz Omana (juanjqogm@gmail.com) +2. Juan Jose Quiroz Omana (juanjose.quirozomana@manchester.ac.uk) - Added methods to get and set the DH parameters. + - Added the get_supported_joint_types() method. */ #include @@ -209,6 +210,16 @@ void DQ_SerialManipulatorMDH::set_parameter(const DQ_ParameterDH ¶meter_type } } +/** + * @brief DQ_SerialManipulatorMDH::get_supported_joint_types gets the supported joint types. + * @return A vector containing the supported joint types. + */ +std::vector DQ_SerialManipulatorMDH::get_supported_joint_types() const +{ + return {DQ_JointType::REVOLUTE, DQ_JointType::PRISMATIC}; +} + + /** * @brief This protected method computes the dual quaternion related with the time derivative of the * unit dual quaternion pose using the MDH convention. From d08f8b70b1e94ee55575ea88157122e74f422541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Thu, 15 May 2025 11:31:47 +0100 Subject: [PATCH 07/17] [DQ_JointType] Added a new constructor with integer arguments --- .../dqrobotics/robot_modeling/DQ_JointType.h | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/include/dqrobotics/robot_modeling/DQ_JointType.h b/include/dqrobotics/robot_modeling/DQ_JointType.h index fefdf30..26d034a 100644 --- a/include/dqrobotics/robot_modeling/DQ_JointType.h +++ b/include/dqrobotics/robot_modeling/DQ_JointType.h @@ -23,6 +23,7 @@ This file is part of DQ Robotics. #pragma once +#include namespace DQ_robotics { @@ -55,6 +56,64 @@ class DQ_JointType * SPHERICAL, CYLINDRICAL, PLANAR, SIX_DOF, or HELICAL. */ DQ_JointType(const JOINT_TYPE& joint_type): joint_type_{joint_type}{}; + + /** + * @brief DQ_JointType Constructor method that allows integer arguments + * @param joint_type The joint type. + */ + DQ_JointType(const int& joint_type){ + switch (joint_type) { + case 0: + joint_type_ = REVOLUTE; + break; + case 1: + joint_type_ = PRISMATIC; + break; + case 2: + joint_type_ = SPHERICAL; + break; + case 3: + joint_type_ = CYLINDRICAL; + break; + case 4: + joint_type_ = PLANAR; + break; + case 5: + joint_type_ = SIX_DOF; + break; + case 6: + joint_type_ = HELICAL; + break; + default: + throw std::runtime_error("Invalid joint type"); + } + } + + /** + * @brief ToString converts the DQ_JointType to string. + * @return A string that corresponds with the joint type. + */ + std::string ToString() const { + switch (joint_type_) { + + case REVOLUTE: + return std::string("REVOLUTE"); + case PRISMATIC: + return std::string("PRISMATIC"); + case SPHERICAL: + return std::string("SPHERICAL"); + case CYLINDRICAL: + return std::string("CYLINDRICAL"); + case PLANAR: + return std::string("PLANAR"); + case SIX_DOF: + return std::string("SIX_DOF"); + case HELICAL: + return std::string("HELICAL"); + default: + throw std::runtime_error("Invalid joint type"); + } + } }; } From 5a022bd9824ffc0e0180e01e8a75197ebe8c65b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Thu, 15 May 2025 11:54:05 +0100 Subject: [PATCH 08/17] [DQ_SerialManipulator.h,cpp] Added a overloaded method for set_joint_types to accept eigen vectors. --- .../robot_modeling/DQ_SerialManipulator.h | 1 + src/robot_modeling/DQ_SerialManipulator.cpp | 33 +++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/include/dqrobotics/robot_modeling/DQ_SerialManipulator.h b/include/dqrobotics/robot_modeling/DQ_SerialManipulator.h index 65e504d..28881fd 100644 --- a/include/dqrobotics/robot_modeling/DQ_SerialManipulator.h +++ b/include/dqrobotics/robot_modeling/DQ_SerialManipulator.h @@ -56,6 +56,7 @@ class DQ_SerialManipulator: public DQ_Kinematics std::vector get_joint_types() const; void set_joint_type(const DQ_JointType& joint_type, const int& ith_joint); void set_joint_types(const std::vector& joint_types); + void set_joint_types(const VectorXd& joint_types); //Virtual virtual MatrixXd raw_pose_jacobian(const VectorXd& q_vec) const; diff --git a/src/robot_modeling/DQ_SerialManipulator.cpp b/src/robot_modeling/DQ_SerialManipulator.cpp index 1fdd6e9..b501b76 100644 --- a/src/robot_modeling/DQ_SerialManipulator.cpp +++ b/src/robot_modeling/DQ_SerialManipulator.cpp @@ -53,9 +53,25 @@ void DQ_SerialManipulator::_check_joint_types() const { std::vector types = get_joint_types(); std::vector supported_types = get_supported_joint_types(); - std::string msg = "Unsupported joint types."; - for (size_t i=0;i &join _check_joint_types(); } +/** + * @brief DQ_SerialManipulator::set_joint_types sets the joint types. + * @param joint_types A vector containing the joint types. + */ +void DQ_SerialManipulator::set_joint_types(const VectorXd &joint_types) +{ + for (int i=0;i Date: Thu, 15 May 2025 11:54:47 +0100 Subject: [PATCH 09/17] [DQ_SerialManipulatorDH.cpp] Updated the constructor to set the joint types --- src/robot_modeling/DQ_SerialManipulatorDH.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/robot_modeling/DQ_SerialManipulatorDH.cpp b/src/robot_modeling/DQ_SerialManipulatorDH.cpp index 206968b..40c5b81 100644 --- a/src/robot_modeling/DQ_SerialManipulatorDH.cpp +++ b/src/robot_modeling/DQ_SerialManipulatorDH.cpp @@ -55,6 +55,7 @@ DQ_SerialManipulatorDH::DQ_SerialManipulatorDH(const MatrixXd& dh_matrix): throw(std::range_error("Bad DQ_SerialManipulatorDH(dh_matrix) call: dh_matrix should be 5xn")); } dh_matrix_ = dh_matrix; + set_joint_types(dh_matrix.row(4)); } /** From 0e9f4528802b788af31fcb0dc6ee360d09198dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Thu, 15 May 2025 11:55:13 +0100 Subject: [PATCH 10/17] [DQ_SerialManipulatorMDH.cpp] Updated the constructor to set the joint types --- src/robot_modeling/DQ_SerialManipulatorMDH.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/robot_modeling/DQ_SerialManipulatorMDH.cpp b/src/robot_modeling/DQ_SerialManipulatorMDH.cpp index b19ebf9..a2b6ddd 100644 --- a/src/robot_modeling/DQ_SerialManipulatorMDH.cpp +++ b/src/robot_modeling/DQ_SerialManipulatorMDH.cpp @@ -58,6 +58,7 @@ DQ_SerialManipulatorMDH::DQ_SerialManipulatorMDH(const MatrixXd& mdh_matrix): throw(std::range_error("Bad DQ_SerialManipulatorDH(mdh_matrix) call: mdh_matrix should be 5xn")); } mdh_matrix_ = mdh_matrix; + set_joint_types(mdh_matrix.row(4)); } /** From b37dc6ada5e686bbd903e0b3a0f75aa5dc6fca20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Fri, 16 May 2025 08:53:53 +0100 Subject: [PATCH 11/17] [DQ_SerialManipulator.cpp] Fixed typo in _check_joint_types() --- src/robot_modeling/DQ_SerialManipulator.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/robot_modeling/DQ_SerialManipulator.cpp b/src/robot_modeling/DQ_SerialManipulator.cpp index b501b76..d9ae7b9 100644 --- a/src/robot_modeling/DQ_SerialManipulator.cpp +++ b/src/robot_modeling/DQ_SerialManipulator.cpp @@ -71,9 +71,19 @@ void DQ_SerialManipulator::_check_joint_types() const for (size_t i=0;i Date: Fri, 16 May 2025 09:00:26 +0100 Subject: [PATCH 12/17] [DQ_SerialManipulatorDenso.cpp] Updated the constructor to set the joint types --- src/robot_modeling/DQ_SerialManipulatorDenso.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/robot_modeling/DQ_SerialManipulatorDenso.cpp b/src/robot_modeling/DQ_SerialManipulatorDenso.cpp index e4e8ba8..f49741e 100644 --- a/src/robot_modeling/DQ_SerialManipulatorDenso.cpp +++ b/src/robot_modeling/DQ_SerialManipulatorDenso.cpp @@ -36,6 +36,7 @@ DQ_SerialManipulatorDenso::DQ_SerialManipulatorDenso(const MatrixXd& denso_matri throw(std::range_error("Bad DQ_SerialManipulatorDenso(MatrixXd) call: denso_matrix should be 6xn")); } denso_matrix_ = denso_matrix; + set_joint_types(std::vector(get_dim_configuration_space(), DQ_JointType::REVOLUTE)); } DQ DQ_SerialManipulatorDenso::_denso2dh(const double &q, const int &ith) const From 43648c23ebcc6d5b8a16c43b60664f0d5072d8ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Fri, 16 May 2025 09:02:47 +0100 Subject: [PATCH 13/17] [DQ_JoinType.h] Fixed typo in the documentation --- include/dqrobotics/robot_modeling/DQ_JointType.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/dqrobotics/robot_modeling/DQ_JointType.h b/include/dqrobotics/robot_modeling/DQ_JointType.h index 26d034a..99e87a3 100644 --- a/include/dqrobotics/robot_modeling/DQ_JointType.h +++ b/include/dqrobotics/robot_modeling/DQ_JointType.h @@ -91,7 +91,7 @@ class DQ_JointType /** * @brief ToString converts the DQ_JointType to string. - * @return A string that corresponds with the joint type. + * @return A string that corresponds to the joint type. */ std::string ToString() const { switch (joint_type_) { From e42603cd26ed3dc4c01653d39e63476d52e3ea5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Fri, 16 May 2025 13:58:28 +0100 Subject: [PATCH 14/17] [DQ_SerialManipulatorDenso.h] Added missing space in the method definition --- include/dqrobotics/robot_modeling/DQ_SerialManipulatorDenso.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/dqrobotics/robot_modeling/DQ_SerialManipulatorDenso.h b/include/dqrobotics/robot_modeling/DQ_SerialManipulatorDenso.h index f6b0a1b..d083f51 100644 --- a/include/dqrobotics/robot_modeling/DQ_SerialManipulatorDenso.h +++ b/include/dqrobotics/robot_modeling/DQ_SerialManipulatorDenso.h @@ -38,7 +38,7 @@ class DQ_SerialManipulatorDenso: public DQ_SerialManipulator DQ _denso2dh(const double& q, const int& ith) const; public: - std::vector get_supported_joint_types()const override; + std::vector get_supported_joint_types() const override; // Deprecated on 22.04, will be removed on the next release. [[deprecated("Use ? instead.")]] VectorXd get_as() const; From 5f316b230698715b1a578ba551874dd88bb66668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Fri, 16 May 2025 14:54:11 +0100 Subject: [PATCH 15/17] [DQ_JointType.h] Updated the documentation of the constructors including the paper in which the class is based on. --- include/dqrobotics/robot_modeling/DQ_JointType.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/dqrobotics/robot_modeling/DQ_JointType.h b/include/dqrobotics/robot_modeling/DQ_JointType.h index 99e87a3..02823bb 100644 --- a/include/dqrobotics/robot_modeling/DQ_JointType.h +++ b/include/dqrobotics/robot_modeling/DQ_JointType.h @@ -47,18 +47,24 @@ class DQ_JointType public: /** * @brief DQ_JointType Default constructor method. + * This class is based on Table 1 of Silva, Quiroz-Omaña, and Adorno (2022). + * Dynamics of Mobile Manipulators Using Dual Quaternion Algebra. */ DQ_JointType() = default; /** - * @brief DQ_JointType Constructor method + * @brief DQ_JointType Constructor method. + * This class is based on Table 1 of Silva, Quiroz-Omaña, and Adorno (2022). + * Dynamics of Mobile Manipulators Using Dual Quaternion Algebra. * @param joint_type The joint type. Example: REVOLUTE, PRISMATIC, * SPHERICAL, CYLINDRICAL, PLANAR, SIX_DOF, or HELICAL. */ DQ_JointType(const JOINT_TYPE& joint_type): joint_type_{joint_type}{}; /** - * @brief DQ_JointType Constructor method that allows integer arguments + * @brief DQ_JointType Constructor method that allows integer arguments. + * This class is based on Table 1 of Silva, Quiroz-Omaña, and Adorno (2022). + * Dynamics of Mobile Manipulators Using Dual Quaternion Algebra * @param joint_type The joint type. */ DQ_JointType(const int& joint_type){ From 9480c65f1030234421f6f4538c3aafb4eaf3ff20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Fri, 16 May 2025 15:29:34 +0100 Subject: [PATCH 16/17] [DQ_SerialManipulator.h] include the vector header to check if it solves the compilation on Ubuntu. --- include/dqrobotics/robot_modeling/DQ_SerialManipulator.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/dqrobotics/robot_modeling/DQ_SerialManipulator.h b/include/dqrobotics/robot_modeling/DQ_SerialManipulator.h index 28881fd..651a815 100644 --- a/include/dqrobotics/robot_modeling/DQ_SerialManipulator.h +++ b/include/dqrobotics/robot_modeling/DQ_SerialManipulator.h @@ -28,6 +28,7 @@ This file is part of DQ Robotics. #include #include +#include namespace DQ_robotics { From 6d5e67fa7bafbf56377c8ce07838ace461892b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Quiroz=20Oma=C3=B1a?= Date: Sat, 17 May 2025 22:59:34 +0100 Subject: [PATCH 17/17] [DQ_JointType.h, DQ_SerialManipulatorc.pp] Renamed the ToString method to to_string in the class DQ_JointType and updated the class DQ_SerialManipulator to comply with this modification. --- include/dqrobotics/robot_modeling/DQ_JointType.h | 4 ++-- src/robot_modeling/DQ_SerialManipulator.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/dqrobotics/robot_modeling/DQ_JointType.h b/include/dqrobotics/robot_modeling/DQ_JointType.h index 02823bb..102ad38 100644 --- a/include/dqrobotics/robot_modeling/DQ_JointType.h +++ b/include/dqrobotics/robot_modeling/DQ_JointType.h @@ -96,10 +96,10 @@ class DQ_JointType } /** - * @brief ToString converts the DQ_JointType to string. + * @brief to_string() converts the DQ_JointType to string. * @return A string that corresponds to the joint type. */ - std::string ToString() const { + std::string to_string() const { switch (joint_type_) { case REVOLUTE: diff --git a/src/robot_modeling/DQ_SerialManipulator.cpp b/src/robot_modeling/DQ_SerialManipulator.cpp index d9ae7b9..10520bc 100644 --- a/src/robot_modeling/DQ_SerialManipulator.cpp +++ b/src/robot_modeling/DQ_SerialManipulator.cpp @@ -60,7 +60,7 @@ void DQ_SerialManipulator::_check_joint_types() const size_t n = types.size(); for (size_t i=0;i