How to pass from teleop_twist_keyboard to teleop_twist_joy

asked 2020-05-17 16:11:21 -0600

RayROS gravatar image

Hello,

I am running a rosrun command that is allowing me to drive a small boat increasing/decreasing linear velocity and angular velocity. The command works perfectly via keyboard and in fact as a launch:

rosrun teleop_twist_keyboard teleop_twist_keyboard.py cmd_vel:=boat/cmd_vel

How can I translate the same exact command using a joystick?

I tried to run rosrun teleop_twist_joy thinking that I could easily exchange my previous statement with

rosrun teleop_twist_joy teleop_twist_joy.py cmd_vel:=boat/cmd_vel however after digging in the terminal warning that said:

[rosrun] Couldn't find executable named teleop_twist_joy.py below /opt/ros/melodic/share/teleop_twist_joy

Another thing I tried was to launch the following command:

roslaunch teleop_twist_joy teleop.launch but also gave a terminal error as below:

NODES
  /
    joy_node (joy/joy_node)
    teleop_twist_joy (teleop_twist_joy/teleop_node)

ROS_MASTER_URI=http://localhost:11311

process[joy_node-1]: started with pid [18583]
process[teleop_twist_joy-2]: started with pid [18584]
[ERROR] [1589749210.085969628]: Couldn't open joystick /dev/input/js0. Will retry every second.

I thought it could have been a simple problem to transition from the keypad to the joystick, but I don't know what I am missing. Please point to the right direction.

edit retag flag offensive close merge delete