[frame] Use protobuf messages

This commit is contained in:
2019-12-31 18:38:20 +01:00
parent ac651c5e64
commit 310b2850c0
355 changed files with 232192 additions and 31 deletions
+36
View File
@@ -0,0 +1,36 @@
package types
import (
"log"
)
type DriveMode int
const (
DriveModeInvalid = -1
DriveModeUser = iota
DriveModePilot
)
func ToString(mode DriveMode) string {
switch mode {
case DriveModeUser:
return "user"
case DriveModePilot:
return "pilot"
default:
return ""
}
}
func ParseString(val string) DriveMode {
switch val {
case "user":
return DriveModeUser
case "pilot":
return DriveModePilot
default:
log.Printf("invalid DriveMode: %v", val)
return DriveModeInvalid
}
}
+10
View File
@@ -0,0 +1,10 @@
package types
/* Radio control value */
type RCValue struct {
Value float64
Confidence float64
}
type Steering RCValue
type Throttle RCValue
+5
View File
@@ -0,0 +1,5 @@
package types
type BoundingBox struct {
Left, Top, Right, Bottom int
}