About

Gobot is a framework for robotics, physical computing, and the Internet of Things written in the Go programming language

It provides a simple, yet powerful way to create solutions that incorporate multiple, different hardware devices at the same time.

Want to use Ruby on robots? Check out our sister project Artoo (http://artoo.io).

Want to use JavaScript? Check out our sister project CylonJS (http://cylonjs.com

Meet The Code

Gobot makes commanding robots incredibly simple and fun.

All you need to get started is install the library with :

go get -u github.com/hybridgroup/gobot.

Gobot with Sphero

package main

import (
  "github.com/hybridgroup/gobot"
  "github.com/hybridgroup/gobot/platforms/sphero"
  "time"
)

func main() {
  gbot := gobot.NewGobot()

  adaptor := sphero.NewSpheroAdaptor("Sphero", "/dev/rfcomm0")
  ball := sphero.NewSpheroDriver(adaptor, "sphero")

  work := func() {
    gobot.Every(3*time.Second, func() {
      ball.Roll(30, uint16(gobot.Rand(360)))
    })
  }

  gbot.Robots = append(gbot.Robots,
    gobot.NewRobot("sphero", []gobot.Connection{adaptor}, []gobot.Device{ball}, work))

  gbot.Start()
}

Gobot with Arduino

package main

import (
  "github.com/hybridgroup/gobot"
  "github.com/hybridgroup/gobot/platforms/firmata"
  "github.com/hybridgroup/gobot/platforms/gpio"
  "time"
)

func main() {
  gbot := gobot.NewGobot()

  adaptor := firmata.NewFirmataAdaptor("myFirmata", "/dev/ttyACM0")
  led := gpio.NewLedDriver(adaptor, "myLed", "13")

  work := func() {
    gobot.Every(1*time.Second, func() {
      led.Toggle()
    })
  }

  gbot.Robots = append(gbot.Robots,
    gobot.NewRobot("blink", []gobot.Connection{adaptor}, []gobot.Device{led}, work))

  gbot.Start()
}

Platform Support

Gobot has a extensible system for connecting to hardware devices. The following robotics and physical computing platforms are currently supported:

10 Platforms

Support for many devices that use General Purpose Input/Output (GPIO) have a shared set of drivers provded using the gobot-gpio module:

7 GPIO drivers

Support for devices that use Inter-Integrated Circuit (I2C) have a shared set of drivers provded using the gobot-i2c module:

3 I2C drivers

See more drivers here

More platforms and drivers are coming soon...

Getting Started

Install the library with: go get -u github.com/hybridgroup/gobot

Then install additional libraries for whatever hardware support you want to use from your robot. For example, go get -u github.com/hybridgroup/gobot-sphero to use Gobot with a Sphero.

Ready to build Go robots with Gobot? Get Started Here!

API

Gobot includes a RESTful API to query the status of any robot running within a group, including the connection and device status, and execute device commands.

To activate the API, use the Api command like this:

master := gobot.GobotMaster()
gobot.Api(master)

You can also specify the api host and port, and turn on authentication:

master := gobot.GobotMaster()
api := gobot.Api(master)
api.Port = "4000"
api.Username = "Gort"
api.Password = "klaatu"

In order to use the robeaux AngularJS interface with Gobot you simply clone the robeaux repo and place it in the directory of your Gobot program. The robeaux assets must be in a folder called robeaux.

CLI

Gort (http://gort.io) is a Command Line Toolkit for RobotOps. Gort provides tools to scan for connected devices, upload firmware, and more. It works well with Gobot.

Gobot also includes a Command Line Interface (CLI) for generating new robots and adaptors.

Be Part Of The Robot Evolution