Control Jetbot directly with gamepad over bluetooth link?

Would it be possible to modify the teleoperation Jupyter Notebook to allow the Jetbot to be controlled directly by a gamepad using bluetooth and if so, how to make the changes.?

Regards,
TCIII

Hi TCIII,

Thanks for reaching out and sharing this request.

I’ve just created a “LocalController” class in my personal JetBot fork which should help.

You can find it here:

To test this

  1. Install the fork git clone -b local_controller https://github.com/jaybdub/jetbot && cd jetbot && python3 setup.py install
  2. Ensure you have a Joystick connected to the JetBot. It must be discoverable as a Linux joystick.
from jetbot.local_controller import LocalController

controller = LocalController()

This should replace the existing ipywidgets controller.

Please let me know if this works for you. If it proves helpful, we may consider integrating to the upstream repository.

Best,
John

@jaybdub,

Thanks for the response, much appreciated.

I will give it a try and report back.

Regards,
TCIII

@jaybdub,

We have been building a 4WD version of Jetbot for outdoor use, where our WiFi signal is marginal, is the reason we requested information on being able to control the Jetbot directly (locally) using a Bluetooth game pad.

We have built a 4WD Jetbot for indoor use that works quite well with the Jupyter Notebooks running on an HP laptop using a XBox/X game pad.

We now have an XBox One paired and connected with the Nano on the outdoor Jetbot.

One question remains, can we drive the outdoor Jetbot directly with the Bluetooth gamepad without having to view the video being displayed by the Jetbot camera and moving the green dot along the path?

TCIII

@jaybdub,

I am used to driving my Donkey Car car where you don’t have to see the path on video to drive it on the course when you are using local control with a Bluetooth gamepad.

However it looks like the “road following” Notebook has the user manually move the Jetbot by hand around the course while viewing the green dot in the video display.

Fortunately this is not a drawback as I have a WiFi extender on the side of my house that is farthest from my WiFi router and I never lost the video in the “teleoperation” Notebook as I circled my house with my indoor 4WD Jetbot.

Therefore I really don’t need local control of my Jetbot with a Bluetooth gamepad, but I will try out your local controller code with the “teleoperation” Notebook as soon as I finish my outdoor Jetbot and report back.

TCIII