Lenovo Yoga で実行
non-reltime-kernel で以下が表示されるのは当然
$ uname -a
Linux imi-masumi 5.4.0-81-generic #91~18.04.1-Ubuntu SMP Fri Jul 23 13:36:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ sudo ./generate_cartesian_pose_motion 172.16.0.2
WARNING: This example will move the robot! Please make sure to have the user stop button at hand!
Press Enter to continue...
libfranka: Running kernel does not have realtime capabilities.
$
reltime-kernel で以下が表示されるのが原因不明
$ uname -a
Linux imi-masumi 4.14.12-rt10 #1 SMP PREEMPT RT Sat Jul 17 18:45:55 JST 2021 x86_64 x86_64 x86_64 GNU/Linux
$ sudo ./generate_cartesian_pose_motion 172.16.0.2
WARNING: This example will move the robot! Please make sure to have the user stop button at hand!
Press Enter to continue...
libfranka: Move command aborted: motion aborted by reflex! ["communication_constraints_violation"]
control_command_success_rate: 0.488372
$
このエラーをネットで検索すると以下が見つかる
CPUのクロックが低いのか、ネットワークの性能が低いのか
https://github.com/frankaemika/libfranka/issues/60
https://github.com/frankaemika/libfranka/issues/15
https://frankaemika.github.io/docs/troubleshooting.html#motion-stopped-due-to-discontinuities-or-communication-constraints-violation
https://frankaemika.github.io/docs/troubleshooting.html#simple-ping-tests
CPUのクロックを以下のように上げてみる
$ sudo sh -x cpuset.sh
+ sudo cpufreq-set -g performance -d 4600000 -c 0
+ sudo cpufreq-set -g performance -d 4600000 -c 1
+ sudo cpufreq-set -g performance -d 4600000 -c 2
+ sudo cpufreq-set -g performance -d 4600000 -c 3
+ sudo cpufreq-set -g performance -d 4600000 -c 4
+ sudo cpufreq-set -g performance -d 4600000 -c 5
+ sudo cpufreq-set -g performance -d 4600000 -c 6
+ sudo cpufreq-set -g performance -d 4600000 -c 7
$ sh -x cpuinfo.sh
+ cpufreq-info -c 0 -f
4161928
+ cpufreq-info -c 1 -f
3490430
+ cpufreq-info -c 2 -f
3074129
+ cpufreq-info -c 3 -f
3488721
+ cpufreq-info -c 4 -f
3140578
+ cpufreq-info -c 5 -f
4119507
+ cpufreq-info -c 6 -f
3069097
+ cpufreq-info -c 7 -f
3468292
$
pingを実行すると以下の結果
$ sudo ping 172.16.0.2 -i 0.001 -D -c 10000 -s 1200
[1631537154.993952] 1208 bytes from 172.16.0.2: icmp_seq=9998 ttl=64 time=0.819 ms
[1631537154.994909] 1208 bytes from 172.16.0.2: icmp_seq=9999 ttl=64 time=0.776 ms
[1631537154.995916] 1208 bytes from 172.16.0.2: icmp_seq=10000 ttl=64 time=0.783 ms
--- 172.16.0.2 ping statistics ---
10000 packets transmitted, 10000 received, 0% packet loss, time 10059ms
rtt min/avg/max/mdev = 0.360/0.781/0.924/0.031 ms
$ sudo ping 172.16.0.2 -i 0.001 -D -c 10000 -s 1200 | grep rtt
rtt min/avg/max/mdev = 0.216/0.782/0.975/0.050 ms
$ sudo ping 172.16.0.2 -i 0.001 -D -c 10000 -s 1200 | grep rtt
rtt min/avg/max/mdev = 0.300/0.782/0.970/0.052 ms
$ sudo ping 172.16.0.2 -i 0.001 -D -c 10000 -s 1200 | grep rtt
rtt min/avg/max/mdev = 0.287/0.782/0.947/0.049 ms
平均0.78msecだと性能が低い様子