motion aborted by reflex! 【communication_constraints_violation】 错误解决办法

很有可能是主频降频了

libfranka: Move command aborted: motion aborted by reflex! ["communication_constraints_violation"]
control_command_success_rate: 0.733765 packets lost in a row in the last sample: 1
libfranka: Move command aborted: motion aborted by reflex! ["communication_constraints_violation"]
control_command_success_rate: 0.733765 packets lost in a row in the last sample: 1
 

Motion stopped due to discontinuities or communication_constraints_violation

If the difference between commanded values in subsequent time steps is too large, then the motion is stopped with a discontinuity error such as joint_motion_generator_velocity_discontinuity. See if the commanded values do not exceed the limits.

Discontinuities can occur if your code commands actual jumps to the robot, but also because of network packet losses. This is also the reason for communication_constraints_violation errors. If the issue occurs even when using the provided examples, the problem is most likely related to overall communication quality. To ensure best performance, please check the following:

  • All source code is compiled with optimizations (-DCMAKE_BUILD_TYPE=Release). If you installed libfranka and franka_ros from the ROS repositories, this is already the case for these projects. However, your own source code needs to be compiled with optimizations as well.
  • Connect your PC directly to Control, without using any intermediate switches. The network setup instructions describe how to do this.
  • Verify your network connection by executing the network bandwidth, delay and jitter test.
  • franka::Robot is instantiated with RealtimeConfig::kEnforce. This is the default if no RealtimeConfig is explicitly specified in the constructor.
  • Power saving features are disabled (cpu frequency scaling, power saving mode, laptop on battery, BIOS power saving features, etc.). See Disabling CPU frequency scaling.

Disabling CPU frequency scaling

CPUs are often configured to use a lower operating frequency when under a light load in order to conserve power. We recommend to disable this feature as it leads to higher latencies when using libfranka. To check and modify the power saving mode, install the cpufrequtils package:

sudo apt install cpufrequtils

Run cpufreq-info to see available “governors” and the current CPU frequency. Here is an example output:

$ cpufreq-info
...
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 0.97 ms.
  hardware limits: 400 MHz - 3.00 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 400 MHz and 3.00 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency is 500 MHz.
...

In this example, the maximum frequency is 3 GHz, but the current one is 500 Mhz due to the powersave policy. In this case we can benefit by setting the governor to performance.

To change this setting using the Ubuntu GUI, install the indicator-cpufreq package. A widget in the top bar of the Unity user interface should allow you to set the current policy.

To change this setting using the terminal, execute the following commands:

sudo systemctl disable ondemand
sudo systemctl enable cpufrequtils
sudo sh -c 'echo "GOVERNOR=performance" > /etc/default/cpufrequtils'
sudo systemctl daemon-reload && sudo systemctl restart cpufrequtils

performance,顾名思义只注重效率,无论如何一直保持以最大频率运行(franka操作要选择这个模式)。

powersave,是无论如何都只会保持最低频率的所谓“省电”模式(这个为默认模式,需要改为performance模式);

ondemand,默认模式。一有cpu计算量的任务,就会立即达到最大频率运行,等执行完毕就立即回到最低频率;

They will disable the ondemand CPU scaling daemon, create a /etc/default/cpufrequtils configuration file, and then restart the cpufrequtils service.

After enabling the performance governor, the cpufreq-info results are:

$ cpufreq-info
...
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 0.97 ms.
  hardware limits: 400 MHz - 3.00 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 400 MHz and 3.00 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 2.83 GHz.
...

Now the example output shows a CPU frequency close to the maximum one. You can also directly verify the current governor using the cpufreq-info -p command.

猜你喜欢

转载自blog.csdn.net/dbdxnuliba/article/details/116198141