-
Notifications
You must be signed in to change notification settings - Fork 298
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
How to define and load controller at runtime #982
Comments
This is not ros2_control issue. It is how parameters are using in ROS 2. You cannot set parameters using the service interface for the node that does not exist. Loading yaml file is a different mechanism that works only at the moment when a node is created. Maybe there are option to add parameters into “staging” for non-existing nodes, but this questions is rather something for Would loading and then setting parameters for the controller not work in your case? This might be the solution. It would be for sure a correct solution, in my oppinion. |
Perhaps something |
@destogl I think this might be a ros2_control issue as this feature request actually reads the Perhaps to elaborate a bit why I would like to have this feature. I have a system consisting of a large set of linear axes which can each either be controller in torque, velocity or position mode. Usually they are controlled in position mode, but for some actions we need to have some of them in position mode and some of them in torque mode. In the next step we want to swap these sets. At the moment I solved this by defining a controller which has all axes in position mode, and then multiple controllers which have a subset of the axes for position and torque mode. This leads in the end to having a lot of controllers with the same parameters which only differ in the joints they controller. If I could change the joints a controller manages at runtime this would be way easier or as requested just define and manage new controllers at runtime.
As it is not possible to change the joints a controller manages after the controller is loaded I think this won't work. |
Currently controllers and their parameters are defined in the
controller.yaml
file we pass the controller manager at startup.I would like to define and load a controller which is not defined in the
controller.yaml
file.What I tried was adding the settings for a new controller at runtime via the parameter server. This is possible up to the point where one wants to define the parameters for that controller. Apparently it is not possible to access the parameters the controller manager passes to a controller before that controller gets loaded.
To better illustrate the problem some excerpts from a controller.yaml file:
I would guess if it was possible to access the parameters of a controller before it is loaded it would be really easy to support defining controllers at runtime as well as changing controllers at runtime (e.g. removing joints from a controller).
The text was updated successfully, but these errors were encountered: