Robotics StackExchange | Archived questions

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

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 ps4teleop.launch that located on /opt/ros/kinetic/share/turtlebotteleop/launch/ to be:


<!-- smooths inputs from cmdvelmux/input/teleopraw to cmdvelmux/input/teleop -->
<!--include file="$(find turtlebot
teleop)/launch/includes/velocitysmoother.launch.xml"/--> <arg name="joydev" default="/dev/input/jsbase"/>
<node pkg="turtlebot
teleop" type="turtlebotteleopjoy" name="turtlebotteleopjoystick">

<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"/>  



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/joynode) turtlebotteleopjoystick (turtlebotteleop/turtlebotteleopjoy)

ROSMASTERURI=http://localhost:11311

process[turtlebotteleopjoystick-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

Asked by khadija on 2018-03-08 03:48:57 UTC

Comments

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

Asked by gvdhoorn on 2018-03-08 04:01:04 UTC

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.

Asked by gvdhoorn on 2018-03-08 04:02:28 UTC

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.

Asked by gvdhoorn on 2018-03-08 04:07:51 UTC

I only changed the line remap cmd_vel :

with the following line:

Asked by khadija on 2018-03-08 04:19:08 UTC

oooh its works finally with

Thank you sooo much @gvdhoorn

Asked by khadija on 2018-03-08 04:27:30 UTC

Answers