-
Notifications
You must be signed in to change notification settings - Fork 13
This commit fixes the bug #76 #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
99f9e8e
This commit fixes the bug #76
juanjqo 51e67ca
This commit fixes the method get_supported_joint_types().
juanjqo b3ac4bf
[DQ_SerialManipulator] Fixed comments as requested by Bruno.
juanjqo a648fe8
This commit updated the year of the copyright.
juanjqo 559a5b6
[DQ_SerialManipulator.m] Fixed comment
juanjqo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ | |
| % | ||
| % See also DQ_Kinematics. | ||
|
|
||
| % (C) Copyright 2011-2022 DQ Robotics Developers | ||
| % (C) Copyright 2011-2023 DQ Robotics Developers | ||
| % | ||
| % This file is part of DQ Robotics. | ||
| % | ||
|
|
@@ -51,6 +51,7 @@ | |
| % mainly in the plot function. | ||
| handle | ||
| n_links; | ||
| joint_types; | ||
| end | ||
|
|
||
| methods (Abstract, Access = protected) | ||
|
|
@@ -73,9 +74,50 @@ | |
| % Human-Robot Collaboration' by Bruno Adorno. | ||
| % Usage: w = get_w(ith), where | ||
| % ith: link number | ||
| w = get_w(obj,ith) ; | ||
| w = get_w(obj,ith) ; | ||
| end | ||
|
|
||
| methods (Abstract, Static, Access = protected) | ||
| % This method returns the supported joint types. | ||
| st = get_supported_joint_types(); | ||
| end | ||
|
|
||
| methods (Access = protected) | ||
| function check_joint_types(obj) | ||
| % CHECK_JOINT_TYPES() throws an exception if the joint types | ||
| % are different from the supported joints. | ||
| types = obj.get_joint_types(); | ||
| supported_types = obj.get_supported_joint_types(); | ||
| n = size(types, 2); | ||
| k = size(supported_types, 2); | ||
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| % Create a string containing the valid type of joints. | ||
| msg = 'Unsupported joint types. Use valid joint types: '; | ||
| for i=1:k | ||
| msg_type = ' DQ_JointType.' + string(supported_types(i)); | ||
| if i==k | ||
| ps = '. '; | ||
| else | ||
| ps = ', '; | ||
| end | ||
| msg = msg + msg_type + ps; | ||
| end | ||
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| for i=1:n | ||
| match = false; | ||
| for j=1:k | ||
| if types(i) == supported_types(j) | ||
| match = true; | ||
| break; | ||
| end | ||
| end | ||
| if match == false | ||
| error(msg); | ||
| end | ||
| end | ||
| end | ||
| end | ||
|
|
||
| methods | ||
| function obj = DQ_SerialManipulator() | ||
| obj.reference_frame = DQ(1); %Default base's pose | ||
|
|
@@ -98,6 +140,32 @@ function set_effector(obj,effector) | |
| % SET_EFFECTOR(effector) sets the pose of the effector | ||
| obj.effector = DQ(effector); | ||
| end | ||
|
|
||
| function set_joint_types(obj, joint_types) | ||
| % SET_JOINT_TYPES(joint_types) sets the joint types. | ||
| % 'joint_types' is a vector containing the joint types. | ||
| obj.joint_types = joint_types; | ||
| obj.check_joint_types(); | ||
| end | ||
|
|
||
| function set_joint_type(obj, joint_type, ith_joint) | ||
| % SET_JOINT_TYPE(joint_type, ith_joint) sets the joint type of the ith | ||
| % joint. | ||
| % 'joint_type' type of joint to be set. | ||
| % 'ith_joint' ith joint to be set. | ||
| obj.joint_types(ith_joint) = joint_type; | ||
| obj.check_joint_types(); | ||
| end | ||
|
|
||
| function ret = get_joint_types(obj) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change it according to my comment for the set_joint_type method. |
||
| % GET_JOINT_TYPES() returns a vector containing the joint types. | ||
| ret = obj.joint_types; | ||
| end | ||
|
|
||
| function ret = get_joint_type(obj, ith_joint) | ||
| % GET_JOINT_TYPE(ith_joint) returns the joint type of the ith joint. | ||
| ret = obj.joint_types(ith_joint); | ||
| end | ||
|
|
||
| function x = fkm(obj,q, ith) | ||
| % FKM(q) calculates the forward kinematic model and | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.