Remote Control Guide

Go to the Python Editor and choose Help--> Examples --> Fusion --> USBGamepad--> usbMixerDrive

Next plug a wireless USB receiver into your Fusion controller like this:

Run the program and try to drive your robot around with the left joystick.

You should also try the usbTwoStickDrive example program. This will drve like a tank...the left joystick will control the left wheel and the right joystick will control the right wheel.

You may also wish to try the code below. It should drive the robot forward and backward with the y axis of the left stick and make the robot spin with the x-axis of the right stick. Some might call this video game drive.

import Fusion

f = Fusion.driver()
usb = Fusion.usbGamepad(0)

while True:
    y = usb.readAxis(1)
    spin = usb.readAxis(2)
    d = max(abs(y)+abs(spin),100)/100
    f.motorSpeed(f.M0, (y - spin)/d)
    f.motorSpeed(f.M1, (y + spin)/d)

More Details

Official Fusion Documentation Link: https://modernroboticsinc.com/fusion_docs/Py_usbGamepad/#readbuttonbutton

Last updated

Was this helpful?