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

[Question / Feature Request] - Is there a way to list _all_ controllers (not just loaded controllers) #1527

Open
firesurfer opened this issue May 8, 2024 · 5 comments

Comments

@firesurfer
Copy link
Contributor

Hi,

I am looking for a way to list all controllers that are known to ros2control, not just loaded ones as
ros2 control list_controllers does.

By all controllers I mean all the controllers that are defined in the controllers.yaml file.

Thanks a lot in advance!

@fmauch
Copy link
Contributor

fmauch commented May 8, 2024

I was asking myself the same thing recently, also given that the rqt plugin shows all of them.

@saikishor
Copy link
Member

I think the rqt_plugin uses the info from the list_controllers topic

def _update_controllers(self):
if not self._cm_name:
return
# Find controllers associated to the selected controller manager
controllers = self._list_controllers()
# Update controller display, if necessary
if self._controllers != controllers:
self._controllers = controllers
self._show_controllers() # NOTE: Model is recomputed from scratch

I'm not sure if there is a way to read it and display it, I'm not sure if this feature is necessary, as in the future we might want to move the definition of the controller types from the original yaml that is parsed to the controller_manager node (ros-controls/ros2_control_demos#502), in that case, it would be hard to read the all available controller. However, what can be seen is the available controller types.

@firesurfer
Copy link
Contributor Author

As far as I can tell the list_controllers topic only lists loaded controllers but not defined controllers.

I'm not sure if there is a way to read it and display it, I'm not sure if this feature is necessary, as in the future we might want to move the definition of the controller types from the original yaml that is parsed to the controller_manager node (ros-controls/ros2_control_demos#502), in that case, it would be hard to read the all available controller. However, what can be seen is the available controller types.

Well at some point the controller manager has to know about available controllers, otherwise it would not be possible to load them. So it should also be possible to expose them to the user.

The reason I want to access them is that I define a list of controllers in our application framework which then can be used by users for certain operations. At startup I would like to check if that list matches with the controllers known to the controllers manager.

@saikishor
Copy link
Member

Well at some point the controller manager has to know about available controllers, otherwise it would not be possible to load them. So it should also be possible to expose them to the user.

Well not necessarily, it is indeed possible to load them dynamically(#1502 and #1293). I have added this feature very recently. The controller manager doesn't have to know the name of the controller, the user should be able to load any type of controller with whatever name he wants.

If you want to verify the list, why don't you spawn all the controllers with --load-only option and then just validate the list, and you could be able to activate and deactivate from there on.

@firesurfer
Copy link
Contributor Author

Okey it somehow makes sense if it is possible to load controller at runtime. Even though from the description I would expect it still to be possible to determine loadable controllers at a certain point of time (as we can only load controllers we know the configuration of)

(Btw. does this mean: #982 is solved now?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants