Compare commits

..

No commits in common. "c2b12f297c09062b682c7b811d5eb95df62d4ccb" and "623e80e429ee639f1f978c6da45674cb364b50a6" have entirely different histories.

10 changed files with 179 additions and 920 deletions

View File

@ -13,21 +13,16 @@ import (
const (
DefaultClientId = "robocar-throttle"
DefaultThrottleMin = 0.1
DefaultThrottleMin = 0.3
)
func main() {
var mqttBroker, username, password, clientId string
var throttleTopic, driveModeTopic, rcThrottleTopic, steeringTopic, throttleFeedbackTopic, speedZoneTopic string
var throttleTopic, driveModeTopic, rcThrottleTopic, steeringTopic, throttleFeedbackTopic string
var minThrottle, maxThrottle float64
var publishPilotFrequency int
var brakeConfig string
var enableBrake bool
var enableSpeedZone bool
var enableCustomSteeringProcessor bool
var configFileSteeringProcessor string
var slowZoneThrottle, normalZoneThrottle, fastZoneThrottle float64
var moderateSteering, fullSteering float64
err := cli.SetFloat64DefaultValueFromEnv(&minThrottle, "THROTTLE_MIN", DefaultThrottleMin)
if err != nil {
@ -48,7 +43,6 @@ func main() {
flag.StringVar(&rcThrottleTopic, "mqtt-topic-rc-throttle", os.Getenv("MQTT_TOPIC_RC_THROTTLE"), "Mqtt topic that contains RC Throttle value, use MQTT_TOPIC_RC_THROTTLE if args not set")
flag.StringVar(&steeringTopic, "mqtt-topic-steering", os.Getenv("MQTT_TOPIC_STEERING"), "Mqtt topic that contains steering value, use MQTT_TOPIC_STEERING if args not set")
flag.StringVar(&throttleFeedbackTopic, "mqtt-topic-throttle-feedback", os.Getenv("MQTT_TOPIC_THROTTLE_FEEDBACK"), "Mqtt topic where to publish throttle feedback, use MQTT_TOPIC_THROTTLE_FEEDBACK if args not set")
flag.StringVar(&speedZoneTopic, "mqtt-topic-speed-zone", os.Getenv("MQTT_TOPIC_SPEED_ZONE"), "Mqtt topic where to subscribe speed zone events, use MQTT_TOPIC_SPEED_ZONE if args not set")
flag.Float64Var(&minThrottle, "throttle-min", minThrottle, "Minimum throttle value, use THROTTLE_MIN if args not set")
flag.Float64Var(&maxThrottle, "throttle-max", maxThrottle, "Minimum throttle value, use THROTTLE_MAX if args not set")
@ -56,17 +50,6 @@ func main() {
flag.BoolVar(&enableBrake, "enable-brake-feature", false, "Enable brake to slow car on throttle changes")
flag.StringVar(&brakeConfig, "brake-configuration", "", "Json file to use to configure brake adaptation when --enable-brake is `true`")
flag.BoolVar(&enableCustomSteeringProcessor, "enable-custom-steering-processor", false, "Enable custom steering processor to estimate throttle")
flag.StringVar(&configFileSteeringProcessor, "custom-steering-processor-config", "", "Path to json config to parameter custom steering processor")
flag.BoolVar(&enableSpeedZone, "enable-speed-zone", false, "Enable speed zone information to estimate throttle")
flag.Float64Var(&slowZoneThrottle, "slow-zone-throttle", 0.11, "Throttle target for slow speed zone")
flag.Float64Var(&normalZoneThrottle, "normal-zone-throttle", 0.12, "Throttle target for normal speed zone")
flag.Float64Var(&fastZoneThrottle, "fast-zone-throttle", 0.13, "Throttle target for fast speed zone")
flag.Float64Var(&moderateSteering, "moderate-steering", 0.3, "Steering above is considered as moderate")
flag.Float64Var(&fullSteering, "full-steering", 0.8, "Steering above is considered as full")
logLevel := zap.LevelFlag("log", zap.InfoLevel, "log level")
flag.Parse()
@ -93,18 +76,10 @@ func main() {
zap.S().Infof("Topic throttle feedback : %s", throttleFeedbackTopic)
zap.S().Infof("Topic steering : %s", steeringTopic)
zap.S().Infof("Topic drive mode : %s", driveModeTopic)
zap.S().Infof("Topic speed zone : %s", speedZoneTopic)
zap.S().Infof("Min throttle : %v", minThrottle)
zap.S().Infof("Max throttle : %v", maxThrottle)
zap.S().Infof("Publish frequency : %vHz", publishPilotFrequency)
zap.S().Infof("Brake enabled : %v", enableBrake)
zap.S().Infof("CustomSteeringProcessor enabled: %v", enableCustomSteeringProcessor)
zap.S().Infof("SpeedZone enabled : %v", enableSpeedZone)
zap.S().Infof("SpeedZone slow throttle : %v", slowZoneThrottle)
zap.S().Infof("SpeedZone normal throttle : %v", normalZoneThrottle)
zap.S().Infof("SpeedZone fast throttle : %v", fastZoneThrottle)
zap.S().Infof("Steering moderate : %v", moderateSteering)
zap.S().Infof("Steering full : %v", fullSteering)
client, err := cli.Connect(mqttBroker, username, password, clientId)
if err != nil {
@ -118,33 +93,8 @@ func main() {
} else {
brakeCtrl = &brake.DisabledController{}
}
if enableSpeedZone && enableCustomSteeringProcessor {
zap.S().Panicf("invalid flag, speedZone and customSteering processor can't be enabled at the same time")
}
var throttleProcessor throttle.Processor
if enableSpeedZone {
throttleProcessor = throttle.NewSpeedZoneProcessor(
types.Throttle(slowZoneThrottle),
types.Throttle(normalZoneThrottle),
types.Throttle(fastZoneThrottle),
moderateSteering,
fullSteering,
)
} else if enableCustomSteeringProcessor {
cfg, err := throttle.NewConfigFromJson(configFileSteeringProcessor)
if err != nil {
zap.S().Fatalf("unable to load config '%v': %v", configFileSteeringProcessor, err)
}
throttleProcessor = throttle.NewCustomSteeringProcessor(cfg)
} else {
throttleProcessor = throttle.NewSteeringProcessor(types.Throttle(minThrottle), types.Throttle(maxThrottle))
}
p := throttle.New(client, throttleTopic, driveModeTopic, rcThrottleTopic, steeringTopic, throttleFeedbackTopic,
speedZoneTopic, types.Throttle(maxThrottle), 2,
throttle.WithThrottleProcessor(throttleProcessor),
throttle.WithBrakeController(brakeCtrl))
types.Throttle(minThrottle), types.Throttle(maxThrottle), 2, throttle.WithBrakeController(brakeCtrl))
defer p.Stop()
cli.HandleExit(p)

2
go.mod
View File

@ -4,7 +4,7 @@ go 1.19
require (
github.com/cyrilix/robocar-base v0.1.7
github.com/cyrilix/robocar-protobuf/go v1.3.0
github.com/cyrilix/robocar-protobuf/go v1.1.0
github.com/eclipse/paho.mqtt.golang v1.4.1
go.uber.org/zap v1.23.0
google.golang.org/protobuf v1.28.1

4
go.sum
View File

@ -1,8 +1,8 @@
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/cyrilix/robocar-base v0.1.7 h1:EVzZ0KjigSFpke5f3A/PybEH3WFUEIrYSc3z/dhOZ48=
github.com/cyrilix/robocar-base v0.1.7/go.mod h1:4E11HQSNy2NT8e7MW188y6ST9C0RzarKyn7sK/3V/Lk=
github.com/cyrilix/robocar-protobuf/go v1.3.0 h1:vLsoLQeIfXPnrJ+xYrPy/R/swjYiMBBR7wT2ILdLcQA=
github.com/cyrilix/robocar-protobuf/go v1.3.0/go.mod h1:Y3AE28K5V7EZxMXp/6A8RhkRz15VOfFy4CjST35FbtQ=
github.com/cyrilix/robocar-protobuf/go v1.1.0 h1:txIjGnnCF3UzedpsWu+sL7nMA+pNjSnX6HZlAmuReH4=
github.com/cyrilix/robocar-protobuf/go v1.1.0/go.mod h1:Y3AE28K5V7EZxMXp/6A8RhkRz15VOfFy4CjST35FbtQ=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

View File

@ -12,9 +12,8 @@ import (
"time"
)
func New(client mqtt.Client, throttleTopic, driveModeTopic, rcThrottleTopic, steeringTopic, throttleFeedbackTopic,
speedZoneTopic string,
maxValue types.Throttle, publishPilotFrequency int, opts ...Option) *Controller {
func New(client mqtt.Client, throttleTopic, driveModeTopic, rcThrottleTopic, steeringTopic, throttleFeedbackTopic string,
minValue, maxValue types.Throttle, publishPilotFrequency int, opts ...Option) *Controller {
c := &Controller{
client: client,
throttleTopic: throttleTopic,
@ -22,11 +21,10 @@ func New(client mqtt.Client, throttleTopic, driveModeTopic, rcThrottleTopic, ste
rcThrottleTopic: rcThrottleTopic,
steeringTopic: steeringTopic,
throttleFeedbackTopic: throttleFeedbackTopic,
speedZoneTopic: speedZoneTopic,
maxThrottle: maxValue,
driveMode: events.DriveMode_USER,
publishPilotFrequency: publishPilotFrequency,
processor: &SteeringProcessor{minThrottle: 0.1, maxThrottle: maxValue},
steeringProcessor: &SteeringProcessor{minThrottle: minValue, maxThrottle: maxValue},
brakeCtrl: &brake.DisabledController{},
}
for _, o := range opts {
@ -43,30 +41,23 @@ func WithBrakeController(bc brake.Controller) Option {
}
}
func WithThrottleProcessor(p Processor) Option {
return func(c *Controller) {
c.processor = p
}
}
type Controller struct {
client mqtt.Client
throttleTopic string
maxThrottle types.Throttle
processor Processor
steeringProcessor *SteeringProcessor
muDriveMode sync.RWMutex
driveMode events.DriveMode
muSteering sync.RWMutex
steering types.Steering
steering float32
brakeCtrl brake.Controller
cancel chan interface{}
publishPilotFrequency int
driveModeTopic, rcThrottleTopic, steeringTopic, throttleFeedbackTopic string
speedZoneTopic string
}
func (c *Controller) Start() error {
@ -95,7 +86,7 @@ func (c *Controller) onPublishPilotValue() {
return
}
throttleFromSteering := c.processor.Process(c.readSteering())
throttleFromSteering := c.steeringProcessor.Process(c.readSteering())
throttleMsg := events.ThrottleMessage{
Throttle: float32(c.brakeCtrl.AdjustThrottle(throttleFromSteering)),
@ -111,7 +102,7 @@ func (c *Controller) onPublishPilotValue() {
}
func (c *Controller) readSteering() types.Steering {
func (c *Controller) readSteering() float32 {
c.muSteering.RLock()
defer c.muSteering.RUnlock()
return c.steering
@ -119,8 +110,7 @@ func (c *Controller) readSteering() types.Steering {
func (c *Controller) Stop() {
close(c.cancel)
service.StopService("throttle", c.client, c.driveModeTopic, c.rcThrottleTopic, c.steeringTopic,
c.throttleFeedbackTopic, c.speedZoneTopic)
service.StopService("throttle", c.client, c.driveModeTopic, c.rcThrottleTopic, c.steeringTopic, c.throttleFeedbackTopic)
}
func (c *Controller) onThrottleFeedback(_ mqtt.Client, message mqtt.Message) {
@ -184,18 +174,7 @@ func (c *Controller) onSteering(_ mqtt.Client, message mqtt.Message) {
}
c.muSteering.Lock()
defer c.muSteering.Unlock()
c.steering = types.Steering(steeringMsg.GetSteering())
}
func (c *Controller) onSpeedZone(_ mqtt.Client, message mqtt.Message) {
var szMsg events.SpeedZoneMessage
payload := message.Payload()
err := proto.Unmarshal(payload, &szMsg)
if err != nil {
zap.S().Errorf("unable to unmarshal speedZone message, skip value: %v", err)
return
}
c.processor.SetSpeedZone(szMsg.GetSpeedZone())
c.steering = steeringMsg.GetSteering()
}
var registerCallbacks = func(p *Controller) error {
@ -217,10 +196,6 @@ var registerCallbacks = func(p *Controller) error {
if err != nil {
return err
}
err = service.RegisterCallback(p.client, p.speedZoneTopic, p.onSpeedZone)
if err != nil {
return err
}
return nil
}

View File

@ -36,9 +36,10 @@ func TestDefaultThrottle(t *testing.T) {
rcThrottleTopic := "topic/rcThrottle"
steeringTopic := "topic/rcThrottle"
throttleFeedbackTopic := "topic/feedback/throttle"
speedZoneTopic := "topic/speedZone"
p := New(nil, throttleTopic, driveModeTopic, rcThrottleTopic, steeringTopic, throttleFeedbackTopic, speedZoneTopic, 1., 200)
minValue := types.Throttle(0.56)
p := New(nil, throttleTopic, driveModeTopic, rcThrottleTopic, steeringTopic, throttleFeedbackTopic, minValue, 1., 200)
cases := []*struct {
name string
@ -116,7 +117,6 @@ func TestController_Start(t *testing.T) {
driveModeTopic := "topic/driveMode"
rcThrottleTopic := "topic/rcThrottle"
throttleFeedbackTopic := "topic/feedback/throttle"
speedZoneTopic := "topic/speedZone"
type fields struct {
driveMode events.DriveMode
@ -263,12 +263,8 @@ func TestController_Start(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
c := New(nil,
throttleTopic, driveModeTopic, rcThrottleTopic, steeringTopic, throttleFeedbackTopic,
speedZoneTopic, tt.fields.max,
tt.fields.min, tt.fields.max,
tt.fields.publishPilotFrequency,
WithThrottleProcessor(&SteeringProcessor{
minThrottle: tt.fields.min,
maxThrottle: tt.fields.max,
}),
WithBrakeController(tt.fields.brakeCtl),
)

View File

@ -1,179 +1,16 @@
package throttle
import (
"encoding/json"
"fmt"
"github.com/cyrilix/robocar-protobuf/go/events"
"github.com/cyrilix/robocar-throttle/pkg/types"
"math"
"os"
"sync"
)
type Processor interface {
// Process compute throttle from steering value
Process(steering types.Steering) types.Throttle
SetSpeedZone(sz events.SpeedZone)
}
func NewSteeringProcessor(minThrottle, maxThrottle types.Throttle) *SteeringProcessor {
return &SteeringProcessor{
minThrottle: minThrottle,
maxThrottle: maxThrottle,
}
}
type SteeringProcessor struct {
minThrottle, maxThrottle types.Throttle
}
func (sp *SteeringProcessor) SetSpeedZone(_ events.SpeedZone) {
return
}
// Process compute throttle from steering value
func (sp *SteeringProcessor) Process(steering types.Steering) types.Throttle {
func (sp *SteeringProcessor) Process(steering float32) types.Throttle {
absSteering := math.Abs(float64(steering))
return sp.minThrottle + types.Throttle(float64(sp.maxThrottle-sp.minThrottle)*(1-absSteering))
}
func NewSpeedZoneProcessor(slowThrottle, normalThrottle, fastThrottle types.Throttle,
moderateSteering, fullSteering float64) *SpeedZoneProcessor {
return &SpeedZoneProcessor{
muSz: sync.Mutex{},
speedZone: events.SpeedZone_UNKNOWN,
slowThrottle: slowThrottle,
normalThrottle: normalThrottle,
fastThrottle: fastThrottle,
moderateSteering: moderateSteering,
fullSteering: fullSteering,
}
}
type SpeedZoneProcessor struct {
muSz sync.Mutex
speedZone events.SpeedZone
slowThrottle, normalThrottle, fastThrottle types.Throttle
moderateSteering, fullSteering float64
}
func (sp *SpeedZoneProcessor) SpeedZone() events.SpeedZone {
sp.muSz.Lock()
defer sp.muSz.Unlock()
return sp.speedZone
}
func (sp *SpeedZoneProcessor) SetSpeedZone(sz events.SpeedZone) {
sp.muSz.Lock()
defer sp.muSz.Unlock()
sp.speedZone = sz
}
// Process compute throttle from steering value
func (sp *SpeedZoneProcessor) Process(steering types.Steering) types.Throttle {
st := math.Abs(float64(steering))
switch sp.SpeedZone() {
case events.SpeedZone_FAST:
if st >= sp.fullSteering {
return sp.slowThrottle
} else if st >= sp.moderateSteering {
return sp.normalThrottle
}
return sp.fastThrottle
case events.SpeedZone_NORMAL:
if st > sp.fullSteering {
return sp.slowThrottle
}
return sp.normalThrottle
case events.SpeedZone_SLOW:
return sp.slowThrottle
}
return sp.slowThrottle
}
func NewCustomSteeringProcessor(cfg *Config) *CustomSteeringProcessor {
return &CustomSteeringProcessor{
cfg: cfg,
}
}
type CustomSteeringProcessor struct {
cfg *Config
}
func (cp *CustomSteeringProcessor) Process(steering types.Steering) types.Throttle {
return cp.cfg.ValueOf(steering)
}
func (cp *CustomSteeringProcessor) SetSpeedZone(_ events.SpeedZone) {
return
}
var emptyConfig = Config{
SteeringValues: []types.Steering{},
ThrottleSteps: []types.Throttle{},
}
func NewConfigFromJson(fileName string) (*Config, error) {
content, err := os.ReadFile(fileName)
if err != nil {
return nil, fmt.Errorf("unable to read content from %s file: %w", fileName, err)
}
var ft Config
err = json.Unmarshal(content, &ft)
if err != nil {
return &emptyConfig, fmt.Errorf("unable to unmarshal json content from %s file: %w", fileName, err)
}
if len(ft.SteeringValues) == 0 {
return &emptyConfig, fmt.Errorf("invalid configuration, none steering value'")
}
if len(ft.SteeringValues) != len(ft.ThrottleSteps) {
return &emptyConfig, fmt.Errorf("invalid config, steering value number must be equals "+
"to throttle value number: %v/%v", len(ft.SteeringValues), len(ft.ThrottleSteps))
}
lastT := types.Throttle(1.)
for _, t := range ft.ThrottleSteps {
if t < 0. || t > 1. {
return &emptyConfig, fmt.Errorf("invalid throttle value: 0.0 < %v <= 1.0", t)
}
if t >= lastT {
return &emptyConfig, fmt.Errorf("invalid throttle value, all values must be decreasing: %v <= %v", lastT, t)
}
lastT = t
}
lastS := types.Steering(-0.001)
for _, s := range ft.SteeringValues {
if s < 0. || s > 1. {
return &emptyConfig, fmt.Errorf("invalid steering value: 0.0 < %v <= 1.0", s)
}
if s <= lastS {
return &emptyConfig, fmt.Errorf("invalid steering value, all values must be increasing: %v <= %v", lastS, s)
}
lastS = s
}
return &ft, nil
}
type Config struct {
SteeringValues []types.Steering `json:"steering_values"`
ThrottleSteps []types.Throttle `json:"throttle_steps"`
}
func (tc *Config) ValueOf(s types.Steering) types.Throttle {
st := s
if s < 0. {
st = s * -1
}
if st < tc.SteeringValues[0] {
return tc.ThrottleSteps[0]
}
for i, steeringStep := range tc.SteeringValues {
if st < steeringStep {
return tc.ThrottleSteps[i-1]
}
}
return tc.ThrottleSteps[len(tc.ThrottleSteps)-1]
}

View File

@ -1,11 +1,7 @@
package throttle
import (
"github.com/cyrilix/robocar-protobuf/go/events"
"github.com/cyrilix/robocar-throttle/pkg/types"
"os"
"path"
"reflect"
"testing"
)
@ -15,7 +11,7 @@ func TestSteeringProcessor_Process(t *testing.T) {
maxThrottle types.Throttle
}
type args struct {
steering types.Steering
steering float32
}
tests := []struct {
name string
@ -91,324 +87,3 @@ func TestSteeringProcessor_Process(t *testing.T) {
})
}
}
func TestSpeedZoneProcessor_Process(t *testing.T) {
type fields struct {
slowThrottle types.Throttle
normalThrottle types.Throttle
fastThrottle types.Throttle
speedZone events.SpeedZone
}
type args struct {
steering types.Steering
}
tests := []struct {
name string
fields fields
args args
want types.Throttle
}{
{
name: "steering straight, undefined zone",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_SLOW},
args: args{steering: 0.},
want: 0.2,
},
{
name: "steering straight, slow zone",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_SLOW},
args: args{steering: 0.},
want: 0.2,
},
{
name: "moderate left, slow speed",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_SLOW},
args: args{steering: -0.5},
want: 0.2,
},
{
name: "moderate right, slow speed",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_SLOW},
args: args{steering: 0.5},
want: 0.2,
},
{
name: "full left, slow speed",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_SLOW},
args: args{steering: -0.95},
want: 0.2,
},
{
name: "full right, slow speed",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_SLOW},
args: args{steering: 0.95},
want: 0.2,
},
{
name: "steering straight, normal zone",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_NORMAL},
args: args{steering: 0.},
want: 0.5,
},
{
name: "moderate left, normal speed",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_NORMAL},
args: args{steering: -0.5},
want: 0.5,
},
{
name: "moderate right, normal speed",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_NORMAL},
args: args{steering: 0.5},
want: 0.5,
},
{
name: "full left, normal speed",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_NORMAL},
args: args{steering: -0.95},
want: 0.2,
},
{
name: "full right, normal speed",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_NORMAL},
args: args{steering: 0.95},
want: 0.2,
},
{
name: "steering straight, fast zone",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_FAST},
args: args{steering: 0.},
want: 0.8,
},
{
name: "moderate left, fast speed",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_FAST},
args: args{steering: -0.5},
want: 0.5,
},
{
name: "moderate right, fast speed",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_FAST},
args: args{steering: 0.5},
want: 0.5,
},
{
name: "full left, fast speed",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_FAST},
args: args{steering: -0.95},
want: 0.2,
},
{
name: "full right, fast speed",
fields: fields{slowThrottle: 0.2, normalThrottle: 0.5, fastThrottle: 0.8, speedZone: events.SpeedZone_FAST},
args: args{steering: 0.95},
want: 0.2,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
sp := &SpeedZoneProcessor{
slowThrottle: tt.fields.slowThrottle,
normalThrottle: tt.fields.normalThrottle,
fastThrottle: tt.fields.fastThrottle,
moderateSteering: 0.4,
fullSteering: 0.8,
}
sp.SetSpeedZone(tt.fields.speedZone)
if got := sp.Process(tt.args.steering); got != tt.want {
t.Errorf("Process() = %v, want %v", got, tt.want)
}
})
}
}
func TestConfig_ValueOf(t *testing.T) {
type fields struct {
SteeringValue []types.Steering
Data []types.Throttle
}
type args struct {
s types.Steering
}
tests := []struct {
name string
fields fields
args args
want types.Throttle
}{
{
name: "Nil steering",
fields: fields{[]types.Steering{0.0, 0.5, 1.0}, []types.Throttle{0.9, 0.6, 0.1}},
args: args{0.0},
want: 0.9,
},
{
name: "Nil steering < min config",
fields: fields{[]types.Steering{0.2, 0.5, 1.0}, []types.Throttle{0.9, 0.6, 0.3}},
args: args{0.1},
want: 0.9,
},
{
name: "No nil steering",
fields: fields{[]types.Steering{0.0, 0.5, 1.0}, []types.Throttle{0.9, 0.6, 0.1}},
args: args{0.2},
want: 0.9,
},
{
name: "Intermediate steering",
fields: fields{[]types.Steering{0.0, 0.5, 1.0}, []types.Throttle{0.9, 0.6, 0.1}},
args: args{0.5},
want: 0.6,
},
{
name: "Max steering",
fields: fields{[]types.Steering{0.0, 0.5, 1.0}, []types.Throttle{0.9, 0.6, 0.1}},
args: args{1.0},
want: 0.1,
},
{
name: "Over steering",
fields: fields{[]types.Steering{0.0, 0.5, 1.0}, []types.Throttle{0.9, 0.6, 0.1}},
args: args{1.1},
want: 0.1,
},
{
name: "Negative steering < min config",
fields: fields{[]types.Steering{0.2, 0.5, 1.0}, []types.Throttle{0.9, 0.6, 0.3}},
args: args{-0.1},
want: 0.9,
},
{
name: "Negative steering",
fields: fields{[]types.Steering{0.0, 0.5, 1.0}, []types.Throttle{0.9, 0.6, 0.1}},
args: args{-0.2},
want: 0.9,
},
{
name: "Negative Intermediate steering",
fields: fields{[]types.Steering{0.0, 0.5, 1.0}, []types.Throttle{0.9, 0.6, 0.1}},
args: args{-0.5},
want: 0.6,
},
{
name: "Minimum steering",
fields: fields{[]types.Steering{0.0, 0.5, 1.0}, []types.Throttle{0.9, 0.6, 0.1}},
args: args{-1.0},
want: 0.1,
},
{
name: "Negative Over steering",
fields: fields{[]types.Steering{0.0, 0.5, 1.0}, []types.Throttle{0.9, 0.6, 0.1}},
args: args{-1.1},
want: 0.1,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
tc := &Config{
SteeringValues: tt.fields.SteeringValue,
ThrottleSteps: tt.fields.Data,
}
if got := tc.ValueOf(tt.args.s); got != tt.want {
t.Errorf("ValueOf() = %v, want %v", got, tt.want)
}
})
}
}
func TestNewConfigFromJson(t *testing.T) {
type args struct {
configContent string
}
tests := []struct {
name string
args args
want *Config
wantErr bool
}{
{
name: "default",
args: args{
configContent: `{
"steering_values": [0.0, 0.5, 1.0],
"throttle_steps": [0.9, 0.6, 0.1]
}
`,
},
want: &Config{
SteeringValues: []types.Steering{0., 0.5, 1.},
ThrottleSteps: []types.Throttle{0.9, 0.6, 0.1},
},
},
{
name: "invalid config",
args: args{
configContent: `{ "steering_values" }`,
},
want: &emptyConfig,
wantErr: true,
},
{
name: "empty config",
args: args{
configContent: `{
"steering_values": [],
"throttle_steps": []
}`,
},
want: &emptyConfig,
wantErr: true,
},
{
name: "incoherent config",
args: args{
configContent: `{
"steering_values": [0.0, 0.5, 1.0],
"throttle_steps": [0.9, 0.1]
}`,
},
want: &emptyConfig,
wantErr: true,
},
{
name: "steering in bad order",
args: args{
configContent: `{
"steering_values": [0.0, 0.6, 0.5],
"throttle_steps": [0.9, 0.5, 0.1]
}`,
},
want: &emptyConfig,
wantErr: true,
},
{
name: "throttle in bad order",
args: args{
configContent: `{
"steering_values": [0.0, 0.5, 0.9],
"throttle_steps": [0.4, 0.5, 0.1]
}`,
},
want: &emptyConfig,
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
configName := path.Join(t.TempDir(), "config.json")
err := os.WriteFile(configName, []byte(tt.args.configContent), 0644)
if err != nil {
t.Errorf("unable to create test config: %v", err)
}
got, err := NewConfigFromJson(configName)
if (err != nil) != tt.wantErr {
t.Errorf("NewConfigFromJson() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("NewConfigFromJson() got = %v, want %v", got, tt.want)
}
})
}
}

View File

@ -1,5 +1,3 @@
package types
type Throttle float32
type Steering float32

View File

@ -21,58 +21,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type SpeedZone int32
const (
SpeedZone_UNKNOWN SpeedZone = 0
SpeedZone_SLOW SpeedZone = 1
SpeedZone_NORMAL SpeedZone = 2
SpeedZone_FAST SpeedZone = 3
)
// Enum value maps for SpeedZone.
var (
SpeedZone_name = map[int32]string{
0: "UNKNOWN",
1: "SLOW",
2: "NORMAL",
3: "FAST",
}
SpeedZone_value = map[string]int32{
"UNKNOWN": 0,
"SLOW": 1,
"NORMAL": 2,
"FAST": 3,
}
)
func (x SpeedZone) Enum() *SpeedZone {
p := new(SpeedZone)
*p = x
return p
}
func (x SpeedZone) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (SpeedZone) Descriptor() protoreflect.EnumDescriptor {
return file_events_events_proto_enumTypes[0].Descriptor()
}
func (SpeedZone) Type() protoreflect.EnumType {
return &file_events_events_proto_enumTypes[0]
}
func (x SpeedZone) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use SpeedZone.Descriptor instead.
func (SpeedZone) EnumDescriptor() ([]byte, []int) {
return file_events_events_proto_rawDescGZIP(), []int{0}
}
type DriveMode int32
const (
@ -106,11 +54,11 @@ func (x DriveMode) String() string {
}
func (DriveMode) Descriptor() protoreflect.EnumDescriptor {
return file_events_events_proto_enumTypes[1].Descriptor()
return file_events_events_proto_enumTypes[0].Descriptor()
}
func (DriveMode) Type() protoreflect.EnumType {
return &file_events_events_proto_enumTypes[1]
return &file_events_events_proto_enumTypes[0]
}
func (x DriveMode) Number() protoreflect.EnumNumber {
@ -119,7 +67,7 @@ func (x DriveMode) Number() protoreflect.EnumNumber {
// Deprecated: Use DriveMode.Descriptor instead.
func (DriveMode) EnumDescriptor() ([]byte, []int) {
return file_events_events_proto_rawDescGZIP(), []int{1}
return file_events_events_proto_rawDescGZIP(), []int{0}
}
type TypeObject int32
@ -158,11 +106,11 @@ func (x TypeObject) String() string {
}
func (TypeObject) Descriptor() protoreflect.EnumDescriptor {
return file_events_events_proto_enumTypes[2].Descriptor()
return file_events_events_proto_enumTypes[1].Descriptor()
}
func (TypeObject) Type() protoreflect.EnumType {
return &file_events_events_proto_enumTypes[2]
return &file_events_events_proto_enumTypes[1]
}
func (x TypeObject) Number() protoreflect.EnumNumber {
@ -171,7 +119,7 @@ func (x TypeObject) Number() protoreflect.EnumNumber {
// Deprecated: Use TypeObject.Descriptor instead.
func (TypeObject) EnumDescriptor() ([]byte, []int) {
return file_events_events_proto_rawDescGZIP(), []int{2}
return file_events_events_proto_rawDescGZIP(), []int{1}
}
type FrameRef struct {
@ -418,69 +366,6 @@ func (x *ThrottleMessage) GetFrameRef() *FrameRef {
return nil
}
type SpeedZoneMessage struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SpeedZone SpeedZone `protobuf:"varint,1,opt,name=speed_zone,json=speedZone,proto3,enum=robocar.events.SpeedZone" json:"speed_zone,omitempty"`
Confidence float32 `protobuf:"fixed32,2,opt,name=confidence,proto3" json:"confidence,omitempty"`
FrameRef *FrameRef `protobuf:"bytes,3,opt,name=frame_ref,json=frameRef,proto3" json:"frame_ref,omitempty"`
}
func (x *SpeedZoneMessage) Reset() {
*x = SpeedZoneMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_events_events_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SpeedZoneMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SpeedZoneMessage) ProtoMessage() {}
func (x *SpeedZoneMessage) ProtoReflect() protoreflect.Message {
mi := &file_events_events_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SpeedZoneMessage.ProtoReflect.Descriptor instead.
func (*SpeedZoneMessage) Descriptor() ([]byte, []int) {
return file_events_events_proto_rawDescGZIP(), []int{4}
}
func (x *SpeedZoneMessage) GetSpeedZone() SpeedZone {
if x != nil {
return x.SpeedZone
}
return SpeedZone_UNKNOWN
}
func (x *SpeedZoneMessage) GetConfidence() float32 {
if x != nil {
return x.Confidence
}
return 0
}
func (x *SpeedZoneMessage) GetFrameRef() *FrameRef {
if x != nil {
return x.FrameRef
}
return nil
}
type DriveModeMessage struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -492,7 +377,7 @@ type DriveModeMessage struct {
func (x *DriveModeMessage) Reset() {
*x = DriveModeMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_events_events_proto_msgTypes[5]
mi := &file_events_events_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -505,7 +390,7 @@ func (x *DriveModeMessage) String() string {
func (*DriveModeMessage) ProtoMessage() {}
func (x *DriveModeMessage) ProtoReflect() protoreflect.Message {
mi := &file_events_events_proto_msgTypes[5]
mi := &file_events_events_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -518,7 +403,7 @@ func (x *DriveModeMessage) ProtoReflect() protoreflect.Message {
// Deprecated: Use DriveModeMessage.ProtoReflect.Descriptor instead.
func (*DriveModeMessage) Descriptor() ([]byte, []int) {
return file_events_events_proto_rawDescGZIP(), []int{5}
return file_events_events_proto_rawDescGZIP(), []int{4}
}
func (x *DriveModeMessage) GetDriveMode() DriveMode {
@ -540,7 +425,7 @@ type ObjectsMessage struct {
func (x *ObjectsMessage) Reset() {
*x = ObjectsMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_events_events_proto_msgTypes[6]
mi := &file_events_events_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -553,7 +438,7 @@ func (x *ObjectsMessage) String() string {
func (*ObjectsMessage) ProtoMessage() {}
func (x *ObjectsMessage) ProtoReflect() protoreflect.Message {
mi := &file_events_events_proto_msgTypes[6]
mi := &file_events_events_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -566,7 +451,7 @@ func (x *ObjectsMessage) ProtoReflect() protoreflect.Message {
// Deprecated: Use ObjectsMessage.ProtoReflect.Descriptor instead.
func (*ObjectsMessage) Descriptor() ([]byte, []int) {
return file_events_events_proto_rawDescGZIP(), []int{6}
return file_events_events_proto_rawDescGZIP(), []int{5}
}
func (x *ObjectsMessage) GetObjects() []*Object {
@ -600,7 +485,7 @@ type Object struct {
func (x *Object) Reset() {
*x = Object{}
if protoimpl.UnsafeEnabled {
mi := &file_events_events_proto_msgTypes[7]
mi := &file_events_events_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -613,7 +498,7 @@ func (x *Object) String() string {
func (*Object) ProtoMessage() {}
func (x *Object) ProtoReflect() protoreflect.Message {
mi := &file_events_events_proto_msgTypes[7]
mi := &file_events_events_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -626,7 +511,7 @@ func (x *Object) ProtoReflect() protoreflect.Message {
// Deprecated: Use Object.ProtoReflect.Descriptor instead.
func (*Object) Descriptor() ([]byte, []int) {
return file_events_events_proto_rawDescGZIP(), []int{7}
return file_events_events_proto_rawDescGZIP(), []int{6}
}
func (x *Object) GetType() TypeObject {
@ -682,7 +567,7 @@ type SwitchRecordMessage struct {
func (x *SwitchRecordMessage) Reset() {
*x = SwitchRecordMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_events_events_proto_msgTypes[8]
mi := &file_events_events_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -695,7 +580,7 @@ func (x *SwitchRecordMessage) String() string {
func (*SwitchRecordMessage) ProtoMessage() {}
func (x *SwitchRecordMessage) ProtoReflect() protoreflect.Message {
mi := &file_events_events_proto_msgTypes[8]
mi := &file_events_events_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -708,7 +593,7 @@ func (x *SwitchRecordMessage) ProtoReflect() protoreflect.Message {
// Deprecated: Use SwitchRecordMessage.ProtoReflect.Descriptor instead.
func (*SwitchRecordMessage) Descriptor() ([]byte, []int) {
return file_events_events_proto_rawDescGZIP(), []int{8}
return file_events_events_proto_rawDescGZIP(), []int{7}
}
func (x *SwitchRecordMessage) GetEnabled() bool {
@ -732,7 +617,7 @@ type RoadMessage struct {
func (x *RoadMessage) Reset() {
*x = RoadMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_events_events_proto_msgTypes[9]
mi := &file_events_events_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -745,7 +630,7 @@ func (x *RoadMessage) String() string {
func (*RoadMessage) ProtoMessage() {}
func (x *RoadMessage) ProtoReflect() protoreflect.Message {
mi := &file_events_events_proto_msgTypes[9]
mi := &file_events_events_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -758,7 +643,7 @@ func (x *RoadMessage) ProtoReflect() protoreflect.Message {
// Deprecated: Use RoadMessage.ProtoReflect.Descriptor instead.
func (*RoadMessage) Descriptor() ([]byte, []int) {
return file_events_events_proto_rawDescGZIP(), []int{9}
return file_events_events_proto_rawDescGZIP(), []int{8}
}
func (x *RoadMessage) GetContour() []*Point {
@ -794,7 +679,7 @@ type Point struct {
func (x *Point) Reset() {
*x = Point{}
if protoimpl.UnsafeEnabled {
mi := &file_events_events_proto_msgTypes[10]
mi := &file_events_events_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -807,7 +692,7 @@ func (x *Point) String() string {
func (*Point) ProtoMessage() {}
func (x *Point) ProtoReflect() protoreflect.Message {
mi := &file_events_events_proto_msgTypes[10]
mi := &file_events_events_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -820,7 +705,7 @@ func (x *Point) ProtoReflect() protoreflect.Message {
// Deprecated: Use Point.ProtoReflect.Descriptor instead.
func (*Point) Descriptor() ([]byte, []int) {
return file_events_events_proto_rawDescGZIP(), []int{10}
return file_events_events_proto_rawDescGZIP(), []int{9}
}
func (x *Point) GetX() int32 {
@ -852,7 +737,7 @@ type Ellipse struct {
func (x *Ellipse) Reset() {
*x = Ellipse{}
if protoimpl.UnsafeEnabled {
mi := &file_events_events_proto_msgTypes[11]
mi := &file_events_events_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -865,7 +750,7 @@ func (x *Ellipse) String() string {
func (*Ellipse) ProtoMessage() {}
func (x *Ellipse) ProtoReflect() protoreflect.Message {
mi := &file_events_events_proto_msgTypes[11]
mi := &file_events_events_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -878,7 +763,7 @@ func (x *Ellipse) ProtoReflect() protoreflect.Message {
// Deprecated: Use Ellipse.ProtoReflect.Descriptor instead.
func (*Ellipse) Descriptor() ([]byte, []int) {
return file_events_events_proto_rawDescGZIP(), []int{11}
return file_events_events_proto_rawDescGZIP(), []int{10}
}
func (x *Ellipse) GetCenter() *Point {
@ -924,15 +809,13 @@ type RecordMessage struct {
Frame *FrameMessage `protobuf:"bytes,1,opt,name=frame,proto3" json:"frame,omitempty"`
Steering *SteeringMessage `protobuf:"bytes,2,opt,name=steering,proto3" json:"steering,omitempty"`
AutopilotSteering *SteeringMessage `protobuf:"bytes,4,opt,name=autopilot_steering,json=autopilotSteering,proto3" json:"autopilot_steering,omitempty"`
DriveMode *DriveModeMessage `protobuf:"bytes,5,opt,name=drive_mode,json=driveMode,proto3" json:"drive_mode,omitempty"`
RecordSet string `protobuf:"bytes,3,opt,name=recordSet,proto3" json:"recordSet,omitempty"` // Record set name
}
func (x *RecordMessage) Reset() {
*x = RecordMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_events_events_proto_msgTypes[12]
mi := &file_events_events_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -945,7 +828,7 @@ func (x *RecordMessage) String() string {
func (*RecordMessage) ProtoMessage() {}
func (x *RecordMessage) ProtoReflect() protoreflect.Message {
mi := &file_events_events_proto_msgTypes[12]
mi := &file_events_events_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -958,7 +841,7 @@ func (x *RecordMessage) ProtoReflect() protoreflect.Message {
// Deprecated: Use RecordMessage.ProtoReflect.Descriptor instead.
func (*RecordMessage) Descriptor() ([]byte, []int) {
return file_events_events_proto_rawDescGZIP(), []int{12}
return file_events_events_proto_rawDescGZIP(), []int{11}
}
func (x *RecordMessage) GetFrame() *FrameMessage {
@ -975,20 +858,6 @@ func (x *RecordMessage) GetSteering() *SteeringMessage {
return nil
}
func (x *RecordMessage) GetAutopilotSteering() *SteeringMessage {
if x != nil {
return x.AutopilotSteering
}
return nil
}
func (x *RecordMessage) GetDriveMode() *DriveModeMessage {
if x != nil {
return x.DriveMode
}
return nil
}
func (x *RecordMessage) GetRecordSet() string {
if x != nil {
return x.RecordSet
@ -1032,96 +901,73 @@ var file_events_events_proto_rawDesc = []byte{
0x65, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x6f,
0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x46, 0x72, 0x61,
0x6d, 0x65, 0x52, 0x65, 0x66, 0x52, 0x08, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x66, 0x22,
0xa3, 0x01, 0x0a, 0x10, 0x53, 0x70, 0x65, 0x65, 0x64, 0x5a, 0x6f, 0x6e, 0x65, 0x4d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x73, 0x70, 0x65, 0x65, 0x64, 0x5f, 0x7a, 0x6f,
0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63,
0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x70, 0x65, 0x65, 0x64, 0x5a,
0x6f, 0x6e, 0x65, 0x52, 0x09, 0x73, 0x70, 0x65, 0x65, 0x64, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x1e,
0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x02, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x35,
0x0a, 0x09, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x18, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e,
0x74, 0x73, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x66, 0x52, 0x08, 0x66, 0x72, 0x61,
0x6d, 0x65, 0x52, 0x65, 0x66, 0x22, 0x4c, 0x0a, 0x10, 0x44, 0x72, 0x69, 0x76, 0x65, 0x4d, 0x6f,
0x64, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x64, 0x72, 0x69,
0x76, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e,
0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x44,
0x72, 0x69, 0x76, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x64, 0x72, 0x69, 0x76, 0x65, 0x4d,
0x6f, 0x64, 0x65, 0x22, 0x79, 0x0a, 0x0e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x4d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73,
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72,
0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07,
0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x35, 0x0a, 0x09, 0x66, 0x72, 0x61, 0x6d, 0x65,
0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x6f, 0x62,
0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x46, 0x72, 0x61, 0x6d,
0x65, 0x52, 0x65, 0x66, 0x52, 0x08, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x66, 0x22, 0xac,
0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61,
0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x4f, 0x62, 0x6a,
0x65, 0x63, 0x74, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x65, 0x66,
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x10, 0x0a,
0x03, 0x74, 0x6f, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x03, 0x74, 0x6f, 0x70, 0x12,
0x14, 0x0a, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05,
0x72, 0x69, 0x67, 0x68, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x18,
0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x12, 0x1e, 0x0a,
0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
0x02, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x2f, 0x0a,
0x13, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x4d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0xa8,
0x01, 0x0a, 0x0b, 0x52, 0x6f, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2f,
0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x6f, 0x75, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x15, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x6f, 0x75, 0x72, 0x12,
0x31, 0x0a, 0x07, 0x65, 0x6c, 0x6c, 0x69, 0x70, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x17, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2e, 0x45, 0x6c, 0x6c, 0x69, 0x70, 0x73, 0x65, 0x52, 0x07, 0x65, 0x6c, 0x6c, 0x69, 0x70,
0x73, 0x65, 0x12, 0x35, 0x0a, 0x09, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x18,
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e,
0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x66, 0x52,
0x08, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x66, 0x22, 0x23, 0x0a, 0x05, 0x50, 0x6f, 0x69,
0x6e, 0x74, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x78,
0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x79, 0x22, 0x9c,
0x01, 0x0a, 0x07, 0x45, 0x6c, 0x6c, 0x69, 0x70, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x63, 0x65,
0x6e, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x6f, 0x62,
0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, 0x6f, 0x69, 0x6e,
0x74, 0x52, 0x06, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64,
0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12,
0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6e, 0x67, 0x6c, 0x65,
0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x1e, 0x0a,
0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
0x02, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x22, 0xaf, 0x02,
0x0a, 0x0d, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
0x32, 0x0a, 0x05, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c,
0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e,
0x46, 0x72, 0x61, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x66, 0x72,
0x61, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x74, 0x65, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e,
0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x65, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x73, 0x74, 0x65, 0x65, 0x72, 0x69, 0x6e, 0x67,
0x12, 0x4e, 0x0a, 0x12, 0x61, 0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x5f, 0x73, 0x74,
0x65, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x72,
0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x74,
0x65, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x11, 0x61,
0x75, 0x74, 0x6f, 0x70, 0x69, 0x6c, 0x6f, 0x74, 0x53, 0x74, 0x65, 0x65, 0x72, 0x69, 0x6e, 0x67,
0x12, 0x3f, 0x0a, 0x0a, 0x64, 0x72, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x05,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65,
0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x09, 0x64, 0x72, 0x69, 0x76, 0x65, 0x4d, 0x6f, 0x64,
0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x74, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x74, 0x2a,
0x38, 0x0a, 0x09, 0x53, 0x70, 0x65, 0x65, 0x64, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x0b, 0x0a, 0x07,
0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x4c, 0x4f,
0x57, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x02, 0x12,
0x08, 0x0a, 0x04, 0x46, 0x41, 0x53, 0x54, 0x10, 0x03, 0x2a, 0x2d, 0x0a, 0x09, 0x44, 0x72, 0x69,
0x76, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49,
0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x09, 0x0a,
0x05, 0x50, 0x49, 0x4c, 0x4f, 0x54, 0x10, 0x02, 0x2a, 0x32, 0x0a, 0x0a, 0x54, 0x79, 0x70, 0x65,
0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x59, 0x10, 0x00, 0x12,
0x07, 0x0a, 0x03, 0x43, 0x41, 0x52, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x55, 0x4d, 0x50,
0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x50, 0x4c, 0x4f, 0x54, 0x10, 0x03, 0x42, 0x0a, 0x5a, 0x08,
0x2e, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x4c, 0x0a, 0x10, 0x44, 0x72, 0x69, 0x76, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x64, 0x72, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x6f, 0x64,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61,
0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x4d, 0x6f,
0x64, 0x65, 0x52, 0x09, 0x64, 0x72, 0x69, 0x76, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x22, 0x79, 0x0a,
0x0e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
0x30, 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x16, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74,
0x73, 0x12, 0x35, 0x0a, 0x09, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65,
0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x66, 0x52, 0x08,
0x66, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x66, 0x22, 0xac, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a,
0x65, 0x63, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x1a, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e,
0x74, 0x73, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x04, 0x74,
0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
0x02, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x6f, 0x70, 0x18, 0x03,
0x20, 0x01, 0x28, 0x02, 0x52, 0x03, 0x74, 0x6f, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x69, 0x67,
0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x12,
0x16, 0x0a, 0x06, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52,
0x06, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69,
0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x63, 0x6f, 0x6e,
0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x2f, 0x0a, 0x13, 0x53, 0x77, 0x69, 0x74, 0x63,
0x68, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18,
0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52,
0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0xa8, 0x01, 0x0a, 0x0b, 0x52, 0x6f, 0x61,
0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74,
0x6f, 0x75, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x6f, 0x62, 0x6f,
0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74,
0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x6f, 0x75, 0x72, 0x12, 0x31, 0x0a, 0x07, 0x65, 0x6c, 0x6c,
0x69, 0x70, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x72, 0x6f, 0x62,
0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x6c, 0x6c, 0x69,
0x70, 0x73, 0x65, 0x52, 0x07, 0x65, 0x6c, 0x6c, 0x69, 0x70, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x09,
0x66, 0x72, 0x61, 0x6d, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x18, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x66, 0x52, 0x08, 0x66, 0x72, 0x61, 0x6d, 0x65,
0x52, 0x65, 0x66, 0x22, 0x23, 0x0a, 0x05, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x0c, 0x0a, 0x01,
0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x79, 0x22, 0x9c, 0x01, 0x0a, 0x07, 0x45, 0x6c, 0x6c,
0x69, 0x70, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65,
0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x63, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01,
0x28, 0x05, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69,
0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68,
0x74, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02,
0x52, 0x05, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69,
0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x63, 0x6f, 0x6e,
0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x63, 0x6f,
0x72, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x66, 0x72, 0x61,
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63,
0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x3b, 0x0a,
0x08, 0x73, 0x74, 0x65, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x1f, 0x2e, 0x72, 0x6f, 0x62, 0x6f, 0x63, 0x61, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
0x2e, 0x53, 0x74, 0x65, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x52, 0x08, 0x73, 0x74, 0x65, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65,
0x63, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72,
0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x74, 0x2a, 0x2d, 0x0a, 0x09, 0x44, 0x72, 0x69, 0x76,
0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44,
0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05,
0x50, 0x49, 0x4c, 0x4f, 0x54, 0x10, 0x02, 0x2a, 0x32, 0x0a, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x4f,
0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x59, 0x10, 0x00, 0x12, 0x07,
0x0a, 0x03, 0x43, 0x41, 0x52, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x55, 0x4d, 0x50, 0x10,
0x02, 0x12, 0x08, 0x0a, 0x04, 0x50, 0x4c, 0x4f, 0x54, 0x10, 0x03, 0x42, 0x0a, 0x5a, 0x08, 0x2e,
0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -1136,51 +982,45 @@ func file_events_events_proto_rawDescGZIP() []byte {
return file_events_events_proto_rawDescData
}
var file_events_events_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
var file_events_events_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_events_events_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_events_events_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_events_events_proto_goTypes = []interface{}{
(SpeedZone)(0), // 0: robocar.events.SpeedZone
(DriveMode)(0), // 1: robocar.events.DriveMode
(TypeObject)(0), // 2: robocar.events.TypeObject
(*FrameRef)(nil), // 3: robocar.events.FrameRef
(*FrameMessage)(nil), // 4: robocar.events.FrameMessage
(*SteeringMessage)(nil), // 5: robocar.events.SteeringMessage
(*ThrottleMessage)(nil), // 6: robocar.events.ThrottleMessage
(*SpeedZoneMessage)(nil), // 7: robocar.events.SpeedZoneMessage
(*DriveModeMessage)(nil), // 8: robocar.events.DriveModeMessage
(*ObjectsMessage)(nil), // 9: robocar.events.ObjectsMessage
(*Object)(nil), // 10: robocar.events.Object
(*SwitchRecordMessage)(nil), // 11: robocar.events.SwitchRecordMessage
(*RoadMessage)(nil), // 12: robocar.events.RoadMessage
(*Point)(nil), // 13: robocar.events.Point
(*Ellipse)(nil), // 14: robocar.events.Ellipse
(*RecordMessage)(nil), // 15: robocar.events.RecordMessage
(*timestamp.Timestamp)(nil), // 16: google.protobuf.Timestamp
(DriveMode)(0), // 0: robocar.events.DriveMode
(TypeObject)(0), // 1: robocar.events.TypeObject
(*FrameRef)(nil), // 2: robocar.events.FrameRef
(*FrameMessage)(nil), // 3: robocar.events.FrameMessage
(*SteeringMessage)(nil), // 4: robocar.events.SteeringMessage
(*ThrottleMessage)(nil), // 5: robocar.events.ThrottleMessage
(*DriveModeMessage)(nil), // 6: robocar.events.DriveModeMessage
(*ObjectsMessage)(nil), // 7: robocar.events.ObjectsMessage
(*Object)(nil), // 8: robocar.events.Object
(*SwitchRecordMessage)(nil), // 9: robocar.events.SwitchRecordMessage
(*RoadMessage)(nil), // 10: robocar.events.RoadMessage
(*Point)(nil), // 11: robocar.events.Point
(*Ellipse)(nil), // 12: robocar.events.Ellipse
(*RecordMessage)(nil), // 13: robocar.events.RecordMessage
(*timestamp.Timestamp)(nil), // 14: google.protobuf.Timestamp
}
var file_events_events_proto_depIdxs = []int32{
16, // 0: robocar.events.FrameRef.created_at:type_name -> google.protobuf.Timestamp
3, // 1: robocar.events.FrameMessage.id:type_name -> robocar.events.FrameRef
3, // 2: robocar.events.SteeringMessage.frame_ref:type_name -> robocar.events.FrameRef
3, // 3: robocar.events.ThrottleMessage.frame_ref:type_name -> robocar.events.FrameRef
0, // 4: robocar.events.SpeedZoneMessage.speed_zone:type_name -> robocar.events.SpeedZone
3, // 5: robocar.events.SpeedZoneMessage.frame_ref:type_name -> robocar.events.FrameRef
1, // 6: robocar.events.DriveModeMessage.drive_mode:type_name -> robocar.events.DriveMode
10, // 7: robocar.events.ObjectsMessage.objects:type_name -> robocar.events.Object
3, // 8: robocar.events.ObjectsMessage.frame_ref:type_name -> robocar.events.FrameRef
2, // 9: robocar.events.Object.type:type_name -> robocar.events.TypeObject
13, // 10: robocar.events.RoadMessage.contour:type_name -> robocar.events.Point
14, // 11: robocar.events.RoadMessage.ellipse:type_name -> robocar.events.Ellipse
3, // 12: robocar.events.RoadMessage.frame_ref:type_name -> robocar.events.FrameRef
13, // 13: robocar.events.Ellipse.center:type_name -> robocar.events.Point
4, // 14: robocar.events.RecordMessage.frame:type_name -> robocar.events.FrameMessage
5, // 15: robocar.events.RecordMessage.steering:type_name -> robocar.events.SteeringMessage
5, // 16: robocar.events.RecordMessage.autopilot_steering:type_name -> robocar.events.SteeringMessage
8, // 17: robocar.events.RecordMessage.drive_mode:type_name -> robocar.events.DriveModeMessage
18, // [18:18] is the sub-list for method output_type
18, // [18:18] is the sub-list for method input_type
18, // [18:18] is the sub-list for extension type_name
18, // [18:18] is the sub-list for extension extendee
0, // [0:18] is the sub-list for field type_name
14, // 0: robocar.events.FrameRef.created_at:type_name -> google.protobuf.Timestamp
2, // 1: robocar.events.FrameMessage.id:type_name -> robocar.events.FrameRef
2, // 2: robocar.events.SteeringMessage.frame_ref:type_name -> robocar.events.FrameRef
2, // 3: robocar.events.ThrottleMessage.frame_ref:type_name -> robocar.events.FrameRef
0, // 4: robocar.events.DriveModeMessage.drive_mode:type_name -> robocar.events.DriveMode
8, // 5: robocar.events.ObjectsMessage.objects:type_name -> robocar.events.Object
2, // 6: robocar.events.ObjectsMessage.frame_ref:type_name -> robocar.events.FrameRef
1, // 7: robocar.events.Object.type:type_name -> robocar.events.TypeObject
11, // 8: robocar.events.RoadMessage.contour:type_name -> robocar.events.Point
12, // 9: robocar.events.RoadMessage.ellipse:type_name -> robocar.events.Ellipse
2, // 10: robocar.events.RoadMessage.frame_ref:type_name -> robocar.events.FrameRef
11, // 11: robocar.events.Ellipse.center:type_name -> robocar.events.Point
3, // 12: robocar.events.RecordMessage.frame:type_name -> robocar.events.FrameMessage
4, // 13: robocar.events.RecordMessage.steering:type_name -> robocar.events.SteeringMessage
14, // [14:14] is the sub-list for method output_type
14, // [14:14] is the sub-list for method input_type
14, // [14:14] is the sub-list for extension type_name
14, // [14:14] is the sub-list for extension extendee
0, // [0:14] is the sub-list for field type_name
}
func init() { file_events_events_proto_init() }
@ -1238,18 +1078,6 @@ func file_events_events_proto_init() {
}
}
file_events_events_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SpeedZoneMessage); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_events_events_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DriveModeMessage); i {
case 0:
return &v.state
@ -1261,7 +1089,7 @@ func file_events_events_proto_init() {
return nil
}
}
file_events_events_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_events_events_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ObjectsMessage); i {
case 0:
return &v.state
@ -1273,7 +1101,7 @@ func file_events_events_proto_init() {
return nil
}
}
file_events_events_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_events_events_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Object); i {
case 0:
return &v.state
@ -1285,7 +1113,7 @@ func file_events_events_proto_init() {
return nil
}
}
file_events_events_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_events_events_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SwitchRecordMessage); i {
case 0:
return &v.state
@ -1297,7 +1125,7 @@ func file_events_events_proto_init() {
return nil
}
}
file_events_events_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_events_events_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RoadMessage); i {
case 0:
return &v.state
@ -1309,7 +1137,7 @@ func file_events_events_proto_init() {
return nil
}
}
file_events_events_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_events_events_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Point); i {
case 0:
return &v.state
@ -1321,7 +1149,7 @@ func file_events_events_proto_init() {
return nil
}
}
file_events_events_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_events_events_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Ellipse); i {
case 0:
return &v.state
@ -1333,7 +1161,7 @@ func file_events_events_proto_init() {
return nil
}
}
file_events_events_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
file_events_events_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RecordMessage); i {
case 0:
return &v.state
@ -1351,8 +1179,8 @@ func file_events_events_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_events_events_proto_rawDesc,
NumEnums: 3,
NumMessages: 13,
NumEnums: 2,
NumMessages: 12,
NumExtensions: 0,
NumServices: 0,
},

2
vendor/modules.txt vendored
View File

@ -3,7 +3,7 @@
github.com/cyrilix/robocar-base/cli
github.com/cyrilix/robocar-base/service
github.com/cyrilix/robocar-base/testtools
# github.com/cyrilix/robocar-protobuf/go v1.3.0
# github.com/cyrilix/robocar-protobuf/go v1.1.0
## explicit; go 1.18
github.com/cyrilix/robocar-protobuf/go/events
# github.com/eclipse/paho.mqtt.golang v1.4.1