ps4 joystick: Error: "Couldn't open joystick /dev/input/js_base"

asked 2018-03-08 02:48:57 -0500

khadija gravatar image

updated 2018-03-08 03:12:30 -0500

Hello there,

I have Linux-gnu OS, Ubuntu 16.04 LTS, 64 bit, Kobuki Turtlebot ll. I'm trying to control my turtlebot by Ps4 joystick but I got this error "Couldn't open joystick /dev/input/js_base. Will retry every second." I did all the troubleshooting steps but still I got the same error!!

I go through the following steps:

Step 1. I modify ps4_teleop.launch that located on /opt/ros/kinetic/share/turtlebot_teleop/launch/ to be:


<arg name="joy_dev" default="/dev/input/js_base"/>
<node pkg="turtlebot_teleop" type="turtlebot_teleop_joy" name="turtlebot_teleop_joystick">

<param name="scale_angular" value="1.5"/>
<param name="scale_linear" value="0.5"/>
<param name="axis_deadman" value="5"/>
 <param name="axis_linear" value="1"/>
 <param name="axis_angular" value="2"/>

 <remap from="turtlebot_teleop_joystick/cmd_vel" to="mobile_base/commands/velocity"/>

</node> <node pkg="joy" type="joy_node" name="joystick">

</node> </launch>

step 2. install driver (ds4drv): $> sudo apt-get install python-pip , sudo pip install ds4drv

step 3. test the connection with :$> sudo ds4drv :

[sudo] password for turtlebot: [info][controller 1] Created devices /dev/input/js0 (joystick) /dev/input/event16 (evdev) [info][bluetooth] Scanning for devices [info][bluetooth] Found device 1C:66:6D:BF:28:CE [info][controller 1] Connected to Bluetooth Controller (1C:66:6D:BF:28:CE) [info][bluetooth] Scanning for devices [info][controller1] Battery: 87% [warning][controller1] Signal strength is low (37 reports/s)

step 4. $> roslaunch kobuki_node minimal.launch --screen

step 5. $> ls -l /dev/input/js0 : crw-rw-r--+ 1 root input 13, 0 mar 8 10:23 /dev/input/js0

step 6. $> chmod +rw /dev/input/js0 : chmod: changing permissions of '/dev/input/js0': Operation not permitted

step 7. $> sudo jstest /dev/input/js0 :

Driver version is 2.1.0. Joystick (Sony Computer Entertainment Wireless Controller) has 14 axes (X, Y, Z, Rx, Ry, Rz, Throttle, Rudder, Wheel, Hat0X, Hat0Y, ?, ?, ?) and 14 buttons (BtnX, BtnY, BtnZ, BtnTL, BtnTR, BtnTL2, BtnTR2, BtnSelect, BtnStart, BtnMode, BtnThumbL, BtnThumbR, ?, ?). Testing ... (interrupt to exit) Axes: 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5 ...

step 8. roslaunch turtlebot_teleop ps4_teleop.launch :

NODES / joystick (joy/joy_node) turtlebot_teleop_joystick (turtlebot_teleop/turtlebot_teleop_joy)


process[turtlebot_teleop_joystick-1]: started with pid [6407]

process[joystick-2]: started with pid [6408]

[ERROR] [1520491787.604604926]: Couldn't open joystick /dev/input/js_base. Will retry every second.

any idea please?

Thanks in advance

edit retag flag offensive close merge delete


Isn't the device file path /dev/input/js0? Why are you trying to get joy to open /dev/input/js_base?

gvdhoorn gravatar image gvdhoorn  ( 2018-03-08 03:01:04 -0500 )edit

I modify ps4_teleop.launch that located on /opt/ros/kinetic/share/turtlebot_teleop/launch/

Please don't do that, there is no need.

joy_dev is an arg, you can override its default value when starting the launch file.

gvdhoorn gravatar image gvdhoorn  ( 2018-03-08 03:02:28 -0500 )edit

Try changing the device name to "/dev/input/js0" in the second line of your launch file:

no, don't do that.

Invoke your launch file as follows:

roslaunch turtlebot_teleop ps4_teleop.launch joy_dev:=/dev/input/js0

do not edit files under /opt/ros.

gvdhoorn gravatar image gvdhoorn  ( 2018-03-08 03:07:51 -0500 )edit

I only changed the line remap cmd_vel :

<remap from="turtlebot_teleop_joystick/cmd_vel" to="teleop_velocity_smoother/raw_cmd_vel"/>

with the following line:

<remap from="turtlebot_teleop_joystick/cmd_vel" to="mobile_base/commands/velocity"/>

khadija gravatar image khadija  ( 2018-03-08 03:19:08 -0500 )edit

oooh its works finally with <roslaunch turtlebot_teleop="" ps4_teleop.launch="" joy_dev:="/dev/input/js0">

Thank you sooo much @gvdhoorn

khadija gravatar image khadija  ( 2018-03-08 03:27:30 -0500 )edit