I am trying this control program.
I saved the source file to a folder. There I run:
go run ./tello_control.go
I get an error:
.# command-line-arguments /tello_control.go:49:52: flightData.BatteryPercentage undefined (type *tello.FlightData has no field or method BatteryPercentage, but does have tello.batteryPercentage)
I tried a couple of string modifications to get around this but failed. Not much of a go programmer I'm afraid.
Any suggestions?
The tello driver files from the main gobot branch don't have exported fields for flight data, meaning things like battery percentage cannot be viewed from outside files. You will have to swap over to the dev branch by executing the following terminal commands:
Code:
cd $GOPATH/src/gobot.io/x/gobot
git checkout dev
git fetch
To change to ps3 instead of ps4, use "dualshock3" instead of "dualshock4" where the joystick driver is declared:
Code:
var stick = joystick.NewDriver(joyAdaptor, "dualshock3")
Instead of the strconv line for printing battery percentage, use this:
Code:
fmt.Println("battery:", flightData.BatteryPercentage)
Last edited: