Newer
Older
Ruby / sample2.rb
@SAITO Yuki SAITO Yuki on 26 Sep 2024 534 bytes 2024-09-26 08:15:27
#!/usr/bin/env ruby
require_relative 'tello.rb'

t = Tello.new

Signal.trap(:INT){
  STDERR.puts "緊急着陸します。"
  t.send_command("land")
  sleep 3
  exit 1
}

t.send_command("command")
#### ここから
print "離陸"; gets
t.send_command("takeoff")
2.times do
  print "回る";gets
  t.send_command("ccw 45")
  print "進む"; gets
  t.send_command("forward 150")
end
print "着陸"; gets














#### ここまでの間に命令を入れてゴールにたどり着けるようにしよう!!
t.send_command("land")