ros-controls / ros2_control

Generic and simple controls framework for ROS 2
https://control.ros.org
Apache License 2.0
465 stars 283 forks source link

Tests on RT-PREEMPT #118

Open olivier-stasse opened 4 years ago

olivier-stasse commented 4 years ago

This issue is to track the implementation of a github-action runner using Linux RT-PREEMPT

The main issue with this thread is to implement a test to check if the main ros_control part are breaking minimal real-time requirements.

Example: For torque control robot, a minimal 1 KHz loop is required. It also implies having at least 800 us free for computation over 1 ms. This time is typically what is required to solve a Quadratic Program with a robot of 30 DoFs with various local control with sensor feedback. The middleware foot print has to be minimal, i.e. not more than few tens of microseconds on a normal laptop.

TO DO list

Remarks

The issue will be edited depending on the feedback

olivier-stasse commented 4 years ago

Some real-time results on the computer with a Linux v5.4.47 kernel with the RT_PREEMPT patch:

sudo ./cyclictest -a -t -n -p99
[sudo] password for ostasse: 
# /dev/cpu_dma_latency set to 0us
policy: fifo: loadavg: 1.16 1.25 0.57 1/472 1496           

T: 0 ( 1491) P:99 I:1000 C: 103515 Min:      3 Act:   13 Avg:   12 Max:      30
T: 1 ( 1492) P:99 I:1500 C:  69010 Min:      3 Act:   12 Avg:   12 Max:      40
T: 2 ( 1493) P:99 I:2000 C:  51757 Min:      3 Act:   13 Avg:   12 Max:      45
T: 3 ( 1494) P:99 I:2500 C:  41406 Min:      3 Act:   12 Avg:   13 Max:      40

The kernel is compiled without the ACPI option. When it is left the last column is reaching 7000 to 8000 microseconds of latencies, instead of the current 30-45 us. See https://www.redhat.com/sysadmin/real-time-kernel for similar results.

olivier-stasse commented 4 years ago

Test on setting a self-hosted runner done. see https://github.com/olivier-stasse/ros2_control/runs/870780047?check_suite_focus=true

olivier-stasse commented 4 years ago

@bmagyar: To use the computer for the repository or the organisation (it would be probably better to add the runner only to the repository for a test) the instructions to go through are the following:

Setting -> Actions -> Add Runner.

The interface propose to choose the operating system ('Linux' is needed) and the architecture ('X64' is needed)

During the creation (and ONLY during) the interface provides instructions to install the services on the runner. I need you to send me the instructions.

Let me know when it is convenient for you to do this.

bmagyar commented 4 years ago

@olivier-stasse I've sent an email with the instructions to you to your @laas.fr email, thanks for following up on this :+1:

Also, you may find these useful/inspiring for some test implementations: https://github.com/ros2/realtime_support

olivier-stasse commented 4 years ago

Dear @bmagyar on my side the runner is working and ready. Let me know if it is not working for you.

destogl commented 3 years ago

This is connected #48 and it replaces is actually.