This page is archived. It documents the NUgus, which NUbots no longer uses as its main platform.
The PS3 walk module is an interface for testing and demonstrating the walk and other functionalities using a PS3 controller.
The module connects to the PS3 controller using USB or bluetooth and reacts based on joystick or button input.
| Command | Description |
|---|---|
| Left Joystick Horizontal | Adds rotational speed to the walk command. |
| Left Joystick Vertical | Adds x speed to the walk command. |
| Right Joystick Horizontal | Changes the head yaw. |
| Right Joystick Vertical | Changes the head pitch. |
| START | Toggles walking on/off. |
| SELECT | Toggles locking of the head. |
| R2 | Right kick. |
| L2 | Left kick. |
| DPAD Up | Perform Clap move. |
| DPAD Down | Perform The Robot move. |
| DPAD Left | Perform Dab move. |
| DPAD Right | Perform Arm Dangle move. |
| Triangle | Perform Star move. |
| Circle | Perform Raise The Roof move. |
| Cross | Perform Crouch move. |
| Square | Perform Wave move. |
To use this module, build the PS3Walk role and install it on the robot. Ensure the PS3 controller is paired and connected to the right robot. You can set up bluetooth on the robot and pair the controller using the steps below. Once these have been run once, the robot should automatically connect to the controller when both the robot and controller are powered. When you are ready, run ./ps3walk on the robot to begin controlling it.
The robot will initially not perform any action. If you want the robot to stand, pick up the robot and press the start button. It will then move to its standing position and begin looking for walk inputs.
Setup
- Install
bluez,bluez-utils, andbluez-pluginsif they have not already been installed:pacman -S --needed bluez bluez-utils bluez-plugins - Restart the system:
This is only necessary if the packages were not previously installed.reboot now - Start the bluetooth service:systemctl start bluetooth.service
Start bluetooth automatically
Bluetooth can be powered on automatically when the system starts. This enables the controllers to
connect without having to run systemctl start bluetooth.service and bluetoothctl power on. This
is not currently enable by default in the existing installation. Some robots might have this enabled.
- Runsystemctl enable bluetooth.service
- Set
AutoEnable=truein/etc/bluetooth/main.conf:[Policy]AutoEnable=true
Now, after restarting the robot, and having previously paired the PS3 controller (see below), the PS3 controller will connect to the robot automatically.
ps3walk still needs to be started in order to control the robot.
Pairing the PS3 Controller via Bluetooth
- Unplug and power off the PS3 controller.
- Run the interactive program
bluetoothctl, and type the following commands:
If bluetooth is working correctly, you might see other devices appear and disappear.power onscan ondiscoverable on - Turn on the PS3 controller by pressing the middle PS button. The four LEDS should start flashing quickly.
- Plug the PS3 controller into the computer with a USB cable.
- Type
yeswhen the following prompt appears:Authorize service 00001124-0000-1000-8000-00805f9b34fb (yes/no)
The PS3 controller is now paired. You can unplug it and it will remain connected.
Verifying the PS3 Controller is functioning correctly.
Verifying the PS3 controller is connected and sending messages is useful for debugging the range, interference, event codes, and making sure the controller is connect to the right robot.
- Install
joyutils:pacman -S --needed joyutils - If you are connected via ssh run:
Otherwise, if you're connected to a virtual console:jstest --event /dev/input/js0jstest /dev/input/js0 - Move controller inputs, and press Ctrl + C to exit.
Connecting multiple PS3 controllers is possible. The first PS3 controller that connects is located at /dev/input/js0. The second controller that connects is then located at /dev/input/js1.
Additionally, the LEDs on the controllers show which number they are. This holds true regardless of whether the controller is connected over Bluetooth or USB.