This is a first cut at a driver for the Xpider robot for golang.
There are a few assumptions:
* You've already connected to the Xpider WIFI
* Xpider_XXX, Pass: 12345678
* The Xpider is listening for commands on the IP address
* 192.168.100.1
This driver does not capture the video feed from the robot, to do this you'll needa to fire up a connection to rtsp://admin:[email protected]:554/cam1/h264
go get github.com/celer/xpider
To get to this point you'll need to connect to the wifi network that the Xpider robot uses, mine appears as Xpider_242, yours will probably look similar. The robot is simply listening on an IP address on the network it's setup.
// Connect to the xpider
x := &xpider.Controller{}
err := x.Connect("192.168.100.1:80")
if err != nil {
panic(err)
}
// Set our front LEDs to be green and red
x.FrontLED(0, 0xFF, 0, 0xFF, 0, 0)
// Move to some location
x.AutoMove(100, r, 100, 10)
state:=x.GetState()
fmt.Printf("Observed Distance %d\n", state.ObsticalDistance)