Joystick Controller Pairing
Joystick controllers are used for teleoperation; they allow you to remotely drive the robot, whether it is a physical robot, or a simulated robot. The following instructions below detail how to pair different controllers to the robot's computer; however, these instructions can also be used to pair these controllers to your own computer.
PS4 Controller
If your robot comes with a PS4 controller, it will be paired already. Simply turn on the robot and turn on the controller.
To re-pair the PS4 controller or pair a new PS4 controller:
- Install the python3-ds4drv package if it is not installed already. In terminal, run:
sudo apt-get install python3-ds4drv
- Put the controller in pairing mode. Press and hold the PS and Share buttons on your controller until the LED begins rapidly flashing white.
- Run the
ds4drv-pair
script to pair the controller to the computer. In terminal, run:
sudo ds4drv-pair
This script will scan for nearby Bluetooth devices, and pair automatically to the controller.
Alternatively, if ds4drv-pair fails to detect the controller, you can pair the controller using bluetoothctl
:
- Install the
bluez
package if it is not installed already. In terminal, run:
sudo apt-get install bluez
- Run the
bluetoothctl
command. In terminal, run:
sudo bluetoothctl
- Use
bluetoothctl
to scan for nearby devices. In the bluetooth control application, run:
agent on
scan on
- Put the controller in pairing mode. Press and hold the PS and Share buttons on your controller until the LED begins rapidly flashing white.
- The bluetooth scan will display the MAC addresses of nearby devices. Determine which MAC address corresponds to the controller and copy it. In the bluetooth control application, run:
scan off
pair <MAC Address>
trust <MAC Address>
connect <MAC Address>
The controller should now be paired.
Make sure to set the correct controller type in your robot.yaml file. See, Joystick Controller setup in the Clearpath Configuration.