Skip to content

Add BEST EFFORT controller switch tests for Controller Manager #521

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

Open
destogl opened this issue Sep 7, 2021 · 7 comments · May be fixed by #2177
Open

Add BEST EFFORT controller switch tests for Controller Manager #521

destogl opened this issue Sep 7, 2021 · 7 comments · May be fixed by #2177

Comments

@destogl
Copy link
Member

destogl commented Sep 7, 2021

We could probably use parameterized tests for this to save some code.

Originally posted by @destogl in #461 (comment)

Description:

  • File: controller_manager/test/test_controller_manager.cpp
  • each test where controller switching is done has to be done also with BEST_EFFORT - this means that the test will have to be duplicated (we can optimize/reduce code in the second step)
  • one example line with STRICT controller switch is here
  • BEST_EFFORT means the following: if we have a situation where multiple controllers "are switched" and can not be switched the all other that can will be still switched
  • this feature is not documented very well - please also add documentation into controller_manager/doc/userdoc.rst
@Xi-HHHM
Copy link
Contributor

Xi-HHHM commented Nov 11, 2021

Please assign to me.

@christophfroehlich
Copy link
Contributor

@Xi-HHHM and I talked yesterday about further steps and that would be:

  • split current test into "lifecycle test" and "activating multiple controllers when one is unknown"
  • add test for "activating multiple controllers when one has a resource collision"

Originally posted by @destogl in #582 (comment)

@ashwinsnambiar
Copy link

@christophfroehlich Can I take up this issue? I am not very familiar with building tests, but I would like to take this opportunity to learn and contribute to the community.

@christophfroehlich
Copy link
Contributor

Very welcome! Writing tests is mostly understanding the intention of the code itself, and copy-pasting other tests ;)
Don't hesitate to ask if something is unclear (I have to read up on this topic as well, I haven't looked into detail yet). But maybe @saikishor can also help fast here.

@saikishor
Copy link
Member

Hello!

https://github.com/ros-controls/ros2_control/blob/master/controller_manager%2Ftest%2Ftest_controller_manager_srvs.cpp

In the above file, there are some tests already present. Better take a look at some coverage builds and understand what else needs to be implemented. I already see some tests with BEST_EFFORT.

@ashwinsnambiar
Copy link

I'll check them out and come back to you if I am stuck somewhere.

@ashwinsnambiar ashwinsnambiar linked a pull request Apr 11, 2025 that will close this issue
6 tasks
@ashwinsnambiar
Copy link

Hey @saikishor @christophfroehlich, sorry for the long delay. I have some questions about the second test for "activating multiple controllers when one has a resource collision". I was thinking of creating a parametric test for both strictness values. I started three controllers, out of which one and two are in resource collision. As expected, in the STRICT mode, the test failed immediately. I was expecting the controllers in BEST_EFFORT mode to remain in blocking until next update cycle, but instead it seems to fail immediately. Is this the way its supposed to work? Is my understanding of the working of the controllers wrong somewhere? Could someone review the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

5 participants