How to run a node with realtime priority
What's the appropriate launch-prefix to use to make a node run with realtime priority?
I have a node that relays low-level motor control commands to an Arduino over a USB serial line, and the default node has really bad latency. Sometimes it can take up to 10 seconds for the node to accept a service command (e.g. stop all motors!), which obviously can be fatal to the robot in some circumstances.
I know you're supposed to use the "launch-prefix" argument in the launch file to set the node's process priority via nice, but what are the best nice values to use? Would this combination of nice and ionice be appropriate for running a node in near-realtime?
nice -n 19 ionice -c1 -n0
Are you sure that this is possible in a launch file? A normal user cannot run nice with negative values.