ROS2 node for Sony Playstation 4 Dual Shock 4 (DS4) gamepad
Hi,
I'm trying to set up a ROS2 (Dashing) node on Ubuntu 18.04 for publishing the /joy topic from a PS4 gamepad input. I've found various options online and gotten some of them set up partly, however nothing is really working as yet. I'd appreciate some help in this regard.
Here is what I tried:
Option 1: ds4drv with joystick_ros2
ds4drv enables the gamepad to be registered under /dev/input/eventX (or /dev/input/jsY). joystick_ros2 provides a ROS2 node that publishes the /joy topic.
The joystick device is not found:
ros2 run joystick_ros2 joystick_ros2
/opt/ros/dashing/lib/python3.6/site-packages/rclpy/node.py:1053: UserWarning: Pass an explicit 'qos_profile' argument
warnings.warn("Pass an explicit 'qos_profile' argument")
Joystick not found. Will retry every second.
Joystick not found. Will retry every second.
Joystick not found. Will retry every second.
Joystick not found. Will retry every second.
Joystick not found. Will retry every second.
Option 2: ds4drv with ROS2 joy node
ds4drv --hidraw
together with ros2 run joy joy_node
finds the joystick:
[INFO] [joy_node]: Opened joystick: /dev/input/js0. deadzone_: 0.050000. (main() at /tmp/binarydeb/ros-dashing-joy-2.3.2/src/joy_node_linux.cpp:286)
The /joy topic is published but does not update according to user inputs (i.e. all 0s)
Is there another way I could get this to work?
Appreciate any pointers here.