How to get second joystick with joy_node?
Hi, I'm currently working on a project that requires the use of multiple joystick-like devices. I can find them with
ros2 run joy joy_enumerate_devices
that returns
Joystick Device ID : Joystick Device Name
0 : Logitech G29 Driving Force Racing Wheel
1 : Logitech Logitech Flight Quadrant
The problem is, that joy_node just finds the device with ID 0. If i set the parameter "device_id" to 1, the node starts running but returns no "Opened Joystick..." Message. If I set the parameter "device_name" to 'Logitech Logitech Flight Quadrant' the result is the same. Any other names like /device/input/js1 result in the error
Could not get joystick with name /dev/input/js1: Haptic: Unable to get device's features: Invalid argument
I'm pretty sure it's not an access right issue with the usb ports, becauce if I plug out the Racing Wheel (ID 0), the second device is found as expected.
I hope you can tell me how to get the second device when the other one is plugged in. Thank you!
After you use the
device_id
parameter, how many joy_nodes do you see running? Did you assign a different ros node name to the 2nd instance of joy_node?Yes i assigned a different ros node. But the problem appears also with just one node. It can't get any device with device id not 0.
Which release of ros2 are you using? Which version of the joy package? Are you using apt repository or building the package yourself? Also, please show us the exact command line you are using to start the node.
I am new to ROS here with the same issue. How does the fix exactly work? Do I need to change the source code of Joy_node??