From 0fbaa33c4a7d1758fe4e4b6e72c114a5747b9867 Mon Sep 17 00:00:00 2001 From: Antoni Luong Pham Date: Fri, 21 Aug 2020 18:50:54 -0700 Subject: [PATCH 01/13] add SPIK3R README --- robots/SPIK3R/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 robots/SPIK3R/README.md diff --git a/robots/SPIK3R/README.md b/robots/SPIK3R/README.md new file mode 100644 index 0000000..f44178e --- /dev/null +++ b/robots/SPIK3R/README.md @@ -0,0 +1,10 @@ +# SPIK3R + +> This six-legged creature doesn’t just look like a scorpion, it also acts like one. It turns sharply, snaps with it’s crushing claw, and it’s lightning tail is ready to fire at anyone or anything that gets in its way. + +Control SPIK3R with as follows: + +- Make SPIK3R move straight forward by pressing the IR Remote Control's two Up buttons at the same time +- Make SPIK3R turn right by pressing the IR Remote Control's Right Up button +- Make SPIK3R sting by pressing the IR Remote Control's Beacon button +- Make SPIKER pinch by pressing the Touch Sensor (please do connect one to enable this) From 5bdbd889157e57395cc05e6f30c4e87592319b96 Mon Sep 17 00:00:00 2001 From: Antoni Luong Pham Date: Fri, 21 Aug 2020 18:52:07 -0700 Subject: [PATCH 02/13] update SPIK3R README --- robots/SPIK3R/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/robots/SPIK3R/README.md b/robots/SPIK3R/README.md index f44178e..e505f41 100644 --- a/robots/SPIK3R/README.md +++ b/robots/SPIK3R/README.md @@ -8,3 +8,5 @@ Control SPIK3R with as follows: - Make SPIK3R turn right by pressing the IR Remote Control's Right Up button - Make SPIK3R sting by pressing the IR Remote Control's Beacon button - Make SPIKER pinch by pressing the Touch Sensor (please do connect one to enable this) + +The build instructions may be found at the official LEGO MINDSTROMS site [here](https://www.lego.com/cdn/cs/set/assets/blt7dca5180ea66ea5e/31313_SPIK3R_2016.pdf). From 472851cf3abb2e51fce91574626a0b2202359192 Mon Sep 17 00:00:00 2001 From: Vinh Luong Date: Fri, 21 Aug 2020 20:35:08 -0700 Subject: [PATCH 03/13] fix SPIK3R README --- robots/SPIK3R/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robots/SPIK3R/README.md b/robots/SPIK3R/README.md index e505f41..a71134e 100644 --- a/robots/SPIK3R/README.md +++ b/robots/SPIK3R/README.md @@ -2,7 +2,7 @@ > This six-legged creature doesn’t just look like a scorpion, it also acts like one. It turns sharply, snaps with it’s crushing claw, and it’s lightning tail is ready to fire at anyone or anything that gets in its way. -Control SPIK3R with as follows: +Control SPIK3R as follows: - Make SPIK3R move straight forward by pressing the IR Remote Control's two Up buttons at the same time - Make SPIK3R turn right by pressing the IR Remote Control's Right Up button From d96abe1e6afdb460fefad2d96befef2613d691d3 Mon Sep 17 00:00:00 2001 From: Antoni Luong Pham Date: Fri, 21 Aug 2020 20:53:01 -0700 Subject: [PATCH 04/13] update SPIK3R README --- robots/SPIK3R/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robots/SPIK3R/README.md b/robots/SPIK3R/README.md index a71134e..9cacf38 100644 --- a/robots/SPIK3R/README.md +++ b/robots/SPIK3R/README.md @@ -7,6 +7,6 @@ Control SPIK3R as follows: - Make SPIK3R move straight forward by pressing the IR Remote Control's two Up buttons at the same time - Make SPIK3R turn right by pressing the IR Remote Control's Right Up button - Make SPIK3R sting by pressing the IR Remote Control's Beacon button -- Make SPIKER pinch by pressing the Touch Sensor (please do connect one to enable this) +- Make SPIKER snap its claw by pressing the Touch Sensor (please do connect one to enable this) The build instructions may be found at the official LEGO MINDSTROMS site [here](https://www.lego.com/cdn/cs/set/assets/blt7dca5180ea66ea5e/31313_SPIK3R_2016.pdf). From 56a908d1de752f182a331bf84ec02d883df547c7 Mon Sep 17 00:00:00 2001 From: Antoni Luong Pham Date: Fri, 21 Aug 2020 20:56:43 -0700 Subject: [PATCH 05/13] add Spik3r program --- robots/SPIK3R/spik3r.py | 102 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 robots/SPIK3R/spik3r.py diff --git a/robots/SPIK3R/spik3r.py b/robots/SPIK3R/spik3r.py new file mode 100644 index 0000000..f1aa299 --- /dev/null +++ b/robots/SPIK3R/spik3r.py @@ -0,0 +1,102 @@ +#!/usr/bin/env micropython + + +from ev3dev2.motor import LargeMotor, MediumMotor, OUTPUT_A, OUTPUT_B, OUTPUT_D +from ev3dev2.sensor import INPUT_1, INPUT_4 +from ev3dev2.sensor.lego import TouchSensor, InfraredSensor +from ev3dev2.sound import Sound + + +class Spik3r: + def __init__( + self, + claw_motor_port: str = OUTPUT_A, + move_motor_port: str = OUTPUT_B, + sting_motor_port: str = OUTPUT_D, + touch_sensor_port: str = INPUT_1, + ir_sensor_port: str = INPUT_4, ir_beacon_channel: int = 1): + self.claw_motor = MediumMotor(address=claw_motor_port) + self.move_motor = LargeMotor(address=move_motor_port) + self.sting_motor = LargeMotor(address=sting_motor_port) + + self.ir_sensor = InfraredSensor(address=ir_sensor_port) + self.ir_beacon_channel = ir_beacon_channel + + self.touch_sensor = TouchSensor(address=touch_sensor_port) + + self.speaker = Sound() + + + def snap_claw_if_touched(self): + if self.touch_sensor.is_pressed: + self.claw_motor.on_for_seconds( + speed=50, + seconds=1, + brake=True, + block=True) + + self.claw_motor.on_for_seconds( + speed=-50, + seconds=0.3, + brake=True, + block=True) + + + def move_by_ir_beacon(self): + if self.ir_sensor.top_left(channel=self.ir_beacon_channel) and \ + self.ir_sensor.top_right(channel=self.ir_beacon_channel): + self.move_motor.on( + speed=100, + block=False, + brake=False) + + elif self.ir_sensor.top_right(channel=self.ir_beacon_channel): + self.move_motor.on( + speed=-100, + brake=False, + block=False) + + else: + self.move_motor.off(brake=False) + + + def sting_by_ir_beacon(self): + if self.ir_sensor.beacon(channel=self.ir_beacon_channel): + self.sting_motor.on_for_degrees( + speed=-75, + degrees=220, + brake=True, + block=False) + + self.speaker.play_file( + wav_file='/home/robot/sound/Blip 3.wav', + volume=100, + play_type=Sound.PLAY_WAIT_FOR_COMPLETE) + + self.sting_motor.on_for_seconds( + speed=-100, + seconds=1, + brake=True, + block=True) + + self.sting_motor.on_for_seconds( + speed=40, + seconds=1, + brake=True, + block=True) + + while self.ir_sensor.beacon(channel=self.ir_beacon_channel): + pass + + + def main(self): + while True: + self.snap_claw_if_touched() + self.move_by_ir_beacon() + self.sting_by_ir_beacon() + + +if __name__ == '__main__': + SPIK3R = Spik3r() + + SPIK3R.main() From 20dd20d8cc3023666adef0e6216946f753652a1c Mon Sep 17 00:00:00 2001 From: Vinh Luong Date: Sun, 23 Aug 2020 10:34:21 -0700 Subject: [PATCH 06/13] add SPIK3R sound file --- robots/SPIK3R/Blip 3.wav | Bin 0 -> 13292 bytes robots/SPIK3R/spik3r.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 robots/SPIK3R/Blip 3.wav diff --git a/robots/SPIK3R/Blip 3.wav b/robots/SPIK3R/Blip 3.wav new file mode 100644 index 0000000000000000000000000000000000000000..2678a34e697ca856b9963a7753a45d5c2a1d81a8 GIT binary patch literal 13292 zcmZv?1ymeK7dG57K8!FpgWKTl79qq4v5nit-F@S3n`GnJWQhxAfM}U%GI}cLoc}f);>`p z&zIyC1?EY!s?8~lmLD85Vk-UAw3htA#G2x(a5+EI$sqPlaInFY;`4V`{8$P6W0mN* zWL#_bE{m0(zMn@mv<=2JWMLx^5fAQDYlSfyNmYdYHjJv<@{VwHO z3k&=CQ7JJ7mgl-oJ*Y~hNM&YH+b!Ykv4mAw|KQ_GuSN+&O;6b>LUJdF?50XOo?Ux( zwP(MvyX~{Ug_9zjep4DG$3FSk9%)!(v)Yd}+0->r_acq{kkqt=-EULjy=?MnkK-B;!6a0f$ zFb)*HNEn+x6?|wt!I?VVA^az+woH;>`@IN@vTAhH#jK2aVOUqQ_s+MB`N%!Kfy44K z0i%`1+NP8D&V5*=vbM~&+Y}uV<83~>14+zHvy!=+|6x}f;S)=5=&)(9 ztuA!Q1clA=!AVceUoiWg7)xz3f~XU79m?dy%b2J4I@5UjYzzE1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|bNEHb^P;d*kv+uJ-l&5G#wC&3jf?nD#w;5Wg51H@(%_ zp$$$>`q+vfkz?jx2^$z#@a(tePkUqCS4`$kz>GBI*FT)h`%7N#m>#7LY~z`BhZS7< zvAZkH^lea1XrGf<8kF-U_j$93zTB@mc!qN@9#lLwr>}J{M;0}I%u}{Q#i!KO1v1Xz z2^G^0Sw&TPJwK66Av0o*Pw=;v4jlS%`sW=P$Kr_H4f|?~W$Gg>1>H;gjZu|phW#H_ z%juW<>+0ogwW?a9r}l_t7*n8ZtP{8HM&DW8cJVSFREg_4D>LMO*m=2;9iP$jDsSW- z5Q1iZgpgFFVkx19K?4}ME>1~0(iIL=vRxe^xfL$ zm>s79X^{E>98{-hXXUX5@#Fe+`csr@`A?iM8ai>}FGQd4&-``zr(zXc$+@keBI(Q- z2!@|A*rnVkT}?|j_6N6iJl8gvKY=@y$6+P37Q}S|=@-&Es%)stozzLPJ;(}<6a5e& z1}OS!`8CZwXeCc!_(ZY``%Hs14Z1vd4;-!7K?yTns(FR_8W^fo$_MBUnk5ZYl#tc5 z4*4O>k7)odC)&{8kar-N{1eIqVbC9CBB^*f<_Iq*w}V%yrf9r+Jm^4i0nG97`Z#?q zNV4yD?`3y@?z8)AYMU?yRMZ-K89=XIK)|LFsfL-gIG{|^j8`l Date: Mon, 31 Aug 2020 20:11:33 -0700 Subject: [PATCH 07/13] remove blank spaces warned by linters in Spik3r program --- robots/SPIK3R/spik3r.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/robots/SPIK3R/spik3r.py b/robots/SPIK3R/spik3r.py index c2d2027..d8ab5b7 100644 --- a/robots/SPIK3R/spik3r.py +++ b/robots/SPIK3R/spik3r.py @@ -25,7 +25,6 @@ def __init__( self.touch_sensor = TouchSensor(address=touch_sensor_port) self.speaker = Sound() - def snap_claw_if_touched(self): if self.touch_sensor.is_pressed: @@ -41,7 +40,6 @@ def snap_claw_if_touched(self): brake=True, block=True) - def move_by_ir_beacon(self): if self.ir_sensor.top_left(channel=self.ir_beacon_channel) and \ self.ir_sensor.top_right(channel=self.ir_beacon_channel): @@ -59,7 +57,6 @@ def move_by_ir_beacon(self): else: self.move_motor.off(brake=False) - def sting_by_ir_beacon(self): if self.ir_sensor.beacon(channel=self.ir_beacon_channel): self.sting_motor.on_for_degrees( @@ -88,7 +85,6 @@ def sting_by_ir_beacon(self): while self.ir_sensor.beacon(channel=self.ir_beacon_channel): pass - def main(self): while True: self.snap_claw_if_touched() @@ -98,5 +94,4 @@ def main(self): if __name__ == '__main__': SPIK3R = Spik3r() - SPIK3R.main() From b2f4bb5a44474446c7495e7f80cd5e639eb8da2a Mon Sep 17 00:00:00 2001 From: Antoni Luong Pham Date: Sat, 17 Oct 2020 13:47:49 -0700 Subject: [PATCH 08/13] fix minor typo to SPIK3R README --- robots/SPIK3R/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robots/SPIK3R/README.md b/robots/SPIK3R/README.md index 9cacf38..6393e9b 100644 --- a/robots/SPIK3R/README.md +++ b/robots/SPIK3R/README.md @@ -7,6 +7,6 @@ Control SPIK3R as follows: - Make SPIK3R move straight forward by pressing the IR Remote Control's two Up buttons at the same time - Make SPIK3R turn right by pressing the IR Remote Control's Right Up button - Make SPIK3R sting by pressing the IR Remote Control's Beacon button -- Make SPIKER snap its claw by pressing the Touch Sensor (please do connect one to enable this) +- Make SPIK3R snap its claw by pressing the Touch Sensor (please do connect one to enable this) The build instructions may be found at the official LEGO MINDSTROMS site [here](https://www.lego.com/cdn/cs/set/assets/blt7dca5180ea66ea5e/31313_SPIK3R_2016.pdf). From 2601e7fc9abb3b5659815167be4963f7e0640ece Mon Sep 17 00:00:00 2001 From: Antoni Luong Pham Date: Sat, 17 Oct 2020 13:58:42 -0700 Subject: [PATCH 09/13] add Dinor3x program --- robots/DINOR3X/README.md | 24 ++++ robots/DINOR3X/T-rex roar.wav | Bin 0 -> 31724 bytes robots/DINOR3X/dinor3x.py | 247 ++++++++++++++++++++++++++++++++++ 3 files changed, 271 insertions(+) create mode 100644 robots/DINOR3X/README.md create mode 100644 robots/DINOR3X/T-rex roar.wav create mode 100644 robots/DINOR3X/dinor3x.py diff --git a/robots/DINOR3X/README.md b/robots/DINOR3X/README.md new file mode 100644 index 0000000..6237870 --- /dev/null +++ b/robots/DINOR3X/README.md @@ -0,0 +1,24 @@ +# DINOR3X + +> Designed by Lasse Stenbæk Lauesen +> +> This charming robotic triceratops dinosaur is capable of walking and turning on all fours. + +The build instructions may be found at the official LEGO MINDSTROMS site [here](https://www.lego.com/cdn/cs/set/assets/bltad10c02978864265/DINOR3X.pdf). + +Please add a Color Sensor to Dinor3x's back or tail. Control DINOR3X as follows: + +- Make DINOR3X roar by pressing the IR Remote Control's Beacon button + +- Make DINOR3X walk or turn according to instructions from the IR Beacon + - 2 top/up buttons together: walk forward + - 2 bottom/down buttons together: walk backward + - Top Left / Red Up: turn left on the spot + - Top Right / Blue Up: turn right on the spot + - Bottom Left / Red Down: stop + - Bottom Right / Blue Down: calibrate to make the legs straight + +- Make DINOR3X change its speed when detecting some colors + - Red: walk fast + - Green: walk normally + - White: walk slowly diff --git a/robots/DINOR3X/T-rex roar.wav b/robots/DINOR3X/T-rex roar.wav new file mode 100644 index 0000000000000000000000000000000000000000..5a0346a74945e199d1f1e995e016cda424b534a3 GIT binary patch literal 31724 zcmZU)1y~eo*gih7ov^UM(%mH>C;}p(h>9549mnqOu48w%9uosmM8!Y>>F%y&dzbB) znIC?BUg!M3|8VWj%=SO5#>ZJ76Ezy<_R4EmoBh7FhvY#0UuW(+s*fd|^b|7rPU0S@&1IWuDfz5+tSL+}CzkMM86W#CF|G!H8i|~ur zZ|grg{u=cs>i?@BG~o4DFEl{rPvpOj{^+`DTz)I_D?k6W{TJaE zi~s8QE9&39e`10M&VRN3+J39{Xa8>;zb*dc3H)EyzkU8+m40XUH_{)qfA4>DMgJ#; ze>wdd_b&#&&X9qenFjX1{rt(rZ>@f3>0f<*Rnu?2|N8oc@^9NO)L&K z%&!XhrRE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>h{^VuR8*05;J~?LCWvGwJ-S79rDihb0icr98-DmQjsqNWeTYwL%|Xx!@Ifc3 z8FR_E;)vb?KzCAKFl2OPJl-NQ<9W)VTg^-H)5Xq4jK?fm@ zDX1lIIUa@t?0i&DYGN0{;v7%T=1DyBEAjGfWaUTWJaW_@Bpa&m2ja{Bzy;Je!rL7~ QeAtCl56Q%SX|Ox>e^F8t`~Uy| literal 0 HcmV?d00001 diff --git a/robots/DINOR3X/dinor3x.py b/robots/DINOR3X/dinor3x.py new file mode 100644 index 0000000..c27dfdf --- /dev/null +++ b/robots/DINOR3X/dinor3x.py @@ -0,0 +1,247 @@ +#!/usr/bin/env micropython + + +from ev3dev2.motor import ( + LargeMotor, MediumMotor, MoveTank, MoveSteering, + OUTPUT_A, OUTPUT_B, OUTPUT_C +) +from ev3dev2.sensor import INPUT_1, INPUT_3, INPUT_4 +from ev3dev2.sensor.lego import TouchSensor, ColorSensor, InfraredSensor +from ev3dev2.sound import Sound + + +class Dinor3x: + FAST_WALK_SPEED = 80 + NORMAL_WALK_SPEED = 40 + SLOW_WALK_SPEED = 20 + + def __init__( + self, + jaw_motor_port: str = OUTPUT_A, + left_motor_port: str = OUTPUT_B, right_motor_port: str = OUTPUT_C, + touch_sensor_port: str = INPUT_1, color_sensor_port: str = INPUT_3, + ir_sensor_port: str = INPUT_4, ir_beacon_channel: int = 1): + self.jaw_motor = MediumMotor(address=jaw_motor_port) + + self.left_motor = LargeMotor(address=left_motor_port) + self.right_motor = LargeMotor(address=right_motor_port) + self.tank_driver = MoveTank(left_motor_port=left_motor_port, + right_motor_port=right_motor_port, + motor_class=LargeMotor) + self.steer_driver = MoveSteering(left_motor_port=left_motor_port, + right_motor_port=right_motor_port, + motor_class=LargeMotor) + + self.touch_sensor = TouchSensor(address=touch_sensor_port) + self.color_sensor = ColorSensor(address=color_sensor_port) + + self.ir_sensor = InfraredSensor(address=ir_sensor_port) + self.ir_beacon_channel = ir_beacon_channel + + self.speaker = Sound() + + self.roaring = False + self.walk_speed = self.NORMAL_WALK_SPEED + + def roar_by_ir_beacon(self): + """ + Dinor3x roars when the Beacon button is pressed + """ + if self.ir_sensor.beacon(channel=self.ir_beacon_channel): + self.roaring = True + self.open_mouth() + self.roar() + + elif self.roaring: + self.roaring = False + self.close_mouth() + + def change_speed_by_color(self): + """ + Dinor3x changes its speed when detecting some colors + - Red: walk fast + - Green: walk normally + - White: walk slowly + """ + if self.color_sensor.color == ColorSensor.COLOR_RED: + self.speaker.speak( + text='RUN!', + volume=100, + play_type=Sound.PLAY_WAIT_FOR_COMPLETE) + self.walk_speed = self.FAST_WALK_SPEED + self.walk(speed=self.walk_speed) + + elif self.color_sensor.color == ColorSensor.COLOR_GREEN: + self.speaker.speak( + text='Normal', + volume=100, + play_type=Sound.PLAY_WAIT_FOR_COMPLETE) + self.walk_speed = self.NORMAL_WALK_SPEED + self.walk(speed=self.walk_speed) + + elif self.color_sensor.color == ColorSensor.COLOR_WHITE: + self.speaker.speak( + text='slow...', + volume=100, + play_type=Sound.PLAY_WAIT_FOR_COMPLETE) + self.walk_speed = self.SLOW_WALK_SPEED + self.walk(speed=self.walk_speed) + + def walk_by_ir_beacon(self): + """ + Dinor3x walks or turns according to instructions from the IR Beacon + - 2 top/up buttons together: walk forward + - 2 bottom/down buttons together: walk backward + - Top Left / Red Up: turn left on the spot + - Top Right / Blue Up: turn right on the spot + - Bottom Left / Red Down: stop + - Bottom Right / Blue Down: calibrate to make the legs straight + """ + + # forward + if self.ir_sensor.top_left(channel=self.ir_beacon_channel) and \ + self.ir_sensor.top_right: + self.walk(speed=self.walk_speed) + + # backward + elif self.ir_sensor.bottom_left(channel=self.ir_beacon_channel) and \ + self.ir_sensor.bottom_right(channel=self.ir_beacon_channel): + self.walk(speed=-self.walk_speed) + + # turn left on the spot + elif self.ir_sensor.top_left(channel=self.ir_beacon_channel): + self.turn(speed=self.walk_speed) + + # turn right on the spot + elif self.ir_sensor.top_right(channel=self.ir_beacon_channel): + self.turn(speed=-self.walk_speed) + + # stop + elif self.ir_sensor.bottom_left(channel=self.ir_beacon_channel): + self.tank_driver.off(brake=True) + + # calibrate legs + elif self.ir_sensor.bottom_right(channel=self.ir_beacon_channel): + self.calibrate_legs() + + def calibrate_legs(self): + self.tank_driver.on( + left_speed=10, + right_speed=20) + + self.touch_sensor.wait_for_released() + + self.tank_driver.off(brake=True) + + self.left_motor.on(speed=40) + + self.touch_sensor.wait_for_pressed() + + self.left_motor.off(brake=True) + + self.left_motor.on_for_rotations( + rotations=-0.2, + speed=50, + brake=True, + block=True) + + self.right_motor.on(speed=40) + + self.touch_sensor.wait_for_pressed() + + self.right_motor.off(brake=True) + + self.right_motor.on_for_rotations( + rotations=-0.2, + speed=50, + brake=True, + block=True) + + self.left_motor.reset() + self.right_motor.reset() + + def walk(self, speed: float = 100): + self.calibrate_legs() + + self.steer_driver.on( + steering=0, + speed=-speed) + + def turn(self, speed: float = 100): + self.calibrate_legs() + + if speed >= 0: + self.left_motor.on_for_degrees( + degrees=180, + speed=speed, + brake=True, + block=True) + + else: + self.right_motor.on_for_degrees( + degrees=180, + speed=-speed, + brake=True, + block=True) + + self.tank_driver.on( + left_speed=speed, + right_speed=-speed) + + def close_mouth(self): + self.jaw_motor.on_for_seconds( + speed=-20, + seconds=1, + brake=False, + block=False) + + def open_mouth(self): + self.jaw_motor.on_for_seconds( + speed=20, + seconds=1, + block=False, + brake=False) + + def roar(self): + self.speaker.play_file( + wav_file='T-rex roar.wav', + volume=100, + play_type=Sound.PLAY_NO_WAIT_FOR_COMPLETE) + + self.jaw_motor.on_for_degrees( + speed=40, + degrees=-60, + block=True, + brake=True) + + for i in range(12): + self.jaw_motor.on_for_seconds( + speed=-40, + seconds=0.05, + block=True, + brake=True) + + self.jaw_motor.on_for_seconds( + speed=40, + seconds=0.05, + block=True, + brake=True) + + self.jaw_motor.on_for_seconds( + speed=20, + seconds=0.5, + brake=False, + block=True) + + def main(self): + self.close_mouth() + + while True: + self.roar_by_ir_beacon() + self.change_speed_by_color() + self.walk_by_ir_beacon() + + +if __name__ == '__main__': + DINOR3X = Dinor3x() + DINOR3X.main() From 75bd6b98f225d2b6748a851d38adfe71c6c39672 Mon Sep 17 00:00:00 2001 From: Antoni Luong Pham Date: Sat, 17 Oct 2020 14:23:50 -0700 Subject: [PATCH 10/13] minor change to Dinor3x.change_speed_by_color() --- robots/DINOR3X/dinor3x.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/robots/DINOR3X/dinor3x.py b/robots/DINOR3X/dinor3x.py index c27dfdf..c959621 100644 --- a/robots/DINOR3X/dinor3x.py +++ b/robots/DINOR3X/dinor3x.py @@ -67,7 +67,7 @@ def change_speed_by_color(self): self.speaker.speak( text='RUN!', volume=100, - play_type=Sound.PLAY_WAIT_FOR_COMPLETE) + play_type=Sound.PLAY_NO_WAIT_FOR_COMPLETE) self.walk_speed = self.FAST_WALK_SPEED self.walk(speed=self.walk_speed) @@ -75,7 +75,7 @@ def change_speed_by_color(self): self.speaker.speak( text='Normal', volume=100, - play_type=Sound.PLAY_WAIT_FOR_COMPLETE) + play_type=Sound.PLAY_NO_WAIT_FOR_COMPLETE) self.walk_speed = self.NORMAL_WALK_SPEED self.walk(speed=self.walk_speed) @@ -83,7 +83,7 @@ def change_speed_by_color(self): self.speaker.speak( text='slow...', volume=100, - play_type=Sound.PLAY_WAIT_FOR_COMPLETE) + play_type=Sound.PLAY_NO_WAIT_FOR_COMPLETE) self.walk_speed = self.SLOW_WALK_SPEED self.walk(speed=self.walk_speed) From 5925e4af8996a58205d36945c0d73f50f681b32d Mon Sep 17 00:00:00 2001 From: Antoni Luong Pham Date: Sat, 17 Oct 2020 15:04:22 -0700 Subject: [PATCH 11/13] update .GitIgnore to ignore VSCode files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 15c993e..1cf2ae4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ __pycache__ *.pyc *.swp + +# Visual Studio Code files +.vscode/ From d7a7f3eaf827b449ee8576a7c351f75fb6febf2f Mon Sep 17 00:00:00 2001 From: Antoni Luong Pham Date: Sat, 5 Dec 2020 23:45:19 -0800 Subject: [PATCH 12/13] add Rac3 Truck (EV3Dev2) program --- robots/RAC3_TRUCK/README.md | 15 +++ robots/RAC3_TRUCK/rac3_truck.py | 165 ++++++++++++++++++++++++++++++++ 2 files changed, 180 insertions(+) create mode 100644 robots/RAC3_TRUCK/README.md create mode 100644 robots/RAC3_TRUCK/rac3_truck.py diff --git a/robots/RAC3_TRUCK/README.md b/robots/RAC3_TRUCK/README.md new file mode 100644 index 0000000..06256a9 --- /dev/null +++ b/robots/RAC3_TRUCK/README.md @@ -0,0 +1,15 @@ +# RAC3 TRUCK + +> Designed by Laurens Valk. +> +> Want a remote controlled truck? Got it! This is one fun cool ride. You can modify the truck to make it go faster by adding gears, and you can add a custom-built trailer so the truck can be used as a transport vehicle. + +The build instructions may be found at the official LEGO MINDSTROMS site [here](https://www.lego.com/cdn/cs/set/assets/blt8d8677b8321b803e/RAC3_TRUCK.pdf) + +Drive RAC3 TRUCK around according to instructions from Channel 1 of the IR Remote Control: + - 2 Top/Up Buttons together: drive forward + - 2 Bottom/Down Buttons together: drive backward + - Top-Left/Red-Up: turn left forward + - Top-Right/Blue-Up: turn right forward + - Bottom-Left/Red-Down: turn left backward + - Bottom-Right/Blue-Down: turn right backward diff --git a/robots/RAC3_TRUCK/rac3_truck.py b/robots/RAC3_TRUCK/rac3_truck.py new file mode 100644 index 0000000..8c2b8e8 --- /dev/null +++ b/robots/RAC3_TRUCK/rac3_truck.py @@ -0,0 +1,165 @@ +#!/usr/bin/env micropython + + +from ev3dev2.motor import \ + Motor, LargeMotor, MediumMotor, MoveTank, MoveSteering, \ + OUTPUT_A, OUTPUT_B, OUTPUT_C +from ev3dev2.sensor import INPUT_4 +from ev3dev2.sensor.lego import InfraredSensor +from ev3dev2.sound import Sound + +from time import sleep + + +class Rac3Truck: + def __init__( + self, + left_motor_port: str = OUTPUT_B, right_motor_port: str = OUTPUT_C, + polarity: str = Motor.POLARITY_INVERSED, + steer_motor_port: str = OUTPUT_A, + ir_sensor_port: str = INPUT_4, ir_beacon_channel: int = 1, + fast=False): + self.tank_driver = MoveTank(left_motor_port=left_motor_port, + right_motor_port=right_motor_port, + motor_class=LargeMotor) + self.steer_driver = MoveSteering(left_motor_port=left_motor_port, + right_motor_port=right_motor_port, + motor_class=LargeMotor) + + self.steer_motor = MediumMotor(address=steer_motor_port) + + self.tank_driver.left_motor.polarity = \ + self.tank_driver.right_motor.polarity = \ + self.steer_driver.left_motor.polarity = \ + self.steer_driver.right_motor.polarity = polarity + + self.ir_sensor = InfraredSensor(address=ir_sensor_port) + self.ir_beacon_channel = ir_beacon_channel + + self.speaker = Sound() + + def reset(self): + self.steer_motor.on( + speed=30, + brake=False, + block=False) + sleep(1.5) + + self.steer_motor.on_for_degrees( + speed=-50, + degrees=120, + brake=True, + block=True) + + self.steer_motor.reset() + + def steer_left(self): + if self.steer_motor.position > -65: + self.steer_motor.on_to_position( + speed=-20, + position=-65, + brake=True, + block=True) + + else: + self.steer_motor.off(brake=True) + + def steer_right(self): + if self.steer_motor.position < 65: + self.steer_motor.on_to_position( + speed=20, + position=65, + brake=True, + block=True) + + else: + self.steer_motor.off(brake=True) + + def steer_center(self): + if self.steer_motor.position < -7: + self.steer_motor.on_to_position( + speed=20, + position=4, + brake=True, + block=True) + + elif self.steer_motor.position > 7: + self.steer_motor.on_to_position( + speed=-20, + position=-4, + brake=True, + block=True) + + self.steer_motor.off(brake=True) + + sleep(0.1) + + def drive_by_ir_beacon(self): + # forward + if self.ir_sensor.top_left(channel=self.ir_beacon_channel) and \ + self.ir_sensor.top_right(channel=self.ir_beacon_channel): + self.tank_driver.on( + left_speed=80, + right_speed=80) + + self.steer_center() + + # backward + elif self.ir_sensor.bottom_left(channel=self.ir_beacon_channel) and \ + self.ir_sensor.bottom_right(channel=self.ir_beacon_channel): + self.tank_driver.on( + left_speed=-80, + right_speed=-80) + + self.steer_center() + + # turn left forward + elif self.ir_sensor.top_left(channel=self.ir_beacon_channel): + self.tank_driver.on( + left_speed=60, + right_speed=100) + + self.steer_left() + + # turn right forward + elif self.ir_sensor.top_right(channel=self.ir_beacon_channel): + self.tank_driver.on( + left_speed=100, + right_speed=60) + + self.steer_right() + + # turn left backward + elif self.ir_sensor.bottom_left(channel=self.ir_beacon_channel): + self.tank_driver.on( + left_speed=-60, + right_speed=-100) + + self.steer_left() + + # turn right backward + elif self.ir_sensor.bottom_right(channel=self.ir_beacon_channel): + self.tank_driver.on( + left_speed=-100, + right_speed=-60) + + self.steer_right() + + # otherwise stop + else: + self.tank_driver.off(brake=False) + + self.steer_center() + + def main(self): + self.reset() + + sleep(1) + + while True: + self.drive_by_ir_beacon() + + +if __name__ == '__main__': + RAC3_TRUCK = Rac3Truck() + RAC3_TRUCK.main() From bc96bdc3511ec61d042323ccbf5f86de6ea11879 Mon Sep 17 00:00:00 2001 From: Antoni Luong Pham Date: Sun, 13 Dec 2020 00:46:23 -0800 Subject: [PATCH 13/13] edit RAC3 TRUCK program --- robots/RAC3_TRUCK/rac3_truck.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/robots/RAC3_TRUCK/rac3_truck.py b/robots/RAC3_TRUCK/rac3_truck.py index 8c2b8e8..2d617df 100644 --- a/robots/RAC3_TRUCK/rac3_truck.py +++ b/robots/RAC3_TRUCK/rac3_truck.py @@ -150,14 +150,14 @@ def drive_by_ir_beacon(self): self.tank_driver.off(brake=False) self.steer_center() - + def main(self): self.reset() - sleep(1) while True: self.drive_by_ir_beacon() + sleep(0.01) if __name__ == '__main__':