mirror of
https://github.com/SMerrony/telloterm.git
synced 2023-04-24 19:01:59 +03:00
Changes for latest version of Tello package
This commit is contained in:
10
telloterm.go
10
telloterm.go
@@ -83,7 +83,7 @@ const (
|
|||||||
fBattCrit
|
fBattCrit
|
||||||
fBattState
|
fBattState
|
||||||
fGroundVis
|
fGroundVis
|
||||||
fOvertemp
|
fErrorState
|
||||||
fLightStrength
|
fLightStrength
|
||||||
fOnGround
|
fOnGround
|
||||||
fHovering
|
fHovering
|
||||||
@@ -138,7 +138,7 @@ func setupFields() {
|
|||||||
fields[fBattState] = field{label{52, 9, termbox.ColorWhite, termbox.ColorDefault, "Battery State:"}, 67, 9, 5, termbox.ColorWhite, termbox.ColorDefault, "?"}
|
fields[fBattState] = field{label{52, 9, termbox.ColorWhite, termbox.ColorDefault, "Battery State:"}, 67, 9, 5, termbox.ColorWhite, termbox.ColorDefault, "?"}
|
||||||
|
|
||||||
fields[fGroundVis] = field{label{1, 10, termbox.ColorWhite, termbox.ColorDefault, "Ground Visual:"}, 16, 10, 5, termbox.ColorWhite, termbox.ColorDefault, "?"}
|
fields[fGroundVis] = field{label{1, 10, termbox.ColorWhite, termbox.ColorDefault, "Ground Visual:"}, 16, 10, 5, termbox.ColorWhite, termbox.ColorDefault, "?"}
|
||||||
fields[fOvertemp] = field{label{25, 10, termbox.ColorWhite, termbox.ColorDefault, "Over Temperature:"}, 43, 10, 5, termbox.ColorWhite, termbox.ColorDefault, "?"}
|
fields[fErrorState] = field{label{26, 10, termbox.ColorWhite, termbox.ColorDefault, "Error Condition:"}, 43, 10, 5, termbox.ColorWhite, termbox.ColorDefault, "?"}
|
||||||
fields[fLightStrength] = field{label{51, 10, termbox.ColorWhite, termbox.ColorDefault, "Light Strength:"}, 67, 10, 5, termbox.ColorWhite, termbox.ColorDefault, "?"}
|
fields[fLightStrength] = field{label{51, 10, termbox.ColorWhite, termbox.ColorDefault, "Light Strength:"}, 67, 10, 5, termbox.ColorWhite, termbox.ColorDefault, "?"}
|
||||||
|
|
||||||
fields[fOnGround] = field{label{5, 11, termbox.ColorWhite, termbox.ColorDefault, "On Ground:"}, 16, 11, 5, termbox.ColorWhite, termbox.ColorDefault, "?"}
|
fields[fOnGround] = field{label{5, 11, termbox.ColorWhite, termbox.ColorDefault, "On Ground:"}, 16, 11, 5, termbox.ColorWhite, termbox.ColorDefault, "?"}
|
||||||
@@ -469,7 +469,7 @@ func updateFields(newFd tello.FlightData) {
|
|||||||
fields[fBattState].value = boolToYN(newFd.BatteryState)
|
fields[fBattState].value = boolToYN(newFd.BatteryState)
|
||||||
|
|
||||||
fields[fGroundVis].value = boolToYN(newFd.DownVisualState)
|
fields[fGroundVis].value = boolToYN(newFd.DownVisualState)
|
||||||
fields[fOvertemp].value = boolToYN(newFd.OverTemp)
|
fields[fErrorState].value = boolToYN(newFd.ErrorState)
|
||||||
fields[fLightStrength].value = fmt.Sprintf("%d", newFd.LightStrength)
|
fields[fLightStrength].value = fmt.Sprintf("%d", newFd.LightStrength)
|
||||||
|
|
||||||
fields[fOnGround].value = boolToYN(newFd.OnGround)
|
fields[fOnGround].value = boolToYN(newFd.OnGround)
|
||||||
@@ -544,10 +544,10 @@ func startVideo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// start video feed when drone connects
|
// start video feed when drone connects
|
||||||
drone.StartVideo()
|
drone.GetVideoSpsPps()
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
drone.StartVideo()
|
drone.GetVideoSpsPps()
|
||||||
time.Sleep(500 * time.Millisecond)
|
time.Sleep(500 * time.Millisecond)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|||||||
Reference in New Issue
Block a user