0

I have a go file named as drone_control.go which controls dji tello drone with keyboard button clicks. When I try to execute this file using the command prompt it shows an error * exec: "stty": executable file not found in %PATH%

I am using windows 10 and gobot framework to control the drone.

following is the content of my drone_control.go file.

    package main

  import (
      "time"
      "gobot.io/x/gobot"
      "gobot.io/x/gobot/platforms/dji/tello"
      "gobot.io/x/gobot/platforms/keyboard"
  )

  func main() {
      drone := tello.NewDriver("8888")
      keys := keyboard.NewDriver()

      work := func() {
                        drone.TakeOff()
          keys.On(keyboard.Key, func(data interface{}) {
                        key := data.(keyboard.KeyEvent)
                        if key.Key == keyboard.A {
                        drone.FrontFlip()
                        }
                        })

          gobot.After(10*time.Second, func() {
              drone.BackFlip()
          })

          gobot.After(15*time.Second, func() {
              drone.Land()
          })
      }//work end

      robot := gobot.NewRobot("tello",
          []gobot.Connection{},
          []gobot.Device{keys},
          []gobot.Device{drone},
          work,
      )

      robot.Start()
  }//main end
Chamila Maddumage
  • 3,304
  • 2
  • 32
  • 43
  • 1
    The error seems to indicate that stty is not on your PATH. Make sure it is. Finde which stty you use and what your PATH is and fix one or the other. – Volker Aug 14 '18 at 12:41
  • I am using windows 10. I can not find the stty path. – Chamila Maddumage Aug 15 '18 at 05:31
  • 2
    Are you sure gobot works on windows? To use package keyboard you _must_ _have_ stty. Maybe through cygwin. – Volker Aug 15 '18 at 06:22
  • gobot is working on windows and my drone is flying. Problem is i can not controll the drone using the keyboard. stty file was found and replace to the path and now it is showing exit status 3221225781 error. – Chamila Maddumage Aug 15 '18 at 08:26
  • 1
    Seems you either need a gobot comaptible stty (the normal Linux variant) or you must use an other way of reading the keyboard than gobots package keyboard. – Volker Aug 15 '18 at 10:29
  • 1
    AFAIK gobot is only developed and tested on Linux and you should not expect all of its functionality to work on other platforms. – Michael Hampton Aug 15 '18 at 14:18
  • When I run the project on git bash it works perfectly..Thank you very much for your comments. – Chamila Maddumage Aug 16 '18 at 04:03
  • 1
    install [Cygwin](https://www.cygwin.com/setup-x86_64.exe) and add bin path to system path. then it can be run in the command prompt of window 10. – Chamod Pathirana Aug 17 '18 at 04:48
  • @ChamodPathirana Thanks man. It works fine. – Chamila Maddumage Aug 27 '18 at 11:19

1 Answers1

1

gobot is only developed and tested on Linux and we should not expect all of its functionality to work on other platforms like windows. Hence I tried using git bash instead of windows command prompt and It works perfectly there.

Chamila Maddumage
  • 3,304
  • 2
  • 32
  • 43