-
Notifications
You must be signed in to change notification settings - Fork 311
Description
I'm using a PS5 controller (bluetooth connection), Ubuntu 22.04, Ros2 Humble. I use the game_controller_node for compatibility with different machines.
I found an issue with what I thought was the autorepeat. I have set up a twist mux with navigation and controller as inputs. The controller has a higher priority, so I tried using it as a stop button. When pressing the enable button, since the node has autorepeat_rate at 20Hz, it should publish an empty twist at 20Hz, which would be the output of the mux.
However, the navigation cmd_vel was not being stopped, only intermittently.
I started investigating the publishing rate of the /joy topic and found that, when it is just launched, the rate is around 15Hz, which is more than acceptable. But after moving the joysticks and buttons around, the rate drops to 0. Relaunching the node works, but I think there's a bug somewhere limiting the publishing rate.
For clarification, the rate only drops when not pressing buttons or moving joysticks. So the node works "normally", except when sending empty messages.
An extract of using ros2 topic hz /joy
:
average rate: 13.872
min: 0.050s max: 0.100s std dev: 0.02424s window: 16
average rate: 14.812
min: 0.049s max: 0.101s std dev: 0.02338s window: 32
average rate: 14.132
min: 0.049s max: 0.170s std dev: 0.02788s window: 45
average rate: 20.602
min: 0.001s max: 0.170s std dev: 0.04363s window: 87
average rate: 40.553
min: 0.001s max: 0.170s std dev: 0.03624s window: 212
average rate: 43.453
min: 0.001s max: 0.176s std dev: 0.03528s window: 272
average rate: 37.328
min: 0.000s max: 1.162s std dev: 0.07567s window: 287
average rate: 28.745
min: 0.000s max: 2.128s std dev: 0.14352s window: 294
average rate: 33.467
min: 0.000s max: 2.128s std dev: 0.12760s window: 384
average rate: 41.890
min: 0.000s max: 2.128s std dev: 0.11034s window: 531
average rate: 38.102
min: 0.000s max: 2.128s std dev: 0.12537s window: 567
average rate: 32.563
min: 0.000s max: 2.562s std dev: 0.16428s window: 568
average rate: 18.694
min: 0.000s max: 12.995s std dev: 0.56729s window: 569
average rate: 14.158
min: 0.000s max: 12.995s std dev: 0.69710s window: 571
average rate: 13.798
min: 0.000s max: 12.995s std dev: 0.69788s window: 572
average rate: 13.517
min: 0.000s max: 12.995s std dev: 0.69713s window: 574
average rate: 13.165
min: 0.000s max: 12.995s std dev: 0.69813s window: 575
After a bit of use, the max period grows. The ~12s appeared after I pressed a button, it was not sending anything for a very long time. It can also be seen how the window increases by 1 at the end, that were the single button presses that I was doing every 1 or 2 seconds to test. Nothing else published in that period.