Manual User Control
- Munifa
- Apr 7, 2020
- 2 min read
The user has the option to take over manual control of the trike in case of any unusual circumstances. The main control code is also designed to stop and hand over control to the user if it encounters any obstacles that are not moving. The user is expected to manually pass static obstacles and perform left/right turns.
To implement manual control, a wired Xbox-One S controller is used. Note that the controller can also be connected wirelessly as the Raspberry Pi 3B+ supports Bluetooth connectivity and the API that we are utilizing is quite generic and supports a wide variety of controller models. However, for the purposes of implementing a reliable connection for this prototype, we are using a wired connection.
We are using Approximate Engineering’s Python Game Controller API for connecting to our Xbox controller and reading user inputs from it. It’s a very well-documented API and rather easy to set up. You can find all their documentation here. Additionally, our GitHub page is linked below if you’re curious to see our code for setting up manual control.

In manual mode, the left joystick on the Xbox controller provides inputs to the steering stepper motor, and the right joystick is connected to the throttle input of the drive hub motor controller. The right button or RB applies the eBrake.
The video below, very briefly demonstrates how we tried to manually control the trike using the Xbox controller. The left joystick, right joystick and RB button are being used to steer, drive and stop the trike, respectively. We also have the Raspberry Pi connected to a laptop for debugging.
Note that this video was captured on March 16, 2020 which was the last day before the university closed lab access for students and discouraged group work due to the COVID-19 pandemic. As is clear in the video, the manual control system is not quite perfect, but given the circumstances, we were unable to refine and test it further.
REFERENCE MATERIAL
ARC2020 GitHub - relevant files:
\arc-mc\modules\arc_mc_ui\XboxCtrl.py
Comments