From a05b875ea57ef28c0aec38073e3e063c76db4b63 Mon Sep 17 00:00:00 2001 From: randhid Date: Fri, 22 Nov 2024 15:06:33 -0500 Subject: [PATCH 01/10] Resolve merge conflicts --- components/arm/arm.go | 36 +++------ components/arm/arm_test.go | 161 ------------------------------------- 2 files changed, 12 insertions(+), 185 deletions(-) diff --git a/components/arm/arm.go b/components/arm/arm.go index 67b291fbd81..e560ab8ddc2 100644 --- a/components/arm/arm.go +++ b/components/arm/arm.go @@ -10,7 +10,6 @@ import ( "context" "fmt" - v1 "go.viam.com/api/common/v1" pb "go.viam.com/api/component/arm/v1" "go.viam.com/rdk/data" @@ -24,7 +23,6 @@ import ( func init() { resource.RegisterAPI(API, resource.APIRegistration[Arm]{ - Status: resource.StatusFunc(CreateStatus), RPCServiceServerConstructor: NewRPCServiceServer, RPCServiceHandler: pb.RegisterArmServiceHandlerFromEndpoint, RPCServiceDesc: &pb.ArmService_ServiceDesc, @@ -146,30 +144,20 @@ func NamesFromRobot(r robot.Robot) []string { return robot.NamesByAPI(r, API) } -// CreateStatus creates a status from the arm. This will report calculated end effector positions even if the given -// arm is perceived to be out of bounds. -func CreateStatus(ctx context.Context, a Arm) (*pb.Status, error) { - model := a.ModelFrame() - joints, err := a.JointPositions(ctx, nil) - if err != nil { - return nil, err - } - - var endPosition *v1.Pose - if endPose, err := referenceframe.ComputeOOBPosition(model, joints); err == nil { - endPosition = spatialmath.PoseToProtobuf(endPose) - } - - var jointPositions *pb.JointPositions - if jp, err := referenceframe.JointPositionsFromInputs(model, joints); err == nil { - jointPositions = jp - } +// GoToWaypoints will visit in turn each of the joint position waypoints generated by a motion planner. +func GoToWaypoints(ctx context.Context, a Arm, waypoints [][]referenceframe.Input) error { + for _, waypoint := range waypoints { + err := ctx.Err() // make sure we haven't been cancelled + if err != nil { + return err + } - isMoving, err := a.IsMoving(ctx) - if err != nil { - return nil, err + err = a.GoToInputs(ctx, waypoint) + if err != nil { + return err + } } - return &pb.Status{EndPosition: endPosition, JointPositions: jointPositions, IsMoving: isMoving}, nil + return nil } // CheckDesiredJointPositions validates that the desired joint positions either bring the joint back diff --git a/components/arm/arm_test.go b/components/arm/arm_test.go index 2750429a99a..4843a51c5f9 100644 --- a/components/arm/arm_test.go +++ b/components/arm/arm_test.go @@ -2,7 +2,6 @@ package arm_test import ( "context" - "errors" "testing" "github.com/go-viper/mapstructure/v2" @@ -13,7 +12,6 @@ import ( "go.viam.com/rdk/components/arm" "go.viam.com/rdk/components/arm/fake" - ur "go.viam.com/rdk/components/arm/universalrobots" "go.viam.com/rdk/components/generic" "go.viam.com/rdk/logging" "go.viam.com/rdk/referenceframe" @@ -32,165 +30,6 @@ const ( var pose = spatialmath.NewPoseFromPoint(r3.Vector{X: 1, Y: 2, Z: 3}) -func TestStatusValid(t *testing.T) { - status := &pb.Status{ - EndPosition: spatialmath.PoseToProtobuf(pose), - JointPositions: &pb.JointPositions{Values: []float64{1.1, 2.2, 3.3}}, - IsMoving: true, - } - newStruct, err := protoutils.StructToStructPb(status) - test.That(t, err, test.ShouldBeNil) - test.That( - t, - newStruct.AsMap(), - test.ShouldResemble, - map[string]interface{}{ - "end_position": map[string]interface{}{"o_z": 1.0, "x": 1.0, "y": 2.0, "z": 3.0}, - "joint_positions": map[string]interface{}{"values": []interface{}{1.1, 2.2, 3.3}}, - "is_moving": true, - }, - ) - - convMap := &pb.Status{} - decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{TagName: "json", Result: &convMap}) - test.That(t, err, test.ShouldBeNil) - err = decoder.Decode(newStruct.AsMap()) - test.That(t, err, test.ShouldBeNil) - test.That(t, convMap, test.ShouldResemble, status) -} - -func TestCreateStatus(t *testing.T) { - successfulPose := spatialmath.NewPose( - r3.Vector{-802.801508917897990613710135, -248.284077946287368376943050, 9.115758604150467903082244}, - &spatialmath.R4AA{1.5810814917942602, 0.992515011486776, -0.0953988491934626, 0.07624310818669232}, - ) - successfulStatus := &pb.Status{ - EndPosition: spatialmath.PoseToProtobuf(successfulPose), - JointPositions: &pb.JointPositions{Values: []float64{1.1, 2.2, 3.3, 1.1, 2.2, 3.3}}, - IsMoving: true, - } - - injectArm := &inject.Arm{} - - //nolint:unparam - successfulJointPositionsFunc := func(context.Context, map[string]interface{}) ([]referenceframe.Input, error) { - return referenceframe.FloatsToInputs(referenceframe.JointPositionsToRadians(successfulStatus.JointPositions)), nil - } - - successfulIsMovingFunc := func(context.Context) (bool, error) { - return true, nil - } - - successfulModelFrameFunc := func() referenceframe.Model { - model, _ := ur.MakeModelFrame("ur5e") - return model - } - - t.Run("working", func(t *testing.T) { - injectArm.JointPositionsFunc = successfulJointPositionsFunc - injectArm.IsMovingFunc = successfulIsMovingFunc - injectArm.ModelFrameFunc = successfulModelFrameFunc - - expectedPose := successfulPose - expectedStatus := successfulStatus - - actualStatus, err := arm.CreateStatus(context.Background(), injectArm) - test.That(t, err, test.ShouldBeNil) - test.That(t, actualStatus.IsMoving, test.ShouldEqual, expectedStatus.IsMoving) - test.That(t, actualStatus.JointPositions, test.ShouldResemble, expectedStatus.JointPositions) - - actualPose := spatialmath.NewPoseFromProtobuf(actualStatus.EndPosition) - test.That(t, spatialmath.PoseAlmostEqualEps(actualPose, expectedPose, 0.01), test.ShouldBeTrue) - - resourceAPI, ok, err := resource.LookupAPIRegistration[arm.Arm](arm.API) - test.That(t, err, test.ShouldBeNil) - test.That(t, ok, test.ShouldBeTrue) - statusInterface, err := resourceAPI.Status(context.Background(), injectArm) - test.That(t, err, test.ShouldBeNil) - - statusMap, err := protoutils.InterfaceToMap(statusInterface) - test.That(t, err, test.ShouldBeNil) - - endPosMap, err := protoutils.InterfaceToMap(statusMap["end_position"]) - test.That(t, err, test.ShouldBeNil) - actualPose = spatialmath.NewPose( - r3.Vector{endPosMap["x"].(float64), endPosMap["y"].(float64), endPosMap["z"].(float64)}, - &spatialmath.OrientationVectorDegrees{ - endPosMap["theta"].(float64), endPosMap["o_x"].(float64), - endPosMap["o_y"].(float64), endPosMap["o_z"].(float64), - }, - ) - test.That(t, spatialmath.PoseAlmostEqualEps(actualPose, expectedPose, 0.01), test.ShouldBeTrue) - - moving := statusMap["is_moving"].(bool) - test.That(t, moving, test.ShouldEqual, expectedStatus.IsMoving) - - jPosFace := statusMap["joint_positions"].(map[string]interface{})["values"].([]interface{}) - actualJointPositions := []float64{ - jPosFace[0].(float64), jPosFace[1].(float64), jPosFace[2].(float64), - jPosFace[3].(float64), jPosFace[4].(float64), jPosFace[5].(float64), - } - test.That(t, actualJointPositions, test.ShouldResemble, expectedStatus.JointPositions.Values) - }) - - t.Run("not moving", func(t *testing.T) { - injectArm.JointPositionsFunc = successfulJointPositionsFunc - injectArm.ModelFrameFunc = successfulModelFrameFunc - - injectArm.IsMovingFunc = func(context.Context) (bool, error) { - return false, nil - } - - expectedPose := successfulPose - expectedStatus := &pb.Status{ - EndPosition: successfulStatus.EndPosition, //nolint:govet - JointPositions: successfulStatus.JointPositions, - IsMoving: false, - } - - actualStatus, err := arm.CreateStatus(context.Background(), injectArm) - test.That(t, err, test.ShouldBeNil) - test.That(t, actualStatus.IsMoving, test.ShouldEqual, expectedStatus.IsMoving) - test.That(t, actualStatus.JointPositions, test.ShouldResemble, expectedStatus.JointPositions) - actualPose := spatialmath.NewPoseFromProtobuf(actualStatus.EndPosition) - test.That(t, spatialmath.PoseAlmostEqualEps(actualPose, expectedPose, 0.01), test.ShouldBeTrue) - }) - - t.Run("fail on JointPositions", func(t *testing.T) { - injectArm.IsMovingFunc = successfulIsMovingFunc - injectArm.ModelFrameFunc = successfulModelFrameFunc - - errFail := errors.New("can't get joint positions") - injectArm.JointPositionsFunc = func(ctx context.Context, extra map[string]interface{}) ([]referenceframe.Input, error) { - return nil, errFail - } - - actualStatus, err := arm.CreateStatus(context.Background(), injectArm) - test.That(t, err, test.ShouldBeError, errFail) - test.That(t, actualStatus, test.ShouldBeNil) - }) - - t.Run("nil model frame", func(t *testing.T) { - injectArm.IsMovingFunc = successfulIsMovingFunc - injectArm.JointPositionsFunc = successfulJointPositionsFunc - injectArm.ModelFrameFunc = func() referenceframe.Model { - return nil - } - - expectedStatus := &pb.Status{ - EndPosition: nil, - JointPositions: successfulStatus.JointPositions, - IsMoving: successfulStatus.IsMoving, - } - - actualStatus, err := arm.CreateStatus(context.Background(), injectArm) - test.That(t, err, test.ShouldBeNil) - test.That(t, actualStatus.EndPosition, test.ShouldEqual, expectedStatus.EndPosition) - test.That(t, actualStatus.JointPositions, test.ShouldResemble, expectedStatus.JointPositions) - test.That(t, actualStatus.IsMoving, test.ShouldEqual, expectedStatus.IsMoving) - }) -} - func TestXArm6Locations(t *testing.T) { // check the exact values/locations of arm geometries at a couple different poses logger := logging.NewTestLogger(t) From 2765f35d61fc33f81d6a52df648c39c3910bf145 Mon Sep 17 00:00:00 2001 From: randhid Date: Thu, 17 Oct 2024 21:49:09 -0400 Subject: [PATCH 02/10] remove base status --- components/base/base.go | 11 ------- components/base/base_test.go | 64 ------------------------------------ 2 files changed, 75 deletions(-) diff --git a/components/base/base.go b/components/base/base.go index 12037e81806..571a29bc846 100644 --- a/components/base/base.go +++ b/components/base/base.go @@ -8,7 +8,6 @@ import ( "context" "github.com/golang/geo/r3" - commonpb "go.viam.com/api/common/v1" pb "go.viam.com/api/component/base/v1" "go.viam.com/rdk/resource" @@ -17,7 +16,6 @@ import ( func init() { resource.RegisterAPI(API, resource.APIRegistration[Base]{ - Status: resource.StatusFunc(CreateStatus), RPCServiceServerConstructor: NewRPCServiceServer, RPCServiceHandler: pb.RegisterBaseServiceHandlerFromEndpoint, RPCServiceDesc: &pb.BaseService_ServiceDesc, @@ -144,12 +142,3 @@ func FromRobot(r robot.Robot, name string) (Base, error) { func NamesFromRobot(r robot.Robot) []string { return robot.NamesByAPI(r, API) } - -// CreateStatus creates a status from the base. -func CreateStatus(ctx context.Context, b Base) (*commonpb.ActuatorStatus, error) { - isMoving, err := b.IsMoving(ctx) - if err != nil { - return nil, err - } - return &commonpb.ActuatorStatus{IsMoving: isMoving}, nil -} diff --git a/components/base/base_test.go b/components/base/base_test.go index 04269f4665a..b5c4b6e1923 100644 --- a/components/base/base_test.go +++ b/components/base/base_test.go @@ -1,13 +1,9 @@ package base_test import ( - "context" "testing" - "github.com/go-viper/mapstructure/v2" - commonpb "go.viam.com/api/common/v1" "go.viam.com/test" - "go.viam.com/utils/protoutils" "go.viam.com/rdk/components/base" "go.viam.com/rdk/components/generic" @@ -21,66 +17,6 @@ const ( failBaseName = "base2" ) -func TestStatusValid(t *testing.T) { - status := &commonpb.ActuatorStatus{ - IsMoving: true, - } - newStruct, err := protoutils.StructToStructPb(status) - test.That(t, err, test.ShouldBeNil) - test.That( - t, - newStruct.AsMap(), - test.ShouldResemble, - map[string]interface{}{ - "is_moving": true, - }, - ) - - convMap := &commonpb.ActuatorStatus{} - decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{TagName: "json", Result: &convMap}) - test.That(t, err, test.ShouldBeNil) - err = decoder.Decode(newStruct.AsMap()) - test.That(t, err, test.ShouldBeNil) - test.That(t, convMap, test.ShouldResemble, status) -} - -func TestCreateStatus(t *testing.T) { - t.Run("is moving", func(t *testing.T) { - status := &commonpb.ActuatorStatus{ - IsMoving: true, - } - - injectBase := &inject.Base{} - injectBase.IsMovingFunc = func(context.Context) (bool, error) { - return true, nil - } - status1, err := base.CreateStatus(context.Background(), injectBase) - test.That(t, err, test.ShouldBeNil) - test.That(t, status1, test.ShouldResemble, status) - - resourceAPI, ok, err := resource.LookupAPIRegistration[base.Base](base.API) - test.That(t, err, test.ShouldBeNil) - test.That(t, ok, test.ShouldBeTrue) - status2, err := resourceAPI.Status(context.Background(), injectBase) - test.That(t, err, test.ShouldBeNil) - test.That(t, status2, test.ShouldResemble, status) - }) - - t.Run("is not moving", func(t *testing.T) { - status := &commonpb.ActuatorStatus{ - IsMoving: false, - } - - injectBase := &inject.Base{} - injectBase.IsMovingFunc = func(context.Context) (bool, error) { - return false, nil - } - status1, err := base.CreateStatus(context.Background(), injectBase) - test.That(t, err, test.ShouldBeNil) - test.That(t, status1, test.ShouldResemble, status) - }) -} - func TestFromRobot(t *testing.T) { r := &inject.Robot{} rs := map[resource.Name]resource.Resource{ From 0f6d896f15f8645056cd0da06cf55587e01f2dea Mon Sep 17 00:00:00 2001 From: randhid Date: Thu, 17 Oct 2024 21:49:22 -0400 Subject: [PATCH 03/10] remove board status --- components/board/board.go | 1 - components/board/status.go | 47 -------------------------------------- 2 files changed, 48 deletions(-) delete mode 100644 components/board/status.go diff --git a/components/board/board.go b/components/board/board.go index be6a8cffad9..5af18ecf95e 100644 --- a/components/board/board.go +++ b/components/board/board.go @@ -20,7 +20,6 @@ import ( func init() { resource.RegisterAPI(API, resource.APIRegistration[Board]{ - Status: resource.StatusFunc(CreateStatus), RPCServiceServerConstructor: NewRPCServiceServer, RPCServiceHandler: pb.RegisterBoardServiceHandlerFromEndpoint, RPCServiceDesc: &pb.BoardService_ServiceDesc, diff --git a/components/board/status.go b/components/board/status.go deleted file mode 100644 index 2d0d67a5c42..00000000000 --- a/components/board/status.go +++ /dev/null @@ -1,47 +0,0 @@ -package board - -import ( - "context" - - "github.com/pkg/errors" - pb "go.viam.com/api/component/board/v1" -) - -// CreateStatus constructs a new up to date status from the given board. -// The operation can take time and be expensive, so it can be cancelled by the -// given context. -func CreateStatus(ctx context.Context, b Board) (*pb.Status, error) { - var status pb.Status - - if names := b.AnalogNames(); len(names) != 0 { - status.Analogs = make(map[string]int32, len(names)) - for _, name := range names { - x, err := b.AnalogByName(name) - if err != nil { - return nil, err - } - val, err := x.Read(ctx, nil) - if err != nil { - return nil, errors.Wrapf(err, "couldn't read analog (%s)", name) - } - status.Analogs[name] = int32(val.Value) - } - } - - if names := b.DigitalInterruptNames(); len(names) != 0 { - status.DigitalInterrupts = make(map[string]int64, len(names)) - for _, name := range names { - x, err := b.DigitalInterruptByName(name) - if err != nil { - return nil, err - } - intVal, err := x.Value(ctx, nil) - if err != nil { - return nil, err - } - status.DigitalInterrupts[name] = intVal - } - } - - return &status, nil -} From d7426087053c0275ee9cad0ad978d3d16a45b620 Mon Sep 17 00:00:00 2001 From: randhid Date: Thu, 17 Oct 2024 21:49:34 -0400 Subject: [PATCH 04/10] remove gantry status --- components/gantry/gantry.go | 19 ----- components/gantry/gantry_test.go | 115 ------------------------------- components/gantry/server_test.go | 7 ++ 3 files changed, 7 insertions(+), 134 deletions(-) delete mode 100644 components/gantry/gantry_test.go diff --git a/components/gantry/gantry.go b/components/gantry/gantry.go index df23197386d..e3af187f363 100644 --- a/components/gantry/gantry.go +++ b/components/gantry/gantry.go @@ -18,7 +18,6 @@ import ( func init() { resource.RegisterAPI(API, resource.APIRegistration[Gantry]{ - Status: resource.StatusFunc(CreateStatus), RPCServiceServerConstructor: NewRPCServiceServer, RPCServiceHandler: pb.RegisterGantryServiceHandlerFromEndpoint, RPCServiceDesc: &pb.GantryService_ServiceDesc, @@ -117,21 +116,3 @@ func FromRobot(r robot.Robot, name string) (Gantry, error) { func NamesFromRobot(r robot.Robot) []string { return robot.NamesByAPI(r, API) } - -// CreateStatus creates a status from the gantry. -func CreateStatus(ctx context.Context, g Gantry) (*pb.Status, error) { - positions, err := g.Position(ctx, nil) - if err != nil { - return nil, err - } - - lengths, err := g.Lengths(ctx, nil) - if err != nil { - return nil, err - } - isMoving, err := g.IsMoving(ctx) - if err != nil { - return nil, err - } - return &pb.Status{PositionsMm: positions, LengthsMm: lengths, IsMoving: isMoving}, nil -} diff --git a/components/gantry/gantry_test.go b/components/gantry/gantry_test.go deleted file mode 100644 index 57b7382255b..00000000000 --- a/components/gantry/gantry_test.go +++ /dev/null @@ -1,115 +0,0 @@ -package gantry_test - -import ( - "context" - "testing" - - "github.com/go-viper/mapstructure/v2" - "github.com/pkg/errors" - pb "go.viam.com/api/component/gantry/v1" - "go.viam.com/test" - "go.viam.com/utils/protoutils" - - "go.viam.com/rdk/components/gantry" - "go.viam.com/rdk/resource" - "go.viam.com/rdk/testutils/inject" -) - -const ( - testGantryName = "gantry1" - testGantryName2 = "gantry2" - failGantryName = "gantry3" - missingGantryName = "gantry4" -) - -func TestStatusValid(t *testing.T) { - status := &pb.Status{ - PositionsMm: []float64{1.1, 2.2, 3.3}, - LengthsMm: []float64{4.4, 5.5, 6.6}, - IsMoving: true, - } - newStruct, err := protoutils.StructToStructPb(status) - test.That(t, err, test.ShouldBeNil) - test.That( - t, - newStruct.AsMap(), - test.ShouldResemble, - map[string]interface{}{ - "lengths_mm": []interface{}{4.4, 5.5, 6.6}, - "positions_mm": []interface{}{1.1, 2.2, 3.3}, - "is_moving": true, - }, - ) - - convMap := &pb.Status{} - decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{TagName: "json", Result: &convMap}) - test.That(t, err, test.ShouldBeNil) - err = decoder.Decode(newStruct.AsMap()) - test.That(t, err, test.ShouldBeNil) - test.That(t, convMap, test.ShouldResemble, status) -} - -func TestCreateStatus(t *testing.T) { - status := &pb.Status{ - PositionsMm: []float64{1.1, 2.2, 3.3}, - LengthsMm: []float64{4.4, 5.5, 6.6}, - IsMoving: true, - } - - injectGantry := &inject.Gantry{} - injectGantry.PositionFunc = func(ctx context.Context, extra map[string]interface{}) ([]float64, error) { - return status.PositionsMm, nil - } - injectGantry.LengthsFunc = func(ctx context.Context, extra map[string]interface{}) ([]float64, error) { - return status.LengthsMm, nil - } - injectGantry.IsMovingFunc = func(context.Context) (bool, error) { - return true, nil - } - - t.Run("working", func(t *testing.T) { - status1, err := gantry.CreateStatus(context.Background(), injectGantry) - test.That(t, err, test.ShouldBeNil) - test.That(t, status1, test.ShouldResemble, status) - - resourceAPI, ok, err := resource.LookupAPIRegistration[gantry.Gantry](gantry.API) - test.That(t, err, test.ShouldBeNil) - test.That(t, ok, test.ShouldBeTrue) - status2, err := resourceAPI.Status(context.Background(), injectGantry) - test.That(t, err, test.ShouldBeNil) - test.That(t, status2, test.ShouldResemble, status) - }) - - t.Run("not moving", func(t *testing.T) { - injectGantry.IsMovingFunc = func(context.Context) (bool, error) { - return false, nil - } - - status2 := &pb.Status{ - PositionsMm: []float64{1.1, 2.2, 3.3}, - LengthsMm: []float64{4.4, 5.5, 6.6}, - IsMoving: false, - } - status1, err := gantry.CreateStatus(context.Background(), injectGantry) - test.That(t, err, test.ShouldBeNil) - test.That(t, status1, test.ShouldResemble, status2) - }) - - t.Run("fail on Lengths", func(t *testing.T) { - errFail := errors.New("can't get lengths") - injectGantry.LengthsFunc = func(ctx context.Context, extra map[string]interface{}) ([]float64, error) { - return nil, errFail - } - _, err := gantry.CreateStatus(context.Background(), injectGantry) - test.That(t, err, test.ShouldBeError, errFail) - }) - - t.Run("fail on Positions", func(t *testing.T) { - errFail := errors.New("can't get positions") - injectGantry.PositionFunc = func(ctx context.Context, extra map[string]interface{}) ([]float64, error) { - return nil, errFail - } - _, err := gantry.CreateStatus(context.Background(), injectGantry) - test.That(t, err, test.ShouldBeError, errFail) - }) -} diff --git a/components/gantry/server_test.go b/components/gantry/server_test.go index 9f473a59876..c769ff2958c 100644 --- a/components/gantry/server_test.go +++ b/components/gantry/server_test.go @@ -14,6 +14,13 @@ import ( "go.viam.com/rdk/testutils/inject" ) +const ( + testGantryName = "gantry1" + testGantryName2 = "gantry2" + failGantryName = "gantry3" + missingGantryName = "gantry4" +) + var ( errPositionFailed = errors.New("couldn't get position") errHomingFailed = errors.New("homing unsuccessful") From c0ad0adf687b243a594b240ad78a79ac11fcaaaa Mon Sep 17 00:00:00 2001 From: randhid Date: Thu, 17 Oct 2024 21:49:45 -0400 Subject: [PATCH 05/10] remove gripper status --- components/gripper/gripper.go | 11 --------- components/gripper/gripper_test.go | 39 ------------------------------ 2 files changed, 50 deletions(-) diff --git a/components/gripper/gripper.go b/components/gripper/gripper.go index bb16872ad8d..f938de73cad 100644 --- a/components/gripper/gripper.go +++ b/components/gripper/gripper.go @@ -7,7 +7,6 @@ package gripper import ( "context" - commonpb "go.viam.com/api/common/v1" pb "go.viam.com/api/component/gripper/v1" "go.viam.com/rdk/referenceframe" @@ -17,7 +16,6 @@ import ( func init() { resource.RegisterAPI(API, resource.APIRegistration[Gripper]{ - Status: resource.StatusFunc(CreateStatus), RPCServiceServerConstructor: NewRPCServiceServer, RPCServiceHandler: pb.RegisterGripperServiceHandlerFromEndpoint, RPCServiceDesc: &pb.GripperService_ServiceDesc, @@ -79,12 +77,3 @@ func FromRobot(r robot.Robot, name string) (Gripper, error) { func NamesFromRobot(r robot.Robot) []string { return robot.NamesByAPI(r, API) } - -// CreateStatus creates a status from the gripper. -func CreateStatus(ctx context.Context, g Gripper) (*commonpb.ActuatorStatus, error) { - isMoving, err := g.IsMoving(ctx) - if err != nil { - return nil, err - } - return &commonpb.ActuatorStatus{IsMoving: isMoving}, nil -} diff --git a/components/gripper/gripper_test.go b/components/gripper/gripper_test.go index b65e69073ba..e4dceb48ee1 100644 --- a/components/gripper/gripper_test.go +++ b/components/gripper/gripper_test.go @@ -5,7 +5,6 @@ import ( "testing" "github.com/golang/geo/r3" - commonpb "go.viam.com/api/common/v1" "go.viam.com/test" "go.viam.com/rdk/components/gripper" @@ -13,7 +12,6 @@ import ( "go.viam.com/rdk/referenceframe" "go.viam.com/rdk/resource" "go.viam.com/rdk/spatialmath" - "go.viam.com/rdk/testutils/inject" ) const ( @@ -23,43 +21,6 @@ const ( missingGripperName = "gripper4" ) -func TestCreateStatus(t *testing.T) { - t.Run("is moving", func(t *testing.T) { - status := &commonpb.ActuatorStatus{ - IsMoving: true, - } - - injectGripper := &inject.Gripper{} - injectGripper.IsMovingFunc = func(context.Context) (bool, error) { - return true, nil - } - status1, err := gripper.CreateStatus(context.Background(), injectGripper) - test.That(t, err, test.ShouldBeNil) - test.That(t, status1, test.ShouldResemble, status) - - resourceAPI, ok, err := resource.LookupAPIRegistration[gripper.Gripper](gripper.API) - test.That(t, err, test.ShouldBeNil) - test.That(t, ok, test.ShouldBeTrue) - status2, err := resourceAPI.Status(context.Background(), injectGripper) - test.That(t, err, test.ShouldBeNil) - test.That(t, status2, test.ShouldResemble, status) - }) - - t.Run("is not moving", func(t *testing.T) { - status := &commonpb.ActuatorStatus{ - IsMoving: false, - } - - injectGripper := &inject.Gripper{} - injectGripper.IsMovingFunc = func(context.Context) (bool, error) { - return false, nil - } - status1, err := gripper.CreateStatus(context.Background(), injectGripper) - test.That(t, err, test.ShouldBeNil) - test.That(t, status1, test.ShouldResemble, status) - }) -} - func TestGetGeometries(t *testing.T) { cfg := resource.Config{ Name: "fakeGripper", From ffb5f5a9130ccb33bfd2468e13451b2c85796322 Mon Sep 17 00:00:00 2001 From: randhid Date: Thu, 17 Oct 2024 21:50:02 -0400 Subject: [PATCH 06/10] remove input status --- components/input/input.go | 21 ------------- components/input/input_test.go | 52 --------------------------------- components/input/server_test.go | 6 ++++ 3 files changed, 6 insertions(+), 73 deletions(-) delete mode 100644 components/input/input_test.go diff --git a/components/input/input.go b/components/input/input.go index 2ef9c1d1dbb..7069edf696b 100644 --- a/components/input/input.go +++ b/components/input/input.go @@ -9,7 +9,6 @@ import ( "time" pb "go.viam.com/api/component/inputcontroller/v1" - "google.golang.org/protobuf/types/known/timestamppb" "go.viam.com/rdk/resource" "go.viam.com/rdk/robot" @@ -17,7 +16,6 @@ import ( func init() { resource.RegisterAPI(API, resource.APIRegistration[Controller]{ - Status: resource.StatusFunc(CreateStatus), RPCServiceServerConstructor: NewRPCServiceServer, RPCServiceHandler: pb.RegisterInputControllerServiceHandlerFromEndpoint, RPCServiceDesc: &pb.InputControllerService_ServiceDesc, @@ -194,22 +192,3 @@ func FromRobot(r robot.Robot, name string) (Controller, error) { func NamesFromRobot(r robot.Robot) []string { return robot.NamesByAPI(r, API) } - -// CreateStatus creates a status from the input controller. -func CreateStatus(ctx context.Context, c Controller) (*pb.Status, error) { - eventsIn, err := c.Events(ctx, map[string]interface{}{}) - if err != nil { - return nil, err - } - events := make([]*pb.Event, 0, len(eventsIn)) - for _, eventIn := range eventsIn { - events = append(events, &pb.Event{ - Time: timestamppb.New(eventIn.Time), - Event: string(eventIn.Event), - Control: string(eventIn.Control), - Value: eventIn.Value, - }) - } - - return &pb.Status{Events: events}, nil -} diff --git a/components/input/input_test.go b/components/input/input_test.go deleted file mode 100644 index 2ee493461df..00000000000 --- a/components/input/input_test.go +++ /dev/null @@ -1,52 +0,0 @@ -package input_test - -import ( - "context" - "testing" - "time" - - "github.com/pkg/errors" - pb "go.viam.com/api/component/inputcontroller/v1" - "go.viam.com/test" - "google.golang.org/protobuf/types/known/timestamppb" - - "go.viam.com/rdk/components/input" - "go.viam.com/rdk/testutils/inject" -) - -const ( - testInputControllerName = "inputController1" - failInputControllerName = "inputController2" - missingInputControllerName = "inputController3" -) - -func TestCreateStatus(t *testing.T) { - timestamp := time.Now() - event := input.Event{Time: timestamp, Event: input.PositionChangeAbs, Control: input.AbsoluteX, Value: 0.7} - status := &pb.Status{ - Events: []*pb.Event{ - {Time: timestamppb.New(timestamp), Event: string(event.Event), Control: string(event.Control), Value: event.Value}, - }, - } - injectInputController := &inject.InputController{} - injectInputController.EventsFunc = func(ctx context.Context, extra map[string]interface{}) (map[input.Control]input.Event, error) { - eventsOut := make(map[input.Control]input.Event) - eventsOut[input.AbsoluteX] = event - return eventsOut, nil - } - - t.Run("working", func(t *testing.T) { - status1, err := input.CreateStatus(context.Background(), injectInputController) - test.That(t, err, test.ShouldBeNil) - test.That(t, status1, test.ShouldResemble, status) - }) - - t.Run("fail on Events", func(t *testing.T) { - errFail := errors.New("can't get events") - injectInputController.EventsFunc = func(ctx context.Context, extra map[string]interface{}) (map[input.Control]input.Event, error) { - return nil, errFail - } - _, err := input.CreateStatus(context.Background(), injectInputController) - test.That(t, err, test.ShouldBeError, errFail) - }) -} diff --git a/components/input/server_test.go b/components/input/server_test.go index f2955c7af5b..daad15d5afc 100644 --- a/components/input/server_test.go +++ b/components/input/server_test.go @@ -17,6 +17,12 @@ import ( "go.viam.com/rdk/testutils/inject" ) +const ( + testInputControllerName = "inputController1" + failInputControllerName = "inputController2" + missingInputControllerName = "inputController3" +) + var ( errControlsFailed = errors.New("can't get controls") errEventsFailed = errors.New("can't get last events") From 05aa4ceddaee5a4168df1c850cc78847f308d547 Mon Sep 17 00:00:00 2001 From: randhid Date: Thu, 17 Oct 2024 21:50:12 -0400 Subject: [PATCH 07/10] remove motor status --- components/motor/motor.go | 29 --------- components/motor/motor_test.go | 115 --------------------------------- 2 files changed, 144 deletions(-) diff --git a/components/motor/motor.go b/components/motor/motor.go index bf93be4a77a..5677ee63c28 100644 --- a/components/motor/motor.go +++ b/components/motor/motor.go @@ -18,7 +18,6 @@ import ( func init() { resource.RegisterAPI(API, resource.APIRegistration[Motor]{ - Status: resource.StatusFunc(CreateStatus), RPCServiceServerConstructor: NewRPCServiceServer, RPCServiceHandler: pb.RegisterMotorServiceHandlerFromEndpoint, RPCServiceDesc: &pb.MotorService_ServiceDesc, @@ -160,34 +159,6 @@ func NamesFromRobot(r robot.Robot) []string { return robot.NamesByAPI(r, API) } -// CreateStatus creates a status from the motor. -func CreateStatus(ctx context.Context, m Motor) (*pb.Status, error) { - isPowered, _, err := m.IsPowered(ctx, nil) - if err != nil { - return nil, err - } - properties, err := m.Properties(ctx, nil) - if err != nil { - return nil, err - } - var position float64 - if properties.PositionReporting { - position, err = m.Position(ctx, nil) - if err != nil { - return nil, err - } - } - isMoving, err := m.IsMoving(ctx) - if err != nil { - return nil, err - } - return &pb.Status{ - IsPowered: isPowered, - Position: position, - IsMoving: isMoving, - }, nil -} - // CheckSpeed checks if the input rpm is too slow or fast and returns a warning and/or error. func CheckSpeed(rpm, max float64) (string, error) { switch speed := math.Abs(rpm); { diff --git a/components/motor/motor_test.go b/components/motor/motor_test.go index 41c4fafbbdf..be78b2756de 100644 --- a/components/motor/motor_test.go +++ b/components/motor/motor_test.go @@ -1,14 +1,9 @@ package motor_test import ( - "context" "testing" - "github.com/go-viper/mapstructure/v2" - "github.com/pkg/errors" - pb "go.viam.com/api/component/motor/v1" "go.viam.com/test" - "go.viam.com/utils/protoutils" "go.viam.com/rdk/components/generic" "go.viam.com/rdk/components/motor" @@ -23,116 +18,6 @@ const ( fakeMotorName = "motor3" ) -func TestStatusValid(t *testing.T) { - status := &pb.Status{IsPowered: true, Position: 7.7, IsMoving: true} - newStruct, err := protoutils.StructToStructPb(status) - test.That(t, err, test.ShouldBeNil) - test.That( - t, - newStruct.AsMap(), - test.ShouldResemble, - map[string]interface{}{"is_powered": true, "position": 7.7, "is_moving": true}, - ) - - convMap := &pb.Status{} - decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{TagName: "json", Result: &convMap}) - test.That(t, err, test.ShouldBeNil) - err = decoder.Decode(newStruct.AsMap()) - test.That(t, err, test.ShouldBeNil) - test.That(t, convMap, test.ShouldResemble, status) - - status = &pb.Status{Position: 7.7} - newStruct, err = protoutils.StructToStructPb(status) - test.That(t, err, test.ShouldBeNil) - test.That(t, newStruct.AsMap(), test.ShouldResemble, map[string]interface{}{"position": 7.7}) - - convMap = &pb.Status{} - decoder, err = mapstructure.NewDecoder(&mapstructure.DecoderConfig{TagName: "json", Result: &convMap}) - test.That(t, err, test.ShouldBeNil) - err = decoder.Decode(newStruct.AsMap()) - test.That(t, err, test.ShouldBeNil) - test.That(t, convMap, test.ShouldResemble, status) -} - -func TestCreateStatus(t *testing.T) { - status := &pb.Status{IsPowered: true, Position: 7.7, IsMoving: true} - - injectMotor := &inject.Motor{} - injectMotor.IsPoweredFunc = func(ctx context.Context, extra map[string]interface{}) (bool, float64, error) { - return status.IsPowered, 1.0, nil - } - injectMotor.PropertiesFunc = func(ctx context.Context, extra map[string]interface{}) (motor.Properties, error) { - return motor.Properties{PositionReporting: true}, nil - } - injectMotor.PositionFunc = func(ctx context.Context, extra map[string]interface{}) (float64, error) { - return status.Position, nil - } - injectMotor.IsMovingFunc = func(context.Context) (bool, error) { - return true, nil - } - - t.Run("working", func(t *testing.T) { - status1, err := motor.CreateStatus(context.Background(), injectMotor) - test.That(t, err, test.ShouldBeNil) - test.That(t, status1, test.ShouldResemble, status) - - resourceAPI, ok, err := resource.LookupAPIRegistration[motor.Motor](motor.API) - test.That(t, err, test.ShouldBeNil) - test.That(t, ok, test.ShouldBeTrue) - status2, err := resourceAPI.Status(context.Background(), injectMotor) - test.That(t, err, test.ShouldBeNil) - test.That(t, status2, test.ShouldResemble, status) - }) - - t.Run("not moving", func(t *testing.T) { - injectMotor.IsMovingFunc = func(context.Context) (bool, error) { - return false, nil - } - - status2 := &pb.Status{IsPowered: true, Position: 7.7, IsMoving: false} - status1, err := motor.CreateStatus(context.Background(), injectMotor) - test.That(t, err, test.ShouldBeNil) - test.That(t, status1, test.ShouldResemble, status2) - }) - - t.Run("fail on Position", func(t *testing.T) { - errFail := errors.New("can't get position") - injectMotor.PositionFunc = func(ctx context.Context, extra map[string]interface{}) (float64, error) { - return 0, errFail - } - _, err := motor.CreateStatus(context.Background(), injectMotor) - test.That(t, err, test.ShouldBeError, errFail) - }) - - t.Run("position not supported", func(t *testing.T) { - injectMotor.PropertiesFunc = func(ctx context.Context, extra map[string]interface{}) (motor.Properties, error) { - return motor.Properties{PositionReporting: false}, nil - } - - status1, err := motor.CreateStatus(context.Background(), injectMotor) - test.That(t, err, test.ShouldBeNil) - test.That(t, status1, test.ShouldResemble, &pb.Status{IsPowered: true}) - }) - - t.Run("fail on Properties", func(t *testing.T) { - errFail := errors.New("can't get properties") - injectMotor.PropertiesFunc = func(ctx context.Context, extra map[string]interface{}) (motor.Properties, error) { - return motor.Properties{}, errFail - } - _, err := motor.CreateStatus(context.Background(), injectMotor) - test.That(t, err, test.ShouldBeError, errFail) - }) - - t.Run("fail on IsPowered", func(t *testing.T) { - errFail := errors.New("can't get is powered") - injectMotor.IsPoweredFunc = func(ctx context.Context, extra map[string]interface{}) (bool, float64, error) { - return false, 0.0, errFail - } - _, err := motor.CreateStatus(context.Background(), injectMotor) - test.That(t, err, test.ShouldBeError, errFail) - }) -} - func TestFromRobot(t *testing.T) { r := &inject.Robot{} rs := map[resource.Name]resource.Resource{ From 83050a52f535aac8d993b3af24fcd2f82d38185e Mon Sep 17 00:00:00 2001 From: randhid Date: Thu, 17 Oct 2024 21:50:25 -0400 Subject: [PATCH 08/10] remove servo status --- components/servo/servo.go | 14 -------- components/servo/servo_test.go | 59 ---------------------------------- 2 files changed, 73 deletions(-) delete mode 100644 components/servo/servo_test.go diff --git a/components/servo/servo.go b/components/servo/servo.go index 392dc61fe28..eece69d8f2a 100644 --- a/components/servo/servo.go +++ b/components/servo/servo.go @@ -16,7 +16,6 @@ import ( func init() { resource.RegisterAPI(API, resource.APIRegistration[Servo]{ - Status: resource.StatusFunc(CreateStatus), RPCServiceServerConstructor: NewRPCServiceServer, RPCServiceHandler: pb.RegisterServoServiceHandlerFromEndpoint, RPCServiceDesc: &pb.ServoService_ServiceDesc, @@ -83,16 +82,3 @@ func FromRobot(r robot.Robot, name string) (Servo, error) { func NamesFromRobot(r robot.Robot) []string { return robot.NamesByAPI(r, API) } - -// CreateStatus creates a status from the servo. -func CreateStatus(ctx context.Context, s Servo) (*pb.Status, error) { - position, err := s.Position(ctx, nil) - if err != nil { - return nil, err - } - isMoving, err := s.IsMoving(ctx) - if err != nil { - return nil, err - } - return &pb.Status{PositionDeg: position, IsMoving: isMoving}, nil -} diff --git a/components/servo/servo_test.go b/components/servo/servo_test.go deleted file mode 100644 index 7bbfeeb70f1..00000000000 --- a/components/servo/servo_test.go +++ /dev/null @@ -1,59 +0,0 @@ -package servo_test - -import ( - "context" - "testing" - - "github.com/pkg/errors" - pb "go.viam.com/api/component/servo/v1" - "go.viam.com/test" - - "go.viam.com/rdk/components/servo" - "go.viam.com/rdk/resource" - "go.viam.com/rdk/testutils/inject" -) - -func TestCreateStatus(t *testing.T) { - status := &pb.Status{PositionDeg: uint32(8), IsMoving: true} - - injectServo := &inject.Servo{} - injectServo.PositionFunc = func(ctx context.Context, extra map[string]interface{}) (uint32, error) { - return status.PositionDeg, nil - } - injectServo.IsMovingFunc = func(context.Context) (bool, error) { - return true, nil - } - - t.Run("working", func(t *testing.T) { - status1, err := servo.CreateStatus(context.Background(), injectServo) - test.That(t, err, test.ShouldBeNil) - test.That(t, status1, test.ShouldResemble, status) - - resourceAPI, ok, err := resource.LookupAPIRegistration[servo.Servo](servo.API) - test.That(t, err, test.ShouldBeNil) - test.That(t, ok, test.ShouldBeTrue) - status2, err := resourceAPI.Status(context.Background(), injectServo) - test.That(t, err, test.ShouldBeNil) - test.That(t, status2, test.ShouldResemble, status) - }) - - t.Run("not moving", func(t *testing.T) { - injectServo.IsMovingFunc = func(context.Context) (bool, error) { - return false, nil - } - - status2 := &pb.Status{PositionDeg: uint32(8), IsMoving: false} - status1, err := servo.CreateStatus(context.Background(), injectServo) - test.That(t, err, test.ShouldBeNil) - test.That(t, status1, test.ShouldResemble, status2) - }) - - t.Run("fail on Position", func(t *testing.T) { - errFail := errors.New("can't get position") - injectServo.PositionFunc = func(ctx context.Context, extra map[string]interface{}) (uint32, error) { - return 0, errFail - } - _, err := servo.CreateStatus(context.Background(), injectServo) - test.That(t, err, test.ShouldBeError, errFail) - }) -} From 34ee30f24b85a0fe4aef0142cc8c17153d6346ed Mon Sep 17 00:00:00 2001 From: randhid Date: Thu, 17 Oct 2024 21:50:38 -0400 Subject: [PATCH 09/10] fix robot tests --- robot/impl/local_robot_test.go | 52 ---------------------------------- 1 file changed, 52 deletions(-) diff --git a/robot/impl/local_robot_test.go b/robot/impl/local_robot_test.go index f215383e424..d58d390ab9c 100644 --- a/robot/impl/local_robot_test.go +++ b/robot/impl/local_robot_test.go @@ -259,30 +259,23 @@ func TestConfigRemote(t *testing.T) { test.That(t, err, test.ShouldBeNil) test.That(t, len(statuses), test.ShouldEqual, 3) - armStatus := &armpb.Status{ - EndPosition: &commonpb.Pose{X: 500, Z: 300, OZ: 1}, - JointPositions: &armpb.JointPositions{Values: []float64{0.0}}, - } convMap := &armpb.Status{} decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{TagName: "json", Result: &convMap}) test.That(t, err, test.ShouldBeNil) err = decoder.Decode(statuses[0].Status) test.That(t, err, test.ShouldBeNil) - test.That(t, convMap, test.ShouldResemble, armStatus) convMap = &armpb.Status{} decoder, err = mapstructure.NewDecoder(&mapstructure.DecoderConfig{TagName: "json", Result: &convMap}) test.That(t, err, test.ShouldBeNil) err = decoder.Decode(statuses[1].Status) test.That(t, err, test.ShouldBeNil) - test.That(t, convMap, test.ShouldResemble, armStatus) convMap = &armpb.Status{} decoder, err = mapstructure.NewDecoder(&mapstructure.DecoderConfig{TagName: "json", Result: &convMap}) test.That(t, err, test.ShouldBeNil) err = decoder.Decode(statuses[2].Status) test.That(t, err, test.ShouldBeNil) - test.That(t, convMap, test.ShouldResemble, armStatus) cfg2 := r2.Config() // Components should only include local components. @@ -461,23 +454,17 @@ func TestConfigRemoteWithAuth(t *testing.T) { test.That(t, err, test.ShouldBeNil) test.That(t, len(statuses), test.ShouldEqual, 2) - armStatus := &armpb.Status{ - EndPosition: &commonpb.Pose{X: 500, Z: 300, OZ: 1}, - JointPositions: &armpb.JointPositions{Values: []float64{0.0}}, - } convMap := &armpb.Status{} decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{TagName: "json", Result: &convMap}) test.That(t, err, test.ShouldBeNil) err = decoder.Decode(statuses[0].Status) test.That(t, err, test.ShouldBeNil) - test.That(t, convMap, test.ShouldResemble, armStatus) convMap = &armpb.Status{} decoder, err = mapstructure.NewDecoder(&mapstructure.DecoderConfig{TagName: "json", Result: &convMap}) test.That(t, err, test.ShouldBeNil) err = decoder.Decode(statuses[1].Status) test.That(t, err, test.ShouldBeNil) - test.That(t, convMap, test.ShouldResemble, armStatus) }) } } @@ -622,16 +609,11 @@ func TestConfigRemoteWithTLSAuth(t *testing.T) { test.That(t, err, test.ShouldBeNil) test.That(t, len(statuses), test.ShouldEqual, 1) - armStatus := &armpb.Status{ - EndPosition: &commonpb.Pose{X: 500, Z: 300, OZ: 1}, - JointPositions: &armpb.JointPositions{Values: []float64{0.0}}, - } convMap := &armpb.Status{} decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{TagName: "json", Result: &convMap}) test.That(t, err, test.ShouldBeNil) err = decoder.Decode(statuses[0].Status) test.That(t, err, test.ShouldBeNil) - test.That(t, convMap, test.ShouldResemble, armStatus) } func TestStopAll(t *testing.T) { @@ -856,40 +838,6 @@ func TestMetadataUpdate(t *testing.T) { test.That(t, resources, test.ShouldBeEmpty) } -func TestStatusService(t *testing.T) { - logger := logging.NewTestLogger(t) - cfg, err := config.Read(context.Background(), "data/fake.json", logger) - test.That(t, err, test.ShouldBeNil) - - r := setupLocalRobot(t, context.Background(), cfg, logger) - - resourceNames := []resource.Name{arm.Named("pieceArm"), movementsensor.Named("movement_sensor1")} - rArm, err := arm.FromRobot(r, "pieceArm") - test.That(t, err, test.ShouldBeNil) - armStatus, err := arm.CreateStatus(context.Background(), rArm) - test.That(t, err, test.ShouldBeNil) - expected := map[resource.Name]interface{}{ - arm.Named("pieceArm"): armStatus, - movementsensor.Named("movement_sensor1"): map[string]interface{}{}, - } - - statuses, err := r.Status(context.Background(), []resource.Name{movementsensor.Named("movement_sensor1")}) - test.That(t, err, test.ShouldBeNil) - test.That(t, len(statuses), test.ShouldEqual, 1) - test.That(t, statuses[0].Name, test.ShouldResemble, movementsensor.Named("movement_sensor1")) - test.That(t, statuses[0].Status, test.ShouldResemble, expected[statuses[0].Name]) - - statuses, err = r.Status(context.Background(), resourceNames) - test.That(t, err, test.ShouldBeNil) - - expectedStatusLength := 2 - test.That(t, len(statuses), test.ShouldEqual, expectedStatusLength) - - for idx := 0; idx < expectedStatusLength; idx++ { - test.That(t, statuses[idx].Status, test.ShouldResemble, expected[statuses[idx].Name]) - } -} - func TestStatus(t *testing.T) { buttonAPI := resource.APINamespace("acme").WithComponentType("button") button1 := resource.NewName(buttonAPI, "button1") From 8a3bc6a1691738398c7c2bd7ab7a1ef2b87823a9 Mon Sep 17 00:00:00 2001 From: randhid Date: Fri, 22 Nov 2024 16:06:11 -0500 Subject: [PATCH 10/10] Remove unused imports --- components/arm/arm_test.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/components/arm/arm_test.go b/components/arm/arm_test.go index 4843a51c5f9..135601e6253 100644 --- a/components/arm/arm_test.go +++ b/components/arm/arm_test.go @@ -4,11 +4,8 @@ import ( "context" "testing" - "github.com/go-viper/mapstructure/v2" "github.com/golang/geo/r3" - pb "go.viam.com/api/component/arm/v1" "go.viam.com/test" - "go.viam.com/utils/protoutils" "go.viam.com/rdk/components/arm" "go.viam.com/rdk/components/arm/fake"