moveit / moveit2

:robot: MoveIt for ROS 2
https://moveit.ai/
BSD 3-Clause "New" or "Revised" License
1.06k stars 516 forks source link

Servo cannot reach the desired control rate #2955

Closed AndyZe closed 2 months ago

AndyZe commented 2 months ago

Description

Launch a Servo demo, e.g.

ros2 launch moveit_servo demo_ros_api.launch.py

ros2 run moveit_servo servo_keyboard_input

Monitor the joint command publication rate:

ros2 topic hz -w 500 /panda_arm_controller/joint_trajectory

It's nowhere close to the desired rate of 100 Hz. I get ~60 Hz. Not sure exactly when this regression happened but I suspect PR #2651.

AndyZe commented 2 months ago

It looks like changing to the online_signal_smoothing::ButterworthFilterPlugin instead of online_signal_smoothing::AccelerationLimitedPlugin does help, it increases the control rate to ~75 Hz. But that's still lower than the requested 100Hz, which used to be easy to achieve. Previously 1,000 Hz was achievable.

sea-bass commented 2 months ago

I see a lower rate when I try to toggle directions back and forth, maybe because there is some dead time in between switching keys somewhere between me and what servo receives.

But if I just hold down a button and go right into joint limits/singularity, I hit 100 Hz no problem on my 4 year old laptop?

https://github.com/user-attachments/assets/cd3a77b2-6482-47fb-9d7c-c0e4a440cd7a

sea-bass commented 2 months ago

Here's another one in which I am just spamming arrow keys in twist mode.

https://github.com/user-attachments/assets/875d9217-620a-4c5b-81af-47c70074c50b

AndyZe commented 2 months ago

You're right, it must be some kind of Linux button debouncing issue.