-
Notifications
You must be signed in to change notification settings - Fork 4
Added a new example to test the DQ_JointType class and the setter and… #21
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
Conversation
… getter methods related to the joint types in the DQ_SerialManipulator class.
mmmarinho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check that one comment. I’m happy to give more info if you need.
| } | ||
|
|
||
| template<typename T> | ||
| void perform_tests(const std::shared_ptr<T>& robot, const std::string& msg, const bool& is_denso){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @juanjqo.
This is a bit strange. You don’t need the flag if you’re using a template. You can check the type and switch accordingly. That will be more scalable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mmmarinho, thanks for your feedback. I removed the flag. Now, I am checking the type using the following approach
auto denso = std::dynamic_pointer_cast<DQ_SerialManipulatorDenso>(robot);
if (denso)
target_joint_type = DQ_JointType::REVOLUTE;I wonder if this is the right strategy.
Kind regards,
Juancho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @juanjqo,
This would be a good example:
https://github.com/SmartArmStack/sas_common/blob/cc092fd6f156c4cabb6dd48d0476261c1a639067/include/sas_common/sas_common.hpp#L59
The thing to keep in mind with templates is to always try to solve things at compilation time. Your check is in runtime so it wouldn’t fully take advantage of the template capabilities.
That example is C++17 compliant I believe. If we agree that it’s time to update our standard then it’s fine.
Otherwise you can use template specialization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @juanjqo, I implemented the modifications. =)
…tests function, as suggested by Murilo.
…e robot type in compilation time.
Hi @dqrobotics/developers ,
This PR adds a new example to test the new setter and getter methods in the DQ_SerialManipulator class related to the joint types. The example requires dqrobotics/cpp#70.
Kind regards,
Juancho