-
Notifications
You must be signed in to change notification settings - Fork 310
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
release_interfaces does not seem to work (or not work as expected) #1476
Comments
Hello @firesurfer! The ros2_control/controller_interface/src/controller_interface_base.cpp Lines 104 to 108 in b989f70
I've a question if the activation is failure from the controller side, why should the hardware switch the interfaces?, here you are not providing a new interface switching right?. You can always switch to a different interface by launching a different controller. If you are interested in switching back to the old hw state if the activation fails, then maybe we can always have the old HW state and switch back if it fails. I believe this could be implemented. if this is the case, feel free to open a PR. |
Hi @saikishor
From the point of view of a hardware interface I get a list of interfaces to be started and a list of interfaces to be stopped. In my implementation I actually remember which interface was claimed and only release it when it was in the stop list at some point. If I fail the activation of a control an interface will be in the start list by will never be in the stop list. So if I start another controller my hardware interface says: Hey this interface has been claimed. The reason why I store which interface was claimed is: My hardware supports three modes (position, velocity,torque). My hardware interface manages multiple axes at one. This means I have per axis the following three interface.
So for example if the position interface of As far as I know there is no other way in ros2control at the moment to have exclusive command interfaces for a certain axis/joint? |
@firesurfer I've already noticed that there is no release interfaces called in the following condition when the activation is failed ros2_control/controller_manager/src/controller_manager.cpp Lines 1507 to 1515 in b989f70
|
@saikishor As I wrote I call |
@firesurfer Ideally when you clear the list, it should be released as the ros2_control/hardware_interface/src/resource_manager.cpp Lines 981 to 985 in b989f70
I'll take a closer look later. 👍 |
@saikishor I see your point. I think by issue is of a different nature (exclusive interfaces). Shall I open a different issue for that or is there already a solution that I am not aware of? |
@firesurfer I recommend adding some introspection logs or some debug info to see if it is really calling the |
@saikishor I am pretty sure that The structure is:
|
@firesurfer I meant to add some logs to the Have a great day :) |
Hi @saikishor as I really need to get my controller working this week I won't be able to put any time into debugging this and will just work around this issue. :( I also wish you a great day! |
OK when you have time, debug it and let us know. Thanks |
Hey @saikishor I didn't debug this further but I think the issue I am facing is not originating from As I wrote above I have a EDIT: |
@firesurfer you mentioned earlier that the interfaces are left in claimed state in the Resource Manager, is this is the case I don't think it is in your hardware component. I suggest to introspect further. If you are fine with your work around and not clear of the exact issue, then I recommend to close this issue. Thanks. Have a great day |
@saikishor I think I got the terminology wrong here (Or as I wrote in the title does not work as I expected it). I guess the issue is rather about: How to safely implement exclusive command interfaces. |
If this is the case, it's upto the Hardware components to decide it they allow both interfaces to be enable at same time or not, so maybe we should rethink the strategy for exclusive interfaces. Do you have an idea on how to deal with it?. Can you come up with a PR so we can get it in for Jazzy? |
@firesurfer will you be able to write a test that reproduces the issue? |
@saikishor I close this issue in favor of #1487 |
Describe the bug
I have a controller which may decide to return
return controller_interface::CallbackReturn::FAILURE;
in case my hardware is in a state that is not usable in combination with the controller.Prior to this I call
release_interfaces
but this does not seem to call acommand_mode
switch in the corresponding hardware interface in order to stop the interfaces.In the corresponding header file
controller_interface_base.hpp
there is no available documentation for this method:To Reproduce
Return
return controller_interface::CallbackReturn::FAILURE
fromon_activate
. And callrelease_interfaces
before.Expected behavior
In general I would expect a controller that can not be successfully activated to release the claimed interfaces.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: