set realtime prio before executing launchfile
I’m using the Elfin robot arm and to launch it you need to execute the following command:
sudo chrt 10 bash
then in the same terminal you can launch the controller by running:
roslaunch elfin_robot_bringup elfin_ros_control_v2.launch
Now I’m automating the launch of all the nodes, but I have no idea how I can execute ‘sudo chrt 10 bash’ using my launch file. I'm looking for a 'clean' solution, and hope it doesn't include calling a bash script.
What is a good /safe way to execute both commands after each other in the same shell? hope someone can help me further.
Does #q246090 cover this?
And actually I would suggest having the driver binary itself request the RT priority. That would be a lot easier and have better UX.
I'll look into it. Having the driver request RT is exactly what I want. I'll update when It worked :).
Not sure you understood what I meant.
I'm suggesting to add something like this to the driver binary itself: ur_robot_driver/src/ros/hardware_interface_node.cpp; lines 59 to 106.
Not in a
.launch
file.Thanks for the example code! doing it in the driver itself is what I want, i like to keep launch files only for launching ( as simple as possible)
technically
.launch
files encode the configuration of the application (together with.yaml
and some other files). The priority at which processes started by.launch
files are run could be considered configuration.Hiding scheduling configuration in node binaries essentially makes it impossible to introspect or change that configuration, reducing the control a
.launch
file can exert over that aspect of the application.I'm not saying you shouldn't do it, just highlighting some disadvantages.