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

Revision history [back]

In general this is a very open ended question. When you think about selecting how fast a control loop should run you must first consider how fast you are required to run for the desired behavior. Take the case of say a heating system for a single room, running at 1kHz doesn't make sense because the thermal response of a room only happens so quickly and a programmer would probably design the control loop to run at something between 1-50Hz. Now let's consider the PR2, the "real-time" loop on the PC of the PR2 aims to provide a current control to the motor controller boards at 1kHz however some controllers overrun the 1ms computation time, making the PR2 high level control semi real time. However in hardware, on the motor controller board, the current loop of the PR2 is controlled at strictly 1kHz.

In general you could always choose to run a control loop faster, especially in hardware like an embedded system. However the question is still does the system require/need to receive control updates or measurements that quickly and can you write efficient enough code that will not overrun the control loop cycle. There are many applications that require controllers to run at 5-10kHz these are typically implemented at the embedded level.

All of the above statements also reflect systems that are running soft-real time or hard-real time where the system time step is very close to or exactly the same every loop update. Running over wifi would not be even close to real time and would introduce all sorts of latency problems making the system near to uncontrollable. In general ROS is not designed for doing real time control, it is based on a TCP or UDP model and both do not care about transmitting data in a timely fashion and tend to introduce latency into the system. That is why it is prefer to use other protocols like EtherCAT to ensure low latency communication between nodes in a system.

Finally many people choose a rate of 1kHz because it's "fast enough" for the system they are trying to control, not because there was any specific calculation that lead them to that decision.