diff --git a/build_deb.sh b/build_deb.sh index f6c58ea..f9a81fe 100644 --- a/build_deb.sh +++ b/build_deb.sh @@ -8,13 +8,13 @@ fpm -s python --python-bin python3 --python-pip pip3 --python-package-name-prefi --description 'Library for robot used in the competition' \ --after-install postinstall.sh \ --deb-generate-changes \ - --deb-dist "buster" \ --deb-priority "optional" \ - --deb-changelog changelog \ - --deb-upstream-changelog changelog \ - -v 0.0.2-4 -t deb setup.py + -v 0.0.2-6 -t deb setup.py +# --deb-changelog changelog \ +# --deb-upstream-changelog changelog \ # --deb-field "Distribution: stable" \ +# --deb-dist "stable" \ sudo apt purge python3-complib -y sudo apt install ./python3-* diff --git a/docs/source/conf.py b/docs/source/conf.py index 35a3f76..dd8f84a 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -23,7 +23,7 @@ copyright = '2021, robo4you' author = 'robo4you' # The full version, including alpha/beta/rc tags -release = '0.0.1' +release = '0.0.2' # -- General configuration --------------------------------------------------- diff --git a/docs/source/lib/Api.rst b/docs/source/lib/Api.rst index 717baff..44b2a43 100644 --- a/docs/source/lib/Api.rst +++ b/docs/source/lib/Api.rst @@ -3,5 +3,65 @@ Api ===== -.. automodule:: compLib.Api - :members: \ No newline at end of file +Seeding +******** + +.. autoclass:: compLib.Api.Seeding + :members: + +Double Elimination +******************* + +.. autoclass:: compLib.Api.DoubleElim + :members: + +Position +********* + +.. autoclass:: compLib.Api.Position + :members: + + +Examples +********* + +Calling Seeding API +--------------------- + +.. code-block:: python + + from compLib.Api import Seeding + + park = Seeding.get_park() + print(f"I should move to parking position: {park}") + + if park == 0: + print(f"I can't move to this position yet :(") + elif park == 1: + print(f"Moving to position 1!") + # drive to parking position using Motors module... + print(f"Now hopefully at position 1") + # drive back using Motors module... + elif park == 2: + # do something similar to park == 1.. + elif park == 3: + # do something similar to park == 1.. + + success = Seeding.pay_park() + if success: + print(f"We scored some points!") + else: + print(f"We failed :(") + +Calling Double Elimination API +---------------------------------- + +.. code-block:: python + + from compLib.Api import DoubleElim + + position = DoubleElim.get_position() + print(f"Position of my robot is: x={position.x}, y={position.y} and rotation is: {position.degrees}") + + goal = DoubleElim.get_goal() + print(f"Goal is at: x={goal.x}, y={goal.y}")