[WIP] Adding template for thread priorization in components at run-time#2373
[WIP] Adding template for thread priorization in components at run-time#2373SteveMacenski wants to merge 1 commit intoros2:rollingfrom
Conversation
Signed-off-by: stevemacenski <stevenmacenski@gmail.com>
a5bbe0e to
50a5682
Compare
|
hi @SteveMacenski, glad to see this draft, I think that I think maybe we could visit the std::thread via the wrapper, and use I am currently working on real time tuning on linux and qnx, If you have better ideas, feel free to let me know. 😸 |
This utility function supports thread configuration for Linux, Windows Mac. A similar version could be used here as well. |
I took a look at this function, it supports QNX as well, very impressive 👍 |
Agreed for the Isolated case. How do we handle this for the normal case where this is simply called while inside of a thread, not in creating one (e.g. we call If that function can handle that and/or be made to handle that, then happy to try to find a home for it as part of this effort. |
This is, however, not documented for |
|
Sure, but your method takes in a |
For windows, change For Mac, QNX, and linux, Thus we don't need take |
Howdy,
Per a conversation with @JanStaschulat at ROSCon / in Nav2 ros-navigation/navigation2#3974: I think it would be dandy to be able to set increase thread prioritizations for soft-realtime in the Composable Node containers. Both to be able to set at launch-time instead of setting on a per-node basis in a stack. In Nav2, there are a couple of nodes we have set able to do this recently, but it would be great if there was a generic way that users could select prioritization more broadly and easily at run-time.
This PR implements a prototype of this behavior that I would like you feedback on to resolve necessary problems seen. I added a
setSoftRealTimePriorityto the ComponentManager that is used to set the prioritization when necessary. By default, I have the priority set to 49 after discussions with Bosch, but we could also make this configurable. Though, there's something to be said about simplicity and the suggestions in the RT workshop had the options of HIGH and LOW, so I think this might be OK to start off with.The way that I see this workflow occurring is the following for Isolated Component Manager:
parametersfield ofLoadComposableNodesor from the parameters inCompositionNodeuse_soft_realtime_priorityto its value in their launch files for the nodes of interestparametersfield ofLoadNodeservice to the component container and sent tooverride_parametersinNodeOptionstruethen we set the prioritizationQ: I believe all of the launch stuff (linked above) is setup already to be able to handle this workflow. Please I would appreciate making sure that's true since the launch_ros package is a little difficult to parse at times.
The way that I see this workflow occurring is the following for Normal Component Manager:
use_soft_realtime_priorityin the Component Manager constructor (false, for off default)truein the Isolated case to increase the prioritization of the Isolated's load/unload/list services. While that's an odd choice, that's a perfectly valid optionI have no questions on this one, I think this is good.