Flying Iris At Distill 2014
Team Gobot was speaking at the Distill 2014 conference in San Francisco this week. Held at the Palace of Fine Arts, we were very lucky to fly a 3DRobotics Iris around using a pre-release of our new support of the Mavlink protocol for Unmanned Aerial Vehicles (UAVs).
During a group photo that took place the day after our talk about "The 10 Rules of RobotOps", we had a golden opportunity to fly around a little inside the facility, and captured some rather unique footage, as you can see above.
We will be releasing our code for the Golang MAVLINK generator, along with gobot-mavlink itself, very soon. Here is a little taste of what we can do:
package main import ( "fmt" "net/http" "strings" "github.com/hybridgroup/gobot" "github.com/hybridgroup/gobot/api" "github.com/hybridgroup/gobot/platforms/mavlink" common "github.com/hybridgroup/gobot/platforms/mavlink/common" ) type telemetry struct { Status string Roll float32 Yaw float32 Pitch float32 Latitude float32 Longitude float32 Altitude int32 Heading float32 } func main() { if gobot.Version() != "0.7.dev" { panic("this requires the dev branch!") } summary := &telemetry{Status: "STANDBY"} gbot := gobot.NewGobot() a := api.NewAPI(gbot) a.Get("/mavlink/:a", func(res http.ResponseWriter, req *http.Request) { path := req.URL.Path t := strings.Split(path, "/") buf, err := Asset("assets/" + t[2]) if err != nil { http.Error(res, err.Error(), http.StatusNotFound) return } t = strings.Split(path, ".") if t[len(t)-1] == "js" { res.Header().Set("Content-Type", "text/javascript; charset=utf-8") } else if t[len(t)-1] == "css" { res.Header().Set("Content-Type", "text/css; charset=utf-8") } res.Write(buf) }) adaptor := mavlink.NewMavlinkAdaptor("iris", "/dev/ttyACM0") iris := mavlink.NewMavlinkDriver(adaptor, "iris") work := func() { iris.AddEvent("telemetry") gobot.Once(iris.Event("packet"), func(data interface{}) { fmt.Println(data) packet := data.(*common.MAVLinkPacket) dataStream := common.NewRequestDataStream(10, packet.SystemID, packet.ComponentID, 0, 1, ) iris.SendPacket(common.CraftMAVLinkPacket(packet.SystemID, packet.ComponentID, dataStream, )) }) gobot.On(iris.Event("message"), func(data interface{}) { fmt.Println("message: ", data.(common.MAVLinkMessage).Id()) if data.(common.MAVLinkMessage).Id() == 0 { statusCodes := map[uint8]string{ 1: "BOOT", 2: "CALIBRATING", 3: "STANDBY", 4: "ACTIVE", 5: "CRITICAL", 6: "EMERGENCY", 7: "POWEROFF", 8: "ENUM_END", } summary.Status = statusCodes[data.(*common.Heartbeat).SYSTEM_STATUS] if summary.Status != "" { gobot.Publish(iris.Event("telemetry"), summary) } } if data.(common.MAVLinkMessage).Id() == 30 { roll := data.(*common.Attitude).ROLL pitch := data.(*common.Attitude).PITCH yaw := data.(*common.Attitude).YAW if roll < 4 || roll > -4 { summary.Roll = (roll * 180 / 3.14) } if yaw < 4 || roll > -4 { summary.Yaw = (yaw * 180 / 3.14) } if pitch < 4 || roll > -4 { summary.Pitch = (pitch * 180 / 3.14) } gobot.Publish(iris.Event("telemetry"), summary) } if data.(common.MAVLinkMessage).Id() == 33 { summary.Latitude = float32(data.(*common.GlobalPositionInt).LAT) / 10000000.0 summary.Longitude = float32(data.(*common.GlobalPositionInt).LON) / 10000000.0 summary.Altitude = data.(*common.GlobalPositionInt).ALT summary.Heading = float32(data.(*common.GlobalPositionInt).HDG) / 100 gobot.Publish(iris.Event("telemetry"), summary) } }) } gbot.AddRobot(gobot.NewRobot("irisBot", []gobot.Connection{adaptor}, []gobot.Device{iris}, work, )) a.Start() gbot.Start() }
Want to keep up to date on the latest news and information about Gobot? Please follow us on Twitter at @gobotio!
Posts
- Gobot - Release 1.11
- Hello, Tello - Hacking Drones With Go
- Gobot 1.7 - Eyes Of The World
- Gobot 1.5 - On Pins And Boards
- Gobot - 1.4 Spring Cleaning
- Gobot - 1.3 Is Here
- All About The Next Generation At SCaLE15x
- Gobot - 1.2 Released
- Gobot At FOSDEM 2017
- Gobot - The 1.1 Release
- Gobot - The Big One Oh!
- Gobot - This One Goes To 0.11
- Gobot 0.10 - Less Is More
- Gobot in Vice
- Gobot mentioned in SD Times
- Gobot featured in Wired
- Gobot 0.8 - The Happy Holiday Release
- Gobot 0.7 - The Big Release
- Run Golang On The Intel Edison With Gobot
- Flying Iris At Distill 2014
- Gobot 0.6 is out!
- Gobot 0.5 is out!
- Taking The Stage At GopherCon
- National Robotics Week at Boston Golang
- Go, Gobot, Go! Golang Powered Robotics