2017-12-19 13:10:40 -08:00
|
|
|
// add tests package
|
2018-02-19 07:35:08 -08:00
|
|
|
tests.test("lgB run 10", () => {
|
|
|
|
motors.largeB.run(10);
|
2018-02-14 16:05:31 -08:00
|
|
|
pause(500)
|
2017-12-19 07:07:50 -08:00
|
|
|
tests.assertClose("speedB", 10, motors.largeB.speed(), 2)
|
|
|
|
});
|
2018-02-19 07:35:08 -08:00
|
|
|
tests.test("lgB run 25 (reversed)", () => {
|
2018-02-06 23:18:36 -08:00
|
|
|
motors.largeB.setInverted(true)
|
2018-02-19 07:35:08 -08:00
|
|
|
motors.largeB.run(25)
|
2018-02-14 16:05:31 -08:00
|
|
|
pause(500)
|
2017-12-19 07:07:50 -08:00
|
|
|
tests.assertClose("speedB", -25, motors.largeB.speed(), 2)
|
|
|
|
});
|
2018-02-19 07:35:08 -08:00
|
|
|
tests.test("lgBC run 5", () => {
|
|
|
|
motors.largeBC.run(5)
|
2018-02-14 16:05:31 -08:00
|
|
|
pause(500)
|
2017-12-19 07:07:50 -08:00
|
|
|
tests.assertClose("speedB", 5, motors.largeB.speed(), 1);
|
|
|
|
tests.assertClose("speedC", 5, motors.largeC.speed(), 1);
|
|
|
|
});
|
|
|
|
tests.test("lgBC steer 50% 2x", () => {
|
|
|
|
motors.largeBC.setBrake(true)
|
|
|
|
motors.largeBC.steer(50, 50, 1, MoveUnit.Rotations)
|
2018-02-14 16:05:31 -08:00
|
|
|
pause(2000)
|
2017-12-19 07:07:50 -08:00
|
|
|
tests.assertClose("largeB", 360, motors.largeB.angle(), 5)
|
|
|
|
motors.largeBC.setBrake(false)
|
2017-12-18 14:31:17 -08:00
|
|
|
})
|
2017-12-19 13:10:40 -08:00
|
|
|
tests.test("lgBC steer 360deg", () => {
|
2017-12-19 07:07:50 -08:00
|
|
|
motors.largeBC.setBrake(true)
|
2017-12-19 13:10:40 -08:00
|
|
|
motors.largeBC.steer(50, 50, 360, MoveUnit.Degrees)
|
2018-02-14 16:05:31 -08:00
|
|
|
pause(2000)
|
2017-12-19 13:10:40 -08:00
|
|
|
tests.assertClose("largeB", 360, motors.largeB.angle(), 5)
|
2017-12-19 07:07:50 -08:00
|
|
|
});
|
2017-12-19 13:10:40 -08:00
|
|
|
tests.test("lgBC steer 50% 1s", () => {
|
2017-12-19 07:07:50 -08:00
|
|
|
motors.largeBC.setBrake(true)
|
2017-12-19 13:10:40 -08:00
|
|
|
motors.largeBC.steer(10, 50, 1000, MoveUnit.MilliSeconds)
|
2018-02-14 16:05:31 -08:00
|
|
|
pause(2000)
|
2017-12-18 14:13:38 -08:00
|
|
|
})
|
2017-12-19 13:10:40 -08:00
|
|
|
tests.test("lgBC tank 50% 180deg", () => {
|
2017-12-19 07:07:50 -08:00
|
|
|
motors.largeBC.setBrake(true)
|
|
|
|
motors.largeBC.tank(50, 50, 180, MoveUnit.Degrees)
|
2018-02-14 16:05:31 -08:00
|
|
|
pause(1000)
|
2017-12-19 07:07:50 -08:00
|
|
|
tests.assertClose("largeB", 180, motors.largeB.angle(), 5)
|
|
|
|
});
|