ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to get second joystick with joy_node?

asked 2023-05-08 08:36:16 -0600

lisa313 gravatar image

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!

edit retag flag offensive close merge delete

Comments

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?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-05-08 13:04:08 -0600 )edit

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.

lisa313 gravatar image lisa313  ( 2023-05-09 05:38:48 -0600 )edit

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.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-05-09 07:29:59 -0600 )edit

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??

Indy_03 gravatar image Indy_03  ( 2023-07-10 23:54:55 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-09 09:26:30 -0600

lisa313 gravatar image

Nevermind, was able to fix the problem with the bugfix from https://github.com/ros-drivers/joysti...

edit flag offensive delete link more

Comments

I'm glad you figured it out. Please use this as an answer , and then click the checkmark inside the gray circle.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-05-09 10:30:35 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2023-05-08 08:36:16 -0600

Seen: 641 times

Last updated: May 08 '23