3
$\begingroup$

A non-ros but python or C++ solution like https://github.com/KernelZechs/open-joystick-display (this video shows it off) is what I was originally looking for, and I'll possibly still that use if it immediately works- but it is no longer being maintained and given the language and build process I'm unlikely to be able to quickly make any needed alterations (or discern which is best of all the forks).

But the other route is to do something quickly in a ros node from scratch using the Joy message as an input topic, and publish a crude image or turn all of the Joy message into JointStates and combine with a simple gamepad urdf (and maybe find a free mesh file of an xbox controller to use with it later)- unless something like that already exists?

$\endgroup$
2
  • $\begingroup$ so, what is your exact question? $\endgroup$
    – jsotola
    Feb 12 at 19:13
  • $\begingroup$ If there is an existing package to visualize input from a gamepad that works in ros (and if not in ros then python or C++ which could then be adapted to ros easily, but I can ask that question elsewhere if no results here) $\endgroup$ Feb 12 at 19:29

2 Answers 2

2
$\begingroup$

I serched everywhere something like this too.

I know that it's not the exact thing you ask, but I would suggest using jstest-gtk as quick & dirty visual representation of your joystick input.

enter image description here

If you want a more ROS-oriented application, try to code a rqt plugin on the lines of rqt_virtual_joystick.

enter image description here

If this is not enough and want more control, I would start coding a graphical application reading directly the serial input of your device.

$\endgroup$
3
  • 1
    $\begingroup$ I made some fixes to rqt_virtual_joy to make it work with Ubuntu 22.04/ros-o in github.com/lucasw/rqt_virtual_joy- I may try to adapt it to be able to subscribe to incoming Joy messages and display them the same as it does when publishing them as a result of ui interaction $\endgroup$ Feb 16 at 15:31
  • 1
    $\begingroup$ Cool! Mind sharing the final results when done? :) $\endgroup$ Feb 16 at 15:52
  • $\begingroup$ github.com/lucasw/rqt_virtual_joy/tree/joy_monitor has a 'Joystick Monitor' now that is half of what I'd like, I'll add support for dual sticks and analog triggers later. I don't really want to to get into remapping for different gamepad layouts though so will likely make it correct for xbox controllers and stop there. $\endgroup$ Feb 16 at 19:43
0
$\begingroup$

https://github.com/lucasw/rqt_virtual_joy/tree/joy_monitor shows a single analog stick and all the buttons in rqt under Robot Tools | Joystick Monitor, in the image below I'm pressing left stick up and right and the x and right shoulder buttons:

joy monitor

Adding another analog stick wouldn't be hard

(from comment above)


There's a ros2 package joy_tester that uses tk: https://github.com/joshnewans/joy_tester (via https://discourse.ros.org/t/new-package-joy-tester/30036)

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.