Skip to content

Cooperate#985

Merged
pelikhan merged 4 commits intostable1.2from
cooperatestable1.2
Aug 21, 2020
Merged

Cooperate#985
pelikhan merged 4 commits intostable1.2from
cooperatestable1.2

Conversation

@pelikhan
Copy link
Copy Markdown
Member

@pelikhan pelikhan commented Aug 20, 2020

At most pause once every 20ms in injected pauses in motor/sensors.
Test

let counter = 0
let error = 0
motors.largeBC.steer(0, 50, 1, MoveUnit.Rotations)
while (control.millis() < 10000) {
    error = sensors.color3.light(LightIntensityMode.Reflected) - 40
    motors.largeBC.steer(error * 5, 50)
    counter = counter + 1
}
brick.showNumber(counter, 1)
motors.stopAll()

Iterations without fix: 1507
Iterations with fix: 120000

@pelikhan pelikhan requested review from abchatra and mmoskal August 20, 2020 19:07
@pelikhan pelikhan merged commit a47a06a into stable1.2 Aug 21, 2020
@pelikhan pelikhan deleted the cooperatestable1.2 branch August 21, 2020 04:07
pelikhan added a commit that referenced this pull request Aug 21, 2020
* cooperate pause

* fix math

* update lastPause before pausing

* faster cooperation

Co-authored-by: Peli de Halleux <[email protected]>
@mmoskal
Copy link
Copy Markdown
Contributor

mmoskal commented Aug 21, 2020

Looks good; updated description to match code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants