joystick_drivers
joystick_drivers copied to clipboard
Fix publishing of spacenav button values
Problem
The spacenav buttons are currently only published once upon being triggered. They are thus flooded by the other, continuously published motion events.
Approach
We now always publish the two default button states, in which 0 = not pressed 1 = pressed.
That's the previously known ROS1 behavior.
Additional buttons emerge and stay in that list upon being pressed for the first time. This supports more advanced spacenav devices with a yet unknown number of buttons.
Fixes #223
What the fix looks like
ros2 topic echo /spacenav/joy
:
No buttons pressed:
Both buttons pressed:
Also addresses #190 and #192 for ROS2.