From 4a6f7774bf234f70ef57c98b977ca84adc9a24bc Mon Sep 17 00:00:00 2001 From: nicksanford Date: Thu, 27 Apr 2023 16:45:04 -0400 Subject: [PATCH] [RSDK-2753] bump rdk post reconfigure refactor (#190) Co-authored-by: Katharina Xenia Kufieta --- config/config.go | 8 ++--- config/config_test.go | 55 +++++++++++++++--------------- go.mod | 36 ++++++++++---------- go.sum | 72 ++++++++++++++++++++-------------------- sensors/depth/depth.go | 4 +-- sensors/lidar/lidar.go | 4 +-- sensors/rgb/rgb.go | 4 +-- testhelper/testhelper.go | 40 ++-------------------- 8 files changed, 95 insertions(+), 128 deletions(-) diff --git a/config/config.go b/config/config.go index 3238690f..ec68f0a1 100644 --- a/config/config.go +++ b/config/config.go @@ -42,8 +42,8 @@ func DetermineUseLiveData(logger golog.Logger, liveData *bool, sensors []string) return useLiveData, nil } -// AttrConfig describes how to configure the SLAM service. -type AttrConfig struct { +// Config describes how to configure the SLAM service. +type Config struct { Sensors []string `json:"sensors"` ConfigParams map[string]string `json:"config_params"` DataDirectory string `json:"data_dir"` @@ -55,7 +55,7 @@ type AttrConfig struct { } // Validate creates the list of implicit dependencies. -func (config *AttrConfig) Validate(path string) ([]string, error) { +func (config *Config) Validate(path string) ([]string, error) { if config.ConfigParams["mode"] == "" { return nil, utils.NewConfigValidationFieldRequiredError(path, "config_params[mode]") } @@ -83,7 +83,7 @@ func (config *AttrConfig) Validate(path string) ([]string, error) { // GetOptionalParameters sets any unset optional config parameters to the values passed to this function, // and returns them. -func GetOptionalParameters(config *AttrConfig, defaultPort string, +func GetOptionalParameters(config *Config, defaultPort string, defaultDataRateMsec, defaultMapRateSec int, logger golog.Logger, ) (string, int, int, bool, bool, error) { port := config.Port diff --git a/config/config_test.go b/config/config_test.go index cd79a1e0..409a3c88 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/edaniels/golog" - "go.viam.com/rdk/config" "go.viam.com/rdk/resource" + "go.viam.com/rdk/services/slam" "go.viam.com/test" "go.viam.com/utils" ) @@ -20,15 +20,15 @@ func TestValidate(t *testing.T) { logger := golog.NewTestLogger(t) t.Run("Empty config", func(t *testing.T) { - model := resource.NewDefaultModel(resource.ModelName("test")) - cfgService := config.Service{Name: "test", Type: "slam", Model: model} - _, err := newAttrConfig(cfgService) + model := resource.DefaultModelFamily.WithModel("test") + cfgService := resource.Config{Name: "test", API: slam.API, Model: model} + _, err := newConfig(cfgService) test.That(t, err, test.ShouldBeError, newError("error validating \"services.slam.attributes.fake\": \"config_params[mode]\" is required")) }) t.Run("Simplest valid config", func(t *testing.T) { cfgService := makeCfgService() - _, err := newAttrConfig(cfgService) + _, err := newConfig(cfgService) test.That(t, err, test.ShouldBeNil) }) @@ -36,39 +36,41 @@ func TestValidate(t *testing.T) { // Test for missing main attribute fields requiredFields := []string{"data_dir", "use_live_data"} for _, requiredField := range requiredFields { - logger.Debugf("Testing SLAM config without %s", requiredField) + logger.Debugf("Testing SLAM config without %s\n", requiredField) cfgService := makeCfgService() delete(cfgService.Attributes, requiredField) - _, err := newAttrConfig(cfgService) - test.That(t, err, test.ShouldBeError, newError(utils.NewConfigValidationFieldRequiredError(testCfgPath, requiredField).Error())) + _, err := newConfig(cfgService) + expected := newError(utils.NewConfigValidationFieldRequiredError(testCfgPath, requiredField).Error()) + + test.That(t, err, test.ShouldBeError, expected) } // Test for missing config_params attributes logger.Debug("Testing SLAM config without config_params[mode]") cfgService := makeCfgService() delete(cfgService.Attributes["config_params"].(map[string]string), "mode") - _, err := newAttrConfig(cfgService) + _, err := newConfig(cfgService) test.That(t, err, test.ShouldBeError, newError(utils.NewConfigValidationFieldRequiredError(testCfgPath, "config_params[mode]").Error())) }) t.Run("Config with invalid parameter type", func(t *testing.T) { cfgService := makeCfgService() cfgService.Attributes["use_live_data"] = "true" - _, err := newAttrConfig(cfgService) + _, err := newConfig(cfgService) expE := newError("1 error(s) decoding:\n\n* 'use_live_data' expected type 'bool', got unconvertible type 'string', value: 'true'") test.That(t, err, test.ShouldBeError, expE) cfgService.Attributes["use_live_data"] = true - _, err = newAttrConfig(cfgService) + _, err = newConfig(cfgService) test.That(t, err, test.ShouldBeNil) }) t.Run("Config with out of range values", func(t *testing.T) { cfgService := makeCfgService() cfgService.Attributes["data_rate_msec"] = -1 - _, err := newAttrConfig(cfgService) + _, err := newConfig(cfgService) test.That(t, err, test.ShouldBeError, newError("cannot specify data_rate_msec less than zero")) cfgService.Attributes["data_rate_msec"] = 1 cfgService.Attributes["map_rate_sec"] = -1 - _, err = newAttrConfig(cfgService) + _, err = newConfig(cfgService) test.That(t, err, test.ShouldBeError, newError("cannot specify map_rate_sec less than zero")) }) @@ -85,7 +87,7 @@ func TestValidate(t *testing.T) { "value": "0", "value_2": "test", } - cfg, err := newAttrConfig(cfgService) + cfg, err := newConfig(cfgService) test.That(t, err, test.ShouldBeNil) test.That(t, cfg.DataDirectory, test.ShouldEqual, cfgService.Attributes["data_dir"]) test.That(t, *cfg.UseLiveData, test.ShouldEqual, cfgService.Attributes["use_live_data"]) @@ -157,9 +159,9 @@ func TestDetermineUseLiveData(t *testing.T) { } // makeCfgService creates the simplest possible config that can pass validation. -func makeCfgService() config.Service { - model := resource.NewDefaultModel(resource.ModelName("test")) - cfgService := config.Service{Name: "test", Type: "slam", Model: model} +func makeCfgService() resource.Config { + model := resource.DefaultModelFamily.WithModel("test") + cfgService := resource.Config{Name: "test", API: slam.API, Model: model} cfgService.Attributes = make(map[string]interface{}) cfgService.Attributes["config_params"] = map[string]string{ "mode": "test mode", @@ -176,7 +178,7 @@ func TestGetOptionalParameters(t *testing.T) { cfgService := makeCfgService() cfgService.Attributes["sensors"] = []string{"a"} cfgService.Attributes["use_live_data"] = true - cfg, err := newAttrConfig(cfgService) + cfg, err := newConfig(cfgService) test.That(t, err, test.ShouldBeNil) port, dataRateMsec, mapRateSec, useLiveData, deleteProcessedData, err := GetOptionalParameters(cfg, "localhost", 1001, 1002, logger) test.That(t, err, test.ShouldBeNil) @@ -190,23 +192,22 @@ func TestGetOptionalParameters(t *testing.T) { t.Run("Live data without sensors", func(t *testing.T) { cfgService := makeCfgService() cfgService.Attributes["use_live_data"] = true - cfg, err := newAttrConfig(cfgService) + cfg, err := newConfig(cfgService) test.That(t, err, test.ShouldBeNil) _, _, _, _, _, err = GetOptionalParameters(cfg, "localhost", 1001, 1002, logger) test.That(t, err, test.ShouldBeError, newError("sensors field cannot be empty when use_live_data is set to true")) }) } -func newAttrConfig(cfg config.Service) (*AttrConfig, error) { - attrCfg := &AttrConfig{} - - if _, err := config.TransformAttributeMapToStruct(attrCfg, cfg.Attributes); err != nil { - return &AttrConfig{}, newError(err.Error()) +func newConfig(conf resource.Config) (*Config, error) { + slamConf, err := resource.TransformAttributeMap[*Config](conf.Attributes) + if err != nil { + return &Config{}, newError(err.Error()) } - if _, err := attrCfg.Validate("services.slam.attributes.fake"); err != nil { - return &AttrConfig{}, newError(err.Error()) + if _, err := slamConf.Validate("services.slam.attributes.fake"); err != nil { + return &Config{}, newError(err.Error()) } - return attrCfg, nil + return slamConf, nil } diff --git a/go.mod b/go.mod index 6f079608..b9ac8002 100644 --- a/go.mod +++ b/go.mod @@ -5,16 +5,16 @@ go 1.19 require ( github.com/edaniels/golinters v0.0.5-0.20220906153528-641155550742 github.com/edaniels/golog v0.0.0-20230215213219-28954395e8d0 - github.com/edaniels/gostream v0.0.0-20230321201259-9c06d1aeaae5 + github.com/edaniels/gostream v0.0.0-20230424213557-e12afcfabcd8 github.com/golang/geo v0.0.0-20210211234256-740aa86cb551 github.com/golangci/golangci-lint v1.51.2 github.com/pkg/errors v0.9.1 github.com/rhysd/actionlint v1.6.23 go.opencensus.io v0.24.0 - go.viam.com/api v0.1.111 - go.viam.com/rdk v0.2.35 + go.viam.com/api v0.1.118 + go.viam.com/rdk v0.2.36 go.viam.com/test v1.1.1-0.20220913152726-5da9916c08a2 - go.viam.com/utils v0.1.18-0.20230327140716-bfeb34d89117 + go.viam.com/utils v0.1.20-0.20230424163529-ce35a14fc60f google.golang.org/grpc v1.54.0 ) @@ -42,7 +42,7 @@ require ( github.com/ashanbrown/forbidigo v1.4.0 // indirect github.com/ashanbrown/makezero v1.1.1 // indirect github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e // indirect - github.com/benbjohnson/clock v1.3.0 // indirect + github.com/benbjohnson/clock v1.3.3 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bep/debounce v1.2.1 // indirect github.com/bkielbasa/cyclop v1.2.0 // indirect @@ -55,14 +55,14 @@ require ( github.com/butuzov/ireturn v0.1.1 // indirect github.com/campoy/embedmd v1.0.0 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect - github.com/cenkalti/backoff/v4 v4.2.0 // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/charithe/durationcheck v0.0.9 // indirect github.com/chavacava/garif v0.0.0-20221024190013-b3ef35877348 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect github.com/daixiang0/gci v0.9.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/denis-tingaikin/go-header v0.4.3 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/disintegration/imaging v1.6.2 // indirect @@ -141,7 +141,7 @@ require ( github.com/kisielk/errcheck v1.6.3 // indirect github.com/kisielk/gotool v1.0.0 // indirect github.com/kkHAIKE/contextcheck v1.1.3 // indirect - github.com/klauspost/compress v1.16.3 // indirect + github.com/klauspost/compress v1.16.5 // indirect github.com/kulti/thelper v0.6.3 // indirect github.com/kunwardeep/paralleltest v1.0.6 // indirect github.com/kylelemons/go-gypsy v1.0.0 // indirect @@ -169,7 +169,7 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mbilski/exhaustivestruct v1.2.0 // indirect github.com/mgechev/revive v1.2.5 // indirect - github.com/miekg/dns v1.1.52 // indirect + github.com/miekg/dns v1.1.53 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect @@ -192,7 +192,7 @@ require ( github.com/pion/interceptor v0.1.12 // indirect github.com/pion/logging v0.2.2 // indirect github.com/pion/mdns v0.0.7 // indirect - github.com/pion/mediadevices v0.4.1-0.20230412180714-14bfaa5dbdd3 // indirect + github.com/pion/mediadevices v0.4.1-0.20230424151458-cadb1557556f // indirect github.com/pion/randutil v0.1.0 // indirect github.com/pion/rtcp v1.2.10 // indirect github.com/pion/rtp v1.7.13 // indirect @@ -200,10 +200,10 @@ require ( github.com/pion/sdp/v3 v3.0.6 // indirect github.com/pion/srtp/v2 v2.0.12 // indirect github.com/pion/stun v0.4.0 // indirect - github.com/pion/transport/v2 v2.1.0 // indirect + github.com/pion/transport/v2 v2.2.0 // indirect github.com/pion/turn/v2 v2.1.0 // indirect github.com/pion/udp/v2 v2.0.1 // indirect - github.com/pion/webrtc/v3 v3.1.59 // indirect + github.com/pion/webrtc/v3 v3.1.61 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/polyfloyd/go-errorlint v1.1.0 // indirect github.com/prometheus/client_golang v1.12.2 // indirect @@ -216,7 +216,7 @@ require ( github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/robfig/cron v1.2.0 // indirect - github.com/rs/cors v1.8.3 // indirect + github.com/rs/cors v1.9.0 // indirect github.com/ryancurrah/gomodguard v1.3.0 // indirect github.com/ryanrolds/sqlclosecheck v0.4.0 // indirect github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect @@ -269,26 +269,26 @@ require ( go.mongodb.org/mongo-driver v1.12.0-prerelease.0.20221109213319-d3466eeae7a7 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/goleak v1.2.1 // indirect - go.uber.org/multierr v1.10.0 // indirect + go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.24.0 // indirect goji.io v2.0.2+incompatible // indirect golang.org/x/crypto v0.8.0 // indirect golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9 // indirect golang.org/x/image v0.7.0 // indirect - golang.org/x/mod v0.9.0 // indirect + golang.org/x/mod v0.10.0 // indirect golang.org/x/net v0.9.0 // indirect - golang.org/x/oauth2 v0.6.0 // indirect + golang.org/x/oauth2 v0.7.0 // indirect golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.7.0 // indirect golang.org/x/text v0.9.0 // indirect - golang.org/x/tools v0.7.0 // indirect + golang.org/x/tools v0.8.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect gonum.org/v1/gonum v0.12.0 // indirect gonum.org/v1/plot v0.12.0 // indirect google.golang.org/api v0.114.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230322174352-cde4c949918d // indirect + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/square/go-jose.v2 v2.6.0 // indirect diff --git a/go.sum b/go.sum index dbb17d37..2396d035 100644 --- a/go.sum +++ b/go.sum @@ -140,8 +140,8 @@ github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e h1:dSeuFcs4WAJJns github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e/go.mod h1:uh71c5Vc3VNIplXOFXsnDy21T1BepgT32c5X/YPrOyc= github.com/bamiaux/iobit v0.0.0-20170418073505-498159a04883 h1:XNtOMwxmV2PI/vuTHDZnFzGIFNUh8MK73q7+Kna7AXs= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/benbjohnson/clock v1.3.3 h1:g+rSsSaAzhHJYcIQE78hJ3AhyjjtQvleKDjlhdBnIhc= +github.com/benbjohnson/clock v1.3.3/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -175,8 +175,8 @@ github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= -github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -228,8 +228,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/de-bkg/gognss v0.0.0-20220601150219-24ccfdcdbb5d h1:AHDio/bKqSNW6c8d9vP0KsVsBBOdvuN5FyDHpnGY7t0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d/go.mod h1:tmAIfUFEirG/Y8jhZ9M+h36obRZAk/1fcSpXwAVlfqE= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/denis-tingaikin/go-header v0.4.3 h1:tEaZKAlqql6SKCY++utLmkPLd6K8IBM20Ha7UVm+mtU= github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= github.com/denis-tingajkin/go-header v0.4.2/go.mod h1:eLRHAVXzE5atsKAnNRDB90WHCFFnBUn4RN0nRcs1LJA= @@ -252,8 +252,8 @@ github.com/edaniels/golinters v0.0.5-0.20220906153528-641155550742/go.mod h1:i/z github.com/edaniels/golog v0.0.0-20220930140416-6e52e83a97fc/go.mod h1:Ms3gOPiAEPRrgN3kBOF8YIkT2JEXxPFk/HBx/FAkmgA= github.com/edaniels/golog v0.0.0-20230215213219-28954395e8d0 h1:nNKMo+7J87eEtmp/tdmaORLS+u6mmcmW/ZpxJCQ+Mu8= github.com/edaniels/golog v0.0.0-20230215213219-28954395e8d0/go.mod h1:+Fw6jgiaW75M1z173j7FFZB2Ug5SccFxroA/eM2YFaM= -github.com/edaniels/gostream v0.0.0-20230321201259-9c06d1aeaae5 h1:YR7TFLofgVNDVkgSB1HOxk/xt7McA6Vsjztn7CvJ17Y= -github.com/edaniels/gostream v0.0.0-20230321201259-9c06d1aeaae5/go.mod h1:9f9hi2zR9WtEfLyeQZMhn5BqMXaWca57BxEN2J2v91E= +github.com/edaniels/gostream v0.0.0-20230424213557-e12afcfabcd8 h1:5/OQZgJwJMdUv7Dr5lYCvavBea5JXvrkB4CtwgnsjtM= +github.com/edaniels/gostream v0.0.0-20230424213557-e12afcfabcd8/go.mod h1:ThHHmy2sF0nZhMuIAycCt3ftZ7mM55tWNdRLzo5ZLCw= github.com/edaniels/lidario v0.0.0-20220607182921-5879aa7b96dd h1:W6Zlh2ja8A5vljn17Ix/gZhaUbYMFKAuBjc4t9nma7U= github.com/edaniels/lidario v0.0.0-20220607182921-5879aa7b96dd/go.mod h1:CibiLtefSZOd0smxazen6pzvjNK3HrvgGojYOqC3/4Q= github.com/edaniels/zeroconf v1.0.5 h1:lGhzH3z8cR5Hvv2wmf1QJyQeyBgeJdUkjNo98Y+ysOo= @@ -698,8 +698,8 @@ github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= -github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= +github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -819,8 +819,8 @@ github.com/mgechev/revive v1.2.5/go.mod h1:nFOXent79jMTISAfOAasKfy0Z2Ejq0WX7Qn/K github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.52 h1:Bmlc/qsNNULOe6bpXcUTsuOajd0DzRHwup6D9k1An0c= -github.com/miekg/dns v1.1.52/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= +github.com/miekg/dns v1.1.53 h1:ZBkuHr5dxHtB1caEOlZTLPo7D3L3TWckgUUs/RHfDxw= +github.com/miekg/dns v1.1.53/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= github.com/miekg/pkcs11 v1.0.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -965,8 +965,8 @@ github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms= github.com/pion/mdns v0.0.7 h1:P0UB4Sr6xDWEox0kTVxF0LmQihtCbSAdW0H2nEgkA3U= github.com/pion/mdns v0.0.7/go.mod h1:4iP2UbeFhLI/vWju/bw6ZfwjJzk0z8DNValjGxR/dD8= -github.com/pion/mediadevices v0.4.1-0.20230412180714-14bfaa5dbdd3 h1:rYZWqJYJHURu6G137/W7l7I3YI1GUz1KWhY1x1jiCFk= -github.com/pion/mediadevices v0.4.1-0.20230412180714-14bfaa5dbdd3/go.mod h1:4YVTNdqnG9J/smta266YClLgwaNGjIcrhnMpyIz49ZU= +github.com/pion/mediadevices v0.4.1-0.20230424151458-cadb1557556f h1:5Lhe7IohTrzNzg95dc0QgjU14J9t6SI0vbMqpHbx4AQ= +github.com/pion/mediadevices v0.4.1-0.20230424151458-cadb1557556f/go.mod h1:iGUccKClQlqAgraxj4KJVLTtQ4XvXbqOkVq+mf5NkHQ= github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA= github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8= github.com/pion/rtcp v1.2.10 h1:nkr3uj+8Sp97zyItdN60tE/S6vk4al5CPRR6Gejsdjc= @@ -986,14 +986,15 @@ github.com/pion/transport v0.14.1 h1:XSM6olwW+o8J4SCmOBb/BpwZypkHeyM0PGFCxNQBr40 github.com/pion/transport v0.14.1/go.mod h1:4tGmbk00NeYA3rUa9+n+dzCCoKkcy3YlYb99Jn2fNnI= github.com/pion/transport/v2 v2.0.0/go.mod h1:HS2MEBJTwD+1ZI2eSXSvHJx/HnzQqRy2/LXxt6eVMHc= github.com/pion/transport/v2 v2.0.2/go.mod h1:vrz6bUbFr/cjdwbnxq8OdDDzHf7JJfGsIRkxfpZoTA0= -github.com/pion/transport/v2 v2.1.0 h1:tLBmDy/sfPu4UG9QsiKiI7Zav+i9zhUYvg7VlCUpIV8= -github.com/pion/transport/v2 v2.1.0/go.mod h1:AdSw4YBZVDkZm8fpoz+fclXyQwANWmZAlDuQdctTThQ= +github.com/pion/transport/v2 v2.2.0 h1:u5lFqFHkXLMXMzai8tixZDfVjb8eOjH35yCunhPeb1c= +github.com/pion/transport/v2 v2.2.0/go.mod h1:AdSw4YBZVDkZm8fpoz+fclXyQwANWmZAlDuQdctTThQ= github.com/pion/turn/v2 v2.1.0 h1:5wGHSgGhJhP/RpabkUb/T9PdsAjkGLS6toYz5HNzoSI= github.com/pion/turn/v2 v2.1.0/go.mod h1:yrT5XbXSGX1VFSF31A3c1kCNB5bBZgk/uu5LET162qs= github.com/pion/udp/v2 v2.0.1 h1:xP0z6WNux1zWEjhC7onRA3EwwSliXqu1ElUZAQhUP54= github.com/pion/udp/v2 v2.0.1/go.mod h1:B7uvTMP00lzWdyMr/1PVZXtV3wpPIxBRd4Wl6AksXn8= -github.com/pion/webrtc/v3 v3.1.59 h1:B3YFo8q6dwBYKA2LUjWRChP59Qtt+xvv1Ul7UPDp6Zc= github.com/pion/webrtc/v3 v3.1.59/go.mod h1:rJGgStRoFyFOWJULHLayaimsG+jIEoenhJ5MB5gIFqw= +github.com/pion/webrtc/v3 v3.1.61 h1:WG6p786t7jxXO/3miw6HmAQmO3p/n+QLRa2xLaovcr8= +github.com/pion/webrtc/v3 v3.1.61/go.mod h1:uk/4AJmgEUpSExaP7aexCyODwfbHap8hAnQzRV7zKcE= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -1083,8 +1084,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.9.0 h1:l9HGsTsHJcvW14Nk7J9KFz8bzeAWXn3CG6bgt7LsrAE= +github.com/rs/cors v1.9.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1335,8 +1336,8 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= -go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= @@ -1344,14 +1345,14 @@ go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -go.viam.com/api v0.1.111 h1:Pk9LetZUCHywahfWIRYUuAAVHXPw+vlYwKbUo0xXp18= -go.viam.com/api v0.1.111/go.mod h1:NQC9FZnerAfIPJLJ42vgzQMoe1WAQRuVoQEf1JauxtQ= -go.viam.com/rdk v0.2.35 h1:WcvwQJTOl9p0KzWNzumNh37KGJKbH+oHuB8M0TY5aHc= -go.viam.com/rdk v0.2.35/go.mod h1:/dLKGWPDwM3Z6zIdeySLyrWoPUKFRlbXebiuyvVl9Ac= +go.viam.com/api v0.1.118 h1:FjVktL++7yy7gx385pXq/40MrUQP0NL2r8PLaAcHc3Q= +go.viam.com/api v0.1.118/go.mod h1:NQC9FZnerAfIPJLJ42vgzQMoe1WAQRuVoQEf1JauxtQ= +go.viam.com/rdk v0.2.36 h1:++gse1nEM5dmomGyKCLVRV1dvJX58ic3QjnSj/3Y534= +go.viam.com/rdk v0.2.36/go.mod h1:eauX6OZh6dLkPFiE2eGjx/12cyoQc23P/fNcq7f5dEo= go.viam.com/test v1.1.1-0.20220913152726-5da9916c08a2 h1:oBiK580EnEIzgFLU4lHOXmGAE3MxnVbeR7s1wp/F3Ps= go.viam.com/test v1.1.1-0.20220913152726-5da9916c08a2/go.mod h1:XM0tej6riszsiNLT16uoyq1YjuYPWlRBweTPRDanIts= -go.viam.com/utils v0.1.18-0.20230327140716-bfeb34d89117 h1:ZNROrfA1vEfzwbZCQMBBln/mj26+yL7s9GMpENnwmEA= -go.viam.com/utils v0.1.18-0.20230327140716-bfeb34d89117/go.mod h1:ZF++46Jwl65v7qN+hhASip6hBAPBD9QAdeuxwC3rUnE= +go.viam.com/utils v0.1.20-0.20230424163529-ce35a14fc60f h1:wvJ/Au+UfSgXRj9RgoapLGYK/ZLj2pSKbq6DbPw3tqM= +go.viam.com/utils v0.1.20-0.20230424163529-ce35a14fc60f/go.mod h1:UfSj7s1njGbBbahS9uq5jWb7d6FPfY87wBoNwFtXp1M= goji.io v2.0.2+incompatible h1:uIssv/elbKRLznFUy3Xj4+2Mz/qKhek/9aZQDUMae7c= goji.io v2.0.2+incompatible/go.mod h1:sbqFwrtqZACxLBTQcdgVjFh54yGVCvwq8+w49MVMMIk= golang.org/x/crypto v0.0.0-20180501155221-613d6eafa307/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1402,7 +1403,6 @@ golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+o golang.org/x/image v0.0.0-20200927104501-e162460cd6b5/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.5.0/go.mod h1:FVC7BI/5Ym8R25iw5OLsgshdUBbT1h5jZTpA+mvAdZ4= golang.org/x/image v0.7.0 h1:gzS29xtG1J5ybQlv0PuyfE3nmc6R4qB73m6LUUmvFuw= golang.org/x/image v0.7.0/go.mod h1:nd/q4ef1AKKYl/4kft7g+6UyGbdiqWqTP1ZAbRoV7Rg= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1433,8 +1433,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1511,8 +1511,8 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= -golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1760,8 +1760,8 @@ golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y= +golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1849,8 +1849,8 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20230322174352-cde4c949918d h1:OE8TncEeAei3Tehf/P/Jdt/K+8GnTUrRY6wzYpbCes4= -google.golang.org/genproto v0.0.0-20230322174352-cde4c949918d/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= diff --git a/sensors/depth/depth.go b/sensors/depth/depth.go index c8068055..d8718590 100644 --- a/sensors/depth/depth.go +++ b/sensors/depth/depth.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" "go.viam.com/rdk/components/camera" - "go.viam.com/rdk/registry" + "go.viam.com/rdk/resource" "go.viam.com/slam/sensors/utils" ) @@ -19,7 +19,7 @@ type Depth struct { } // New creates a new Depth sensor based on the sensor definition and the service config. -func New(deps registry.Dependencies, sensors []string, sensorIndex int) (Depth, error) { +func New(deps resource.Dependencies, sensors []string, sensorIndex int) (Depth, error) { name, err := utils.GetName(sensors, sensorIndex) if err != nil { return Depth{}, err diff --git a/sensors/lidar/lidar.go b/sensors/lidar/lidar.go index b0862094..f9c679f0 100644 --- a/sensors/lidar/lidar.go +++ b/sensors/lidar/lidar.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" "go.viam.com/rdk/components/camera" "go.viam.com/rdk/pointcloud" - "go.viam.com/rdk/registry" + "go.viam.com/rdk/resource" "go.viam.com/slam/sensors/utils" ) @@ -20,7 +20,7 @@ type Lidar struct { } // New creates a new Lidar sensor based on the sensor definition and the service config. -func New(deps registry.Dependencies, sensors []string, sensorIndex int) (Lidar, error) { +func New(deps resource.Dependencies, sensors []string, sensorIndex int) (Lidar, error) { name, err := utils.GetName(sensors, sensorIndex) if err != nil { return Lidar{}, err diff --git a/sensors/rgb/rgb.go b/sensors/rgb/rgb.go index a8a01691..63d874de 100644 --- a/sensors/rgb/rgb.go +++ b/sensors/rgb/rgb.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" "go.viam.com/rdk/components/camera" - "go.viam.com/rdk/registry" + "go.viam.com/rdk/resource" "go.viam.com/rdk/rimage/transform" "go.viam.com/slam/sensors/utils" @@ -20,7 +20,7 @@ type RGB struct { } // New creates a new RGB sensor based on the sensor definition and the service config. -func New(ctx context.Context, deps registry.Dependencies, sensors []string, sensorIndex int) (RGB, error) { +func New(ctx context.Context, deps resource.Dependencies, sensors []string, sensorIndex int) (RGB, error) { name, err := utils.GetName(sensors, sensorIndex) if err != nil { return RGB{}, err diff --git a/testhelper/testhelper.go b/testhelper/testhelper.go index 96776c55..6cbec437 100644 --- a/testhelper/testhelper.go +++ b/testhelper/testhelper.go @@ -8,7 +8,6 @@ import ( "github.com/edaniels/golog" "github.com/pkg/errors" - "go.viam.com/rdk/services/slam" "go.viam.com/test" "go.viam.com/slam/config" @@ -48,42 +47,9 @@ func ResetFolder(path string) error { return os.Mkdir(path, dirInfo.Mode()) } -// CheckDeleteProcessedData compares the number of files found in a specified data -// directory with the previous number found and uses the useLiveData and -// deleteProcessedData values to evaluate this comparison. It returns the number of files -// currently in the data directory for the specified config. Future invocations should pass in this -// value. This function should be passed 0 as a default prev argument in order to get the -// number of files currently in the directory. -func CheckDeleteProcessedData(t *testing.T, slamMode slam.Mode, dir string, prev int, deleteProcessedData, useLiveData bool) int { - switch slamMode { - case slam.Mono: - numFiles, err := checkDataDirForExpectedFiles(t, dir+"/data/rgb", prev, deleteProcessedData, useLiveData) - test.That(t, err, test.ShouldBeNil) - return numFiles - case slam.Rgbd: - numFilesRGB, err := checkDataDirForExpectedFiles(t, dir+"/data/rgb", prev, deleteProcessedData, useLiveData) - test.That(t, err, test.ShouldBeNil) - - numFilesDepth, err := checkDataDirForExpectedFiles(t, dir+"/data/depth", prev, deleteProcessedData, useLiveData) - test.That(t, err, test.ShouldBeNil) - - test.That(t, numFilesRGB, test.ShouldEqual, numFilesDepth) - return numFilesRGB - case slam.Dim2d: - numFiles, err := checkDataDirForExpectedFiles(t, dir+"/data", prev, deleteProcessedData, useLiveData) - test.That(t, err, test.ShouldBeNil) - return numFiles - case slam.Dim3d: - // TODO: Delete this when implementing models: - // https://viam.atlassian.net/browse/RSDK-2015 - // https://viam.atlassian.net/browse/RSDK-2014 - return 0 - default: - return 0 - } -} - -func checkDataDirForExpectedFiles(t *testing.T, dir string, prev int, deleteProcessedData, useLiveData bool) (int, error) { +// CheckDataDirForExpectedFiles ensures that the provided data directory contains the correct amount of files +// based on the config parameters deleteProcessedData and useLiveData. +func CheckDataDirForExpectedFiles(t *testing.T, dir string, prev int, deleteProcessedData, useLiveData bool) (int, error) { files, err := os.ReadDir(dir) test.That(t, err, test.ShouldBeNil)