Oculus Prime - ROS Tutorial: use Teleop Twist Keyboard to Drive the Robot

Oculus Prime - ROS Tutorial: use Teleop Twist Keyboard to Drive the Robot

This tutorial provides an example of extending the functionality of Oculus Prime by using one of the hundreds of freely available ROS packages. In this case, we’ll be controlling movement using the Teleop Twist Keyboard package. Similarily, you could control movement with an Xbox or Playstation controller, using Teleop Twist Joy (or another compatible joystick package)

First, make sure the Oculusprime Server Application is running on the robot (if it isn’t already), with telnet enabled, and make sure you have ROS networking set up.

Then, ssh into the robot and enter:

$ rosrun oculusprime cmd_vel_listener.py

This runs the cmd_vel_listener utility node from the oculusprime_ros package, that maps ROS cmd_vel twist messages to Oculus Prime movement commands.

Next, on a remote workstation (or on the robot in a separate terminal), install the Teleop Twist Keyboard package with:

$ sudo apt-get update
$ sudo apt-get install ros-kinetic-teleop-twist-keyboard

Once installed, run it with:

$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py

You should see output similar to:

---------------------------
Moving around:
   u    i    o
   j    k    l
   m    ,    .
q/z : increase/decrease max speeds by 10%
w/x : increase/decrease only linear speed by 10%
e/c : increase/decrease only angular speed by 10%
anything else : stop

Now you should now be able to control Oculus Prime with the keyboard. To see where you’re going, open a browser window, connect to the robot, and turn on the camera.