Skip to content

Commit

Permalink
Merge branch 'main' into APP-723-cameras
Browse files Browse the repository at this point in the history
  • Loading branch information
mrloureed committed Oct 17, 2022
2 parents 1a6232a + dde5b84 commit b67b404
Show file tree
Hide file tree
Showing 88 changed files with 872 additions and 439 deletions.
126 changes: 32 additions & 94 deletions .artifact/tree.json
Original file line number Diff line number Diff line change
Expand Up @@ -50802,129 +50802,67 @@
}
}
},
"temp_mock_camera": {
"color": {
"0.png": {
"hash": "d6a4ad2b5d0a07cb42ce0a968bdd2d1e",
"size": 1074038
},
"1.png": {
"hash": "bf162ae919b499fb2a31c1c0651bc7e7",
"size": 1110424
},
"10.png": {
"hash": "7ecd6687e8af2f741b74fd6d61e5b94f",
"size": 1262970
},
"11.png": {
"hash": "e49a10305cd6444d65a2e259e092dcf3",
"size": 1320711
},
"12.png": {
"hash": "ccc96509aecebfcad460f66a8980ea9b",
"size": 1383680
},
"13.png": {
"hash": "a54e3cad45855001accb0f3e90cc4901",
"size": 1232388
},
"14.png": {
"hash": "2d0fcc43e04cfa64533f066f08286c8c",
"size": 1319859
},
"2.png": {
"hash": "561f98f2fdb955118c396071cb768711",
"size": 1113264
},
"3.png": {
"hash": "0b1245610799dfc255a39c7b28592839",
"size": 1126246
},
"4.png": {
"hash": "f87169c5c85b32e255f59aa50856ff27",
"size": 1126679
},
"5.png": {
"hash": "769088a8ebdbb1ce2979b64808ac707d",
"size": 1108197
},
"6.png": {
"hash": "fcc66c01f0f1cb5c200d0b3a67d0991e",
"size": 1118615
},
"7.png": {
"hash": "f81538daa0836653b935b97c99a60142",
"size": 1094447
},
"8.png": {
"hash": "9668c21a11b5abedb1254770dafb959d",
"size": 1246588
},
"9.png": {
"hash": "5e6afad5bf9912b1d69ed06d357f0b36",
"size": 1269381
}
},
"depth": {
"mock_mono_camera": {
"rgb": {
"0.png": {
"hash": "e49b03a3e9fe6a9e41d67e3308a70120",
"size": 245153
"hash": "c4dc7ae86a546684f3c9cbe0e47acf55",
"size": 834386
},
"1.png": {
"hash": "34e0a2ae549be6f507b8f4e27f31f2e2",
"size": 345685
"hash": "c4dc7ae86a546684f3c9cbe0e47acf55",
"size": 834386
},
"10.png": {
"hash": "65517158a4175157ab3636e1ef9ac90d",
"size": 500936
"hash": "97cb4afc22754e0433303ae8b44d380f",
"size": 813831
},
"11.png": {
"hash": "593e152cea83f14e1c4b4cec78e0b33b",
"size": 528680
"hash": "f87b5643a7b58bc4cdf231ab096038b7",
"size": 833993
},
"12.png": {
"hash": "0abc4c2361127eb343572390c8d9f35c",
"size": 528095
"hash": "f87b5643a7b58bc4cdf231ab096038b7",
"size": 833993
},
"13.png": {
"hash": "3f28b21a7206a6e6cc109fd2b03d432b",
"size": 526535
"hash": "c40ec042eb926ed5e012c0a505b0453d",
"size": 787645
},
"14.png": {
"hash": "f5142f9dbe12b339f8b4a0b92abe22f9",
"size": 485705
"hash": "87f3db7908d0455ffe3b2a51093abe16",
"size": 824040
},
"2.png": {
"hash": "34e0a2ae549be6f507b8f4e27f31f2e2",
"size": 345685
"hash": "c4dc7ae86a546684f3c9cbe0e47acf55",
"size": 834386
},
"3.png": {
"hash": "2a3b9d6fa3177270c8be3fc48f12b6e9",
"size": 480005
"hash": "c4dc7ae86a546684f3c9cbe0e47acf55",
"size": 834386
},
"4.png": {
"hash": "59765705cd3ff8331b908f5a2f2b7d20",
"size": 479413
"hash": "f87b5643a7b58bc4cdf231ab096038b7",
"size": 833993
},
"5.png": {
"hash": "bbb525470e857878207ce030a0d78b26",
"size": 479728
"hash": "f87b5643a7b58bc4cdf231ab096038b7",
"size": 833993
},
"6.png": {
"hash": "ed4df21dd6036b0cda823de71dd81c53",
"size": 513825
"hash": "d17c07b754a6c274915a94a2dd978c02",
"size": 819850
},
"7.png": {
"hash": "b37632c463e4a4a78b3bcd172a215ea5",
"size": 511135
"hash": "87f3db7908d0455ffe3b2a51093abe16",
"size": 824040
},
"8.png": {
"hash": "95683c3b3c6a93282c3d06fabcd149ed",
"size": 503015
"hash": "c40ec042eb926ed5e012c0a505b0453d",
"size": 787645
},
"9.png": {
"hash": "fcac230bb47d1617838e48fe3ca10f56",
"size": 505238
"hash": "97cb4afc22754e0433303ae8b44d380f",
"size": 813831
}
}
}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ jobs:
uses: viamrobotics/rdk/.github/workflows/test.yml@main
secrets:
ARTIFACT_READ_ONLY_GCP_CREDENTIALS: ${{ secrets.ARTIFACT_READ_ONLY_GCP_CREDENTIALS }}
MONGODB_TEST_OUTPUT_URI: ${{ secrets.MONGODB_TEST_OUTPUT_URI }}
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: viamrobotics/rdk/.github/workflows/test.yml@main
secrets:
ARTIFACT_READ_ONLY_GCP_CREDENTIALS: ${{ secrets.ARTIFACT_READ_ONLY_GCP_CREDENTIALS }}
MONGODB_TEST_OUTPUT_URI: ${{ secrets.MONGODB_TEST_OUTPUT_URI }}

appimage:
needs: test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
uses: viamrobotics/rdk/.github/workflows/test.yml@main
secrets:
ARTIFACT_READ_ONLY_GCP_CREDENTIALS: ${{ secrets.ARTIFACT_READ_ONLY_GCP_CREDENTIALS }}
MONGODB_TEST_OUTPUT_URI: ${{ secrets.MONGODB_TEST_OUTPUT_URI }}

# This lets people add an "appimage" tag to have appimages built for the PR
appimage:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ on:
secrets:
ARTIFACT_READ_ONLY_GCP_CREDENTIALS:
required: true
MONGODB_TEST_OUTPUT_URI:
required: true

env:
GOPRIVATE: "github.com/viamrobotics/*,go.viam.com/*"
GOOGLE_APPLICATION_CREDENTIALS_FILENAME: "google-credentials.json"
MONGODB_TEST_OUTPUT_URI: ${{ secrets.MONGODB_TEST_OUTPUT_URI }}

jobs:
build_and_test:
Expand Down Expand Up @@ -60,7 +63,7 @@ jobs:
- name: Test
if: matrix.platform == 'linux/amd64'
run: |
sudo --preserve-env=GOOGLE_APPLICATION_CREDENTIALS -u testbot bash -lc 'make cover test-web'
sudo --preserve-env=GOOGLE_APPLICATION_CREDENTIALS,MONGODB_TEST_OUTPUT_URI,GITHUB_SHA,GITHUB_RUN_ID,GITHUB_RUN_NUMBER,GITHUB_RUN_ATTEMPT,GITHUB_BASE_REF -u testbot bash -lc 'make cover test-web'
- name: Code Coverage Summary Report
if: matrix.platform == 'linux/amd64'
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ node_modules/
docs/

# Test data
json.log
json2.log
coverage.txt
coverage2.txt
coverage.xml
Expand Down
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ tool-install:
github.com/golangci/golangci-lint/cmd/golangci-lint \
github.com/AlekSi/gocov-xml \
github.com/axw/gocov/gocov \
github.com/bufbuild/buf/cmd/buf
github.com/bufbuild/buf/cmd/buf \
gotest.tools/gotestsum

buf: buf-web

Expand All @@ -58,13 +59,13 @@ lint-web:
typecheck-web:
npm run typecheck --prefix web/frontend

cover:
cover: tool-install
PATH=$(PATH_WITH_TOOLS) ./etc/test.sh cover

test: test-go test-web

test-go:
./etc/test.sh
test-go: tool-install
PATH=$(PATH_WITH_TOOLS) ./etc/test.sh

test-web:
npm run test:unit --prefix web/frontend
Expand All @@ -76,7 +77,11 @@ test-pi:

test-e2e:
go build $(LDFLAGS) -o bin/test-e2e/server web/cmd/server/main.go
./etc/e2e.sh
./etc/e2e.sh -o 'run'

open-cypress-ui:
go build $(LDFLAGS) -o bin/test-e2e/server web/cmd/server/main.go
./etc/e2e.sh -o 'open'

test-integration:
cd services/slam/builtin && sudo --preserve-env=APPIMAGE_EXTRACT_AND_RUN go test -v -run TestOrbslamIntegration
Expand Down
2 changes: 1 addition & 1 deletion components/base/boat/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func (b *boat) Width(ctx context.Context) (int, error) {

func (b *boat) IsMoving(ctx context.Context) (bool, error) {
for _, m := range b.motors {
isMoving, err := m.IsPowered(ctx, nil)
isMoving, _, err := m.IsPowered(ctx, nil)
if err != nil {
return false, err
}
Expand Down
4 changes: 2 additions & 2 deletions components/base/wheeled/wheeled_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (base *wheeledBase) WaitForMotorsToStop(ctx context.Context) error {
anyOff := false

for _, m := range base.allMotors {
isOn, err := m.IsPowered(ctx, nil)
isOn, _, err := m.IsPowered(ctx, nil)
if err != nil {
return err
}
Expand Down Expand Up @@ -258,7 +258,7 @@ func (base *wheeledBase) Stop(ctx context.Context, extra map[string]interface{})

func (base *wheeledBase) IsMoving(ctx context.Context) (bool, error) {
for _, m := range base.allMotors {
isMoving, err := m.IsPowered(ctx, nil)
isMoving, _, err := m.IsPowered(ctx, nil)
if err != nil {
return false, err
}
Expand Down
21 changes: 14 additions & 7 deletions components/base/wheeled/wheeled_base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ func TestWheelBaseMath(t *testing.T) {
test.That(t, err, test.ShouldBeNil)

for _, m := range base.allMotors {
isOn, err := m.IsPowered(context.Background(), nil)
isOn, powerPct, err := m.IsPowered(context.Background(), nil)
test.That(t, err, test.ShouldBeNil)
test.That(t, isOn, test.ShouldBeFalse)
test.That(t, powerPct, test.ShouldEqual, 0.0)
}
})

Expand All @@ -93,9 +94,10 @@ func TestWheelBaseMath(t *testing.T) {
test.That(t, err, test.ShouldBeNil)

for _, m := range base.allMotors {
isOn, err := m.IsPowered(context.Background(), nil)
isOn, powerPct, err := m.IsPowered(context.Background(), nil)
test.That(t, err, test.ShouldBeNil)
test.That(t, isOn, test.ShouldBeFalse)
test.That(t, powerPct, test.ShouldEqual, 0.0)
}
})

Expand All @@ -105,26 +107,29 @@ func TestWheelBaseMath(t *testing.T) {

err = base.allMotors[0].SetPower(ctx, 1, nil)
test.That(t, err, test.ShouldBeNil)
isOn, err := base.allMotors[0].IsPowered(ctx, nil)
isOn, powerPct, err := base.allMotors[0].IsPowered(ctx, nil)
test.That(t, err, test.ShouldBeNil)
test.That(t, isOn, test.ShouldBeTrue)
test.That(t, powerPct, test.ShouldEqual, 1.0)

err = base.WaitForMotorsToStop(ctx)
test.That(t, err, test.ShouldBeNil)

for _, m := range base.allMotors {
isOn, err := m.IsPowered(ctx, nil)
isOn, powerPct, err := m.IsPowered(ctx, nil)
test.That(t, err, test.ShouldBeNil)
test.That(t, isOn, test.ShouldBeFalse)
test.That(t, powerPct, test.ShouldEqual, 0.0)
}

err = base.WaitForMotorsToStop(ctx)
test.That(t, err, test.ShouldBeNil)

for _, m := range base.allMotors {
isOn, err := m.IsPowered(ctx, nil)
isOn, powerPct, err := m.IsPowered(ctx, nil)
test.That(t, err, test.ShouldBeNil)
test.That(t, isOn, test.ShouldBeFalse)
test.That(t, powerPct, test.ShouldEqual, 0.0)
}
})

Expand All @@ -142,9 +147,10 @@ func TestWheelBaseMath(t *testing.T) {
test.That(t, err, test.ShouldBeNil)

for _, m := range base.allMotors {
isOn, err := m.IsPowered(ctx, nil)
isOn, powerPct, err := m.IsPowered(ctx, nil)
test.That(t, err, test.ShouldBeNil)
test.That(t, isOn, test.ShouldBeFalse)
test.That(t, powerPct, test.ShouldEqual, 0.0)
}
})
// Spin tests
Expand Down Expand Up @@ -178,9 +184,10 @@ func TestWheelBaseMath(t *testing.T) {
test.That(t, err, test.ShouldBeNil)

for _, m := range base.allMotors {
isOn, err := m.IsPowered(ctx, nil)
isOn, powerPct, err := m.IsPowered(ctx, nil)
test.That(t, err, test.ShouldBeNil)
test.That(t, isOn, test.ShouldBeFalse)
test.That(t, powerPct, test.ShouldEqual, 0.0)
}
})

Expand Down
Loading

0 comments on commit b67b404

Please sign in to comment.