Skip to content
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

Port transmission loader plugins #633

Merged
merged 19 commits into from
Feb 16, 2022

Conversation

VX792
Copy link
Contributor

@VX792 VX792 commented Jan 31, 2022

My draft PR for the following issue: #599

Basic structure added for TransmissionLoader, including the SimpleTransmissionLoader plus tests for SimpleTransmissionLoader.
When I tested it everything seemed to work, but I'm not sure how I should proceed with the InvalidSpec testcase, since it segfaults while parsing the following:

transmission_interface/SimpleTransmission

The ROS Noetic version has a test case similar to this one. Should I just ignore this?
I'll probably use EXPECT_THROW for the rest.

Also, if I'm planning on porting the other transmission loaders too, should I open a separate PR for those?
Also, where should I place the URDFs I used for the tests?

VX792 added 2 commits January 31, 2022 21:56
-Rewrite the test cases for it based on the ROS Noetic version
-Modify the package.xml and the CMakeLists.txt to accomodate the pluginlib
@bmagyar
Copy link
Member

bmagyar commented Jan 31, 2022

Awesome!
Could you add a few more details regarding that test case please, I'm not sure I got it.

Also, if I'm planning on porting the other transmission loaders too, should I open a separate PR for those?
A separate PR please, I intend to merge this as soon as we can.

Also, where should I place the URDFs I used for the tests?
You can put the URDFs here: https://github.com/ros-controls/ros2_control/tree/master/ros2_control_test_assets/include/ros2_control_test_assets

@VX792
Copy link
Contributor Author

VX792 commented Jan 31, 2022

Yes of course. I wanted to create something similar to the URDF used here, so there will be an invalid test case

https://github.com/ros-controls/ros_control/blob/noetic-devel/transmission_interface/test/urdf/simple_transmission_loader_invalid.urdf

but I think that parsing the first transmission gives us a segfault for some reason. I didn't encounter this problem when I set the mechanical reduction to zero, or to a string. In the latter case an exception is raised as expected.

@destogl destogl linked an issue Feb 1, 2022 that may be closed by this pull request
3 tasks
@bmagyar
Copy link
Member

bmagyar commented Feb 4, 2022

ok so the crash is an issue with the parser, we should fix that but that could be done on a follow-up issue. Can you please comment out that test in the mean time please? leave a //TODO note above explaining when it can be reenabled

VX792 added 2 commits February 4, 2022 21:00
MinimalSpec and InvalidSpec test case added
+preCommit
@VX792 VX792 force-pushed the port-transmission-loader-plugins branch from 731aec2 to 625eff2 Compare February 4, 2022 20:57
@VX792 VX792 marked this pull request as ready for review February 7, 2022 11:35
@bmagyar bmagyar requested review from bmagyar and destogl February 8, 2022 08:29
@bmagyar
Copy link
Member

bmagyar commented Feb 8, 2022

Pinging @saikishor for a due-diligence license approval from PAL.

VX792 and others added 8 commits February 8, 2022 11:16
…ransmission_loader.hpp

Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
…sion_loader.hpp

Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
…sion_loader.hpp

Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
…sion_loader.hpp

Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
@saikishor
Copy link
Member

Pinging @saikishor for a due-diligence license approval from PAL.

LGTM

Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution.
I added a lot of nit-picking and maybe some of my comments are missing the point, but I would like to get explained why some things are designed as they are.

This represents a very core of the transmission-management functionality, let's get it right.

Comment on lines +378 to +382
int main(int argc, char ** argv)
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really needed? We don't have this in the test files usually. At least the one using gmock instead of gtest library.

Suggested change
int main(int argc, char ** argv)
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can fix this in #642 . The trick is to link your tests binary to a library called "gmock_main".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed over there

bmagyar and others added 3 commits February 14, 2022 08:54
Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>
Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>
Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>
@destogl destogl merged commit f5ef068 into ros-controls:master Feb 16, 2022
pac48 pushed a commit to pac48/ros2_control that referenced this pull request Jan 26, 2024
…ls#618) (ros-controls#633)

* Use branch name substitution for all links (ros-controls#618)

(cherry picked from commit aece974)

---------

Co-authored-by: Christoph Fröhlich <christophfroehlich@users.noreply.github.com>
Co-authored-by: Dr. Denis <denis@stoglrobotics.de>
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.

Port TransmissionLoader from ROS Noetic over to ROS2
4 participants