From e215828ab30e8fcb1704794cd7e87beba9acea13 Mon Sep 17 00:00:00 2001 From: Andrey Pohilko Date: Thu, 28 Dec 2017 19:17:27 +0300 Subject: [PATCH] Cosmetics --- README.md | 3 ++- examples/plotter/__init__.py | 2 +- examples/plotter/try.py | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9088b48..f56c4a4 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,10 @@ Best way to start is to look into [`demo.py`](examples/demo.py) file, and run it If you have Vernie assembled, you might run scripts from [`vernie`](examples/vernie/) directory. -Demonstrational video: +Demonstrational videos: [![Demonstrational video](http://img.youtube.com/vi/oqsmgZlVE8I/0.jpg)](http://www.youtube.com/watch?v=oqsmgZlVE8I) +[![Demonstrational video](http://img.youtube.com/vi/ZbKmqVBBMhM/0.jpg)](https://youtu.be/ZbKmqVBBMhM) ## Features diff --git a/examples/plotter/__init__.py b/examples/plotter/__init__.py index 389c509..ca7954b 100644 --- a/examples/plotter/__init__.py +++ b/examples/plotter/__init__.py @@ -58,7 +58,7 @@ class Plotter(object): self._hub.color_distance_sensor.unsubscribe(self._on_distance) if self._marker_color == COLOR_CYAN: - self.move(- 0.1, 0) + self.move(-0.1, 0) else: self.move(-1.0, 0) diff --git a/examples/plotter/try.py b/examples/plotter/try.py index 987a622..ba1d6f6 100644 --- a/examples/plotter/try.py +++ b/examples/plotter/try.py @@ -3,6 +3,7 @@ import time import traceback from examples.plotter import Plotter +from examples.plotter.lego import lego from pylgbst import EncodedMotor, PORT_AB, PORT_C, PORT_A, PORT_B, MoveHub from pylgbst.comms import DebugServerConnection, BLEConnection from tests import HubMock @@ -56,17 +57,18 @@ def circles(): def square_spiral(): - rounds = 7 - step = plotter.base_speed / rounds / 3.0 + rounds = 5 + step = plotter.base_speed / rounds / 5.0 for r in range(1, rounds): plotter.line(step * r * 4, 0) plotter.line(0, step * (r * 4 + 1)) plotter.line(-step * (r * 4 + 2), 0) plotter.line(0, -step * (r * 4 + 3)) + plotter.line(step * 2.0, step * 2.0) # cut def christmas_tree(): - t = FIELD_WIDTH / 5 + t = FIELD_WIDTH / 3 plotter.line(t, t) plotter.line(-t * 0.5, 0) plotter.line(t, t) @@ -208,12 +210,14 @@ if __name__ == '__main__': try: plotter.initialize() + snowflake(0.75) + # christmas_tree() + # square_spiral() + # lego(plotter, FIELD_WIDTH / 7.0) + # plotter._tool_down() - # angles_experiment() - # try_speeds() - # moves() # triangle() # square() @@ -223,10 +227,6 @@ if __name__ == '__main__': # plotter.spiral(4, 0.02) # plotter.rectangle(FIELD_WIDTH / 5.0, FIELD_WIDTH / 5.0, solid=True) - # square_spiral() - snowflake(0.75) - # christmas_tree() - # lego(plotter, FIELD_WIDTH / 5.0) pass finally: plotter.finalize()