Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cfg from encoded motor structure #2252

Merged
merged 2 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions components/motor/gpio/motor_encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ func newEncodedMotor(
cancelCtx, cancel := context.WithCancel(context.Background())
em := &EncodedMotor{
Named: name.AsNamed(),
cfg: motorConfig,
ticksPerRotation: int64(motorConfig.TicksPerRotation),
real: localReal,
cancelCtx: cancelCtx,
Expand Down Expand Up @@ -175,7 +174,6 @@ type EncodedMotor struct {
resource.AlwaysRebuild

activeBackgroundWorkers sync.WaitGroup
cfg Config
real motor.LocalMotor
encoder encoder.Encoder

Expand Down
5 changes: 1 addition & 4 deletions components/motor/gpio/motor_encoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import (
"go.viam.com/rdk/resource"
)

// setupMotorWithEncoder(encType string) {}

func nowNanosTest() uint64 {
return uint64(time.Now().UnixNano())
}
Expand Down Expand Up @@ -93,7 +91,6 @@ func TestMotorEncoder1(t *testing.T) {
})

t.Run("encoded motor testing SetPower interrupt GoFor", func(t *testing.T) {
t.Skip()
test.That(t, motorDep.goForInternal(context.Background(), 1000, 1000), test.ShouldBeNil)
test.That(t, fakeMotor.Direction(), test.ShouldEqual, 1)
test.That(t, fakeMotor.PowerPct(), test.ShouldBeGreaterThan, float32(0))
Expand Down Expand Up @@ -277,7 +274,7 @@ func TestMotorEncoder1(t *testing.T) {
}

func TestMotorEncoderIncremental(t *testing.T) {
// t.Skip()
t.Skip()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why skipping the test now?

Copy link
Member Author

@randhid randhid May 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm refactoring these test in other work, was trying to unblock alan for his incremental encoder pr. That no longer applies though.

logger := golog.NewTestLogger(t)
undo := SetRPMSleepDebug(1, false)
defer undo()
Expand Down