joystick_drivers icon indicating copy to clipboard operation
joystick_drivers copied to clipboard

Fix publishing of spacenav button values

Open stefanscherzinger opened this issue 2 years ago • 1 comments

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: Screenshot from 2022-11-15 15-38-49

Both buttons pressed: Screenshot from 2022-11-15 15-41-14

stefanscherzinger avatar Nov 15 '22 14:11 stefanscherzinger

Also addresses #190 and #192 for ROS2.

stefanscherzinger avatar Nov 15 '22 15:11 stefanscherzinger