Skip to content

Conversation

@juanjqo
Copy link
Member

@juanjqo juanjqo commented Jan 4, 2023

@dqrobotics/developers

Hi @bvadorno,

This PR proposes the following modifications to fix #76 :

  • Removed the public property type from subclasses DQ_SerialManipulatorDH and DQ_SerialManipulatorMDH. Added the protected property joint_types in DQ_SerialManipulator. Motivations:
    • The joint types do not depend on any specific parametrization. Therefore, obj.joint_types is a property common to all subclasses, like obj.n_joints.
    • Since we now have the method set_joint_types (and get_joint_types, both added in this PR) there is no need to keep the property public. (Currently, the user can freely get and set the property obj.type.
  • The following methods were added in DQ_SerialManipulator:
    • get_supported_joint_types() (protected, abstract)
    • check_joint_types() (public)
    • get_joint_types() (public) (returns the joint types as a vector)
    • get_joint_type(ith) (public) (returns only the ith joint type as a double)
    • set_joint_types() (public) (sets all joints)
    • set_joint_type(ith) (public) (sets only the ith joint)

UML:
drawing

Example of use:
Minimal example used in #76

clear all;
clc;
close all;

ax18_DH_theta   = [0       0      -pi/2   -pi/2      -pi/2];  % theta
ax18_DH_d       = [0.167   0       0     0.1225          0];  % d
ax18_DH_a       = [0      0.159    0.02225    0      0.170];  % a
ax18_DH_alpha   = [-pi/2   0      -pi/2   -pi/2          0];  % alpha

R = double(DQ_JointType.REVOLUTE);
P = double(DQ_JointType.PRISMATIC);
H = double(DQ_JointType.HELICAL);
S = double(DQ_JointType.SPHERICAL);
C = double(DQ_JointType.CYLINDRICAL);
Pl = double(DQ_JointType.PLANAR);
SD = double(DQ_JointType.SIX_DOF);

ax18_DH_type    = [SD P H S C];


ax18_DH_matrix = [  ax18_DH_theta;
    ax18_DH_d;
    ax18_DH_a;
    ax18_DH_alpha;
    ax18_DH_type;
    ]; % D&H parameters matrix for the arm model

ax = DQ_SerialManipulatorDH(ax18_DH_matrix)

Output:

Error using DQ_SerialManipulator/check_joint_types
Unsupported joint types. Use valid joint types:  DQ_JointType.REVOLUTE,
DQ_JointType.PRISMATIC.

Error in DQ_SerialManipulator/set_joint_types (line 146)
            obj.check_joint_types();

Error in DQ_SerialManipulatorDH (line 196)
            obj.set_joint_types(A(5,:));

Error in untitled2 (line 30)
ax = DQ_SerialManipulatorDH(ax18_DH_matrix)

Best regards,

Juancho

juanjqo and others added 30 commits December 3, 2022 16:51
Updated the file with last Bruno's recommendations.
…an abstract method and defined its concrete version.
[DQ_SerialManipulator.m] the Fixed error message of the constructor.
[DQ_SerialManipulator.m] Added comments in some lines.
[DQ_SerialManipulatorDH.m] Protected the methods get_w and dh2dq, as in C++.
[DQ_SerialManipulatorDH.m] Added minimal changes in the dh2dq method.
[DQ_SerialManipulator.m] Updated the year of the copyright
[DQ_SerialManipulatorDH.m] Updated the copyright.
[DQ_SerialManipulatorMDH] Removed the class. I will add it in a future PR.
- Fixed grammar problems across the file.
- Added more information about longer commits.
juanjqo and others added 24 commits December 8, 2022 10:58
Now, when ith==n_links the effector is not taken into account.
…pose_jacobian, and raw_pose_jacobian_derivative
Conversion of DQ_SerialManipulator to an abstract class
[DQ_SerialManipulator] Added the protected property joint_types. Furthermore, I implemented the methods set_joint_types, set_joint_type, get_joint_types and get_joint_type. 

[DQ_SerialManipulatorDH, MDH] Updated the subclasses to comply the modifications made in DQ_SerialManipulator
[DQ_SerialManipulator] Added the abstract and protected method get_supported_joint_types().

[DQ_SerialManipulatorDH, MDH] Implemented the method get_supported_joint_types() in both subclasses to comply the modification in DQ_SerialManipulator.
@juanjqo juanjqo marked this pull request as draft January 4, 2023 06:49
@juanjqo juanjqo marked this pull request as ready for review January 4, 2023 06:54
@bvadorno
Copy link
Member

bvadorno commented Jan 5, 2023

Hi @juanjqo,

I noticed that you modified the CONTRIBUTING.md file, but I'm not sure what the modifications are concerning the version currently in the MASTER repository. Please clarify.

Best,
Bruno

@bvadorno
Copy link
Member

bvadorno commented Jan 5, 2023

Hi @juanjqo,

I noticed that you modified the CONTRIBUTING.md file, but I'm not sure what the modifications are concerning the version currently in the MASTER repository. Please clarify.

Best, Bruno

I guess I understand what happened. After I rebased pull request #75, the commit messages of this pull request of yours got in the way. Somehow, the diff tool might not be working properly. Two clues make me believe that. First, this pull request still has the commit messages from before the rebasing. Second, it indicates that you want to add the DQ_JointType class and the CONTRIBUTING.md file, but you already did this.

I'm going to reject this pull request. Then, update your branch and open a new pull request.

Thanks,
Bruno

@bvadorno bvadorno closed this Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] The subclasses of DQ_SerialManipulator allow the use of any type of joints

2 participants