ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Real time ROS node without ROS control, orocos?

asked 2017-05-11 10:47:46 -0600

Winston gravatar image

updated 2017-05-11 10:49:58 -0600

I have a hardware controller node which controls three motors using SOEM with Ethercat. I use a ROS timer in this node with 500 Hz control frequency. However, I find out that the timer is not accurate at all; sometimes there is a 100ms delay and cause the Ethercat to send 'stop-working' commands to motors. So I plan to use a RT_PREEMPT patch to the current Linux kernel to solve the 'jitter' problem. However, I want to solve this problem with least effort possible. So what is the possible shortcut? And are there any problems if I only use the RT_PREEMPT patch without using ros_control or orocos framework as many people are actually using them?

Another problem is how to choose a suitable realtime priority for my hardware controller node?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-05-12 06:26:56 -0600

Jan Carstensen gravatar image

I would suggest the following approach:

1) Setup RT_Preempt

You will need an RTOS anyway, I think RT_Preempt fits your demands.

2) Setup your Controller as RT-application

3) Allow RT priorities from Userspace

4) Find a suitable RT priority

When your controller does not require the entire CPU, this is not a problem. Just pick one (e.g. 80). This should work.

If this is not enough I would recommend trying ros_control.

edit flag offensive delete link more


Does ros_control provide realt-time capability already?

Winston gravatar image Winston  ( 2017-05-17 11:15:04 -0600 )edit

ros_control on its own cannot provide real-time capabilities. It can, however, offer real-time safe functions. In any case, a real-time operating system (e.g. RT Preempt) is required.

Jan Carstensen gravatar image Jan Carstensen  ( 2017-05-18 07:53:23 -0600 )edit

What do you mean by real-time safe functions? If I use ros_control, do I still needs to do 1) to 4) steps as you posted as the answer?

Winston gravatar image Winston  ( 2017-05-18 08:54:36 -0600 )edit

Your controller node will need to communicate with other ROS-nodes, this communication is not real-time safe. ros_control offers functions that separate this into a second thread.

You will either need 1-4 or only 1 and use orocos (e.g. ).

Jan Carstensen gravatar image Jan Carstensen  ( 2017-05-18 09:08:00 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-05-11 10:47:46 -0600

Seen: 1,099 times

Last updated: May 12 '17