Rover with Joystick example

Hi All! New to ROS but have been following the examples and I have my PC setup with VS Code and I am communicating with Leo. I am following the joystick example using an Xbox controller connected to my PC via USB. The PC sees the controller.

When launching “rosrun joy joy_node” I have been encountering the following problem:

pi@leo:~/ros_ws$ rosrun joy joy_node
[ERROR] [1612287001.154726375]: Couldn’t open joystick /dev/input/js0. Will retry every second.

Although I seem to have the packages needed – I installed jstest-gtk just in case.

pi@leo:~/ros_ws$ sudo apt install jstest-gtk

pi@leo:~/ros_ws$ ls -l /dev/input/js0
ls: cannot access ‘/dev/input/js0’: No such file or directory
pi@leo:~/ros_ws$

On another terminal when I run rostopic, I get nothing.
Tried several USB ports, tried running it on Putty. Tried rerunning the build all over and I reach the same error. Any ideas would be nice! Circled all the ROS and Raspberry Pi forums on this!

Sorry for not making it clear on the tutorial: The package needs to be built and run on a computer which has the joystick connected to it. So, if you want to use a controller connected to your PC, you need to run the joy_node from your PC (assuming you have ROS installed).

You can also just use the leo_teleop package which is available through official ROS repositories. Just install it using apt:

sudo apt install ros-melodic-leo-teleop

Then, you can launch it, by typing:

roslaunch leo_teleop joy_teleop.launch
2 Likes