Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/celer/xpider
Golang Xpider Controller
https://github.com/celer/xpider
Last synced: about 24 hours ago
JSON representation
Golang Xpider Controller
- Host: GitHub
- URL: https://github.com/celer/xpider
- Owner: celer
- License: mit
- Created: 2017-11-10T19:06:06.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-12T20:53:43.000Z (about 7 years ago)
- Last Synced: 2024-11-04T18:50:49.495Z (about 2 months ago)
- Language: Go
- Size: 8.79 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Introduction
This is a first cut at a driver for the [Xpider](http://xpider.me) robot for golang.
![Picture of a Xpider Robot](http://res.cloudinary.com/hrscywv4p/image/upload/c_limit,fl_lossy,h_9000,w_1200,f_auto,q_auto/v1/666328/620_415_2-01_cwuoh9.jpg)
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.1This 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# Getting started
```
go get github.com/celer/xpider
```## Connect to the robot
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.```go
// Connect to the xpider
x := &xpider.Controller{}
err := x.Connect("192.168.100.1:80")
if err != nil {
panic(err)
}
```## Send a command to the robot
```go
// 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)```
## Get the state of the robot
```go
state:=x.GetState()
fmt.Printf("Observed Distance %d\n", state.ObsticalDistance)```
## See examples/ for examples