ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Real time ROS node without ROS control, orocos?

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

Winston gravatar image

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

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
2

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

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.

https://wiki.linuxfoundation.org/real...

2) Setup your Controller as RT-application

https://wiki.linuxfoundation.org/real...

https://wiki.linuxfoundation.org/real...

3) Allow RT priorities from Userspace

https://rt.wiki.kernel.org/index.php/...

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

Comments

Does ros_control provide realt-time capability already?

Winston gravatar image Winston  ( 2017-05-17 11:15:04 -0500 )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 -0500 )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 -0500 )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. https://github.com/skohlbr/rtt_ros_co... ).

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

Question Tools

4 followers

Stats

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

Seen: 1,184 times

Last updated: May 12 '17