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

Revision history [back]

click to hide/show revision 1
initial version

I've had some issues with the stock Linux kernel that ships with Ubuntu 18.04 in the past, specifically its bluetooth device drivers for the PS4 DS4 controller. I don't recall any issues using it via USB, but that's hardly practical when using it to tele operate a mobile robot without a second computer.

For what it's worth, the stock kernel shipped with Ubuntu 20.04 is a lot more stable with the DS4, and joy_node released into foxy seems to work out of the box, both bluetooth and USB:

USB

$ ros2 run joy joy_node 
[INFO] [1600804025.194521913] [joy_node]: Opened joystick: Sony Computer Entertainment Wireless Controller.  deadzone: 0.050000
^C[INFO] [1600804101.562256221] [rclcpp]: signal_handler(signal_value=2)

Bluetooth

$ ros2 run joy joy_node 
[INFO] [1600804160.446296839] [joy_node]: Opened joystick: Wireless Controller.  deadzone: 0.050000
^C[INFO] [1600804280.166092944] [rclcpp]: signal_handler(signal_value=2)

The only caveat is that the stock kernel module for the DS4 with Ubuntu 20.04 doesn't seem to report the:

  • 3 gyro axes
  • 3 accelerometer axes

That said, even using bluetooth can be kind of flaky, with the /dev/joyX device unmounting whenever connection is lost, potentially for any program not accounting for hot swappable input devices. An alternative could be to use wireless controller with a simple USB dongle. Some examples:

  • https://www.playstation.com/en-gb/explore/accessories/dualshock-4-usb-wireless-adaptor
    • Re-use the same DS4 controler
  • https://www.spektrumrc.com/Products/Default.aspx?ProdID=SPMWS1000
    • Longer range RF using hobby RC radios
  • https://www.logitechg.com/en-us/products/gamepads/f710-wireless-gamepad.940-000117.html
    • Switchable mapping to emulate Xbox or Playstation

I've had some issues with the stock Linux kernel that ships with Ubuntu 18.04 in the past, specifically its bluetooth device drivers for the PS4 DS4 controller. I don't recall any issues using it via USB, but that's hardly practical when using it to tele operate a mobile robot without a second computer.

For what it's worth, the stock kernel shipped with Ubuntu 20.04 is a lot more stable with the DS4, and joy_node released into foxy seems to work out of the box, both bluetooth and USB:

USB

$ ros2 run joy joy_node 
[INFO] [1600804025.194521913] [joy_node]: Opened joystick: Sony Computer Entertainment Wireless Controller.  deadzone: 0.050000
^C[INFO] [1600804101.562256221] [rclcpp]: signal_handler(signal_value=2)

Bluetooth

$ ros2 run joy joy_node 
[INFO] [1600804160.446296839] [joy_node]: Opened joystick: Wireless Controller.  deadzone: 0.050000
^C[INFO] [1600804280.166092944] [rclcpp]: signal_handler(signal_value=2)

The only caveat is that the stock kernel module for the DS4 with Ubuntu 20.04 doesn't seem to report the:

  • 3 gyro axes
  • 3 accelerometer axes

That said, even using bluetooth can be kind of flaky, with the /dev/joyX/dev/input/jsX device unmounting whenever connection is lost, potentially for any program not accounting for hot swappable input devices. An alternative could be to use wireless controller with a simple USB dongle. Some examples:

  • https://www.playstation.com/en-gb/explore/accessories/dualshock-4-usb-wireless-adaptor
    • Re-use the same DS4 controler
  • https://www.spektrumrc.com/Products/Default.aspx?ProdID=SPMWS1000
    • Longer range RF using hobby RC radios
  • https://www.logitechg.com/en-us/products/gamepads/f710-wireless-gamepad.940-000117.html

    https://www.logitechg.com/en-us/products/gamepads/f710-wireless-gamepad.940-000117.html

    • Switchable mapping to emulate Xbox or Playstation

Also, check that your using the correct device number for the connected controller, e.g. setting the parameter for /dev/input/jsX. If left unspecified, ros_joy will use the first available device number. With linux, some laptops can have the js0 device associated to the fall detection accelerometer, for stopping/locking older HDD before impact. So that could account for the sensor output discrepancy.

  • https://askubuntu.com/questions/585706/deactivate-accelerometer