Compare commits

..
Author SHA1 Message Date
David Lechner dd77c548d2 v3.1.0 2021-12-16 15:35:09 -06:00
David Lechner 022afabd30 pybricks.robotics: add type hint for curve()
This method was added in 30803fc.
2021-12-16 15:33:00 -06:00
David Lechner ce17123325 pybricks._common: remove type hint for integral_range()
This was removed in e061617.

Also fix import of Axis while we are touching this file.
2021-12-16 15:29:44 -06:00
Laurens Valk f2346df4e5 pybricks.iodevices: Hide LWP3Device
This is not part of the upcoming release.

Hiding is nicer than adding not-ready disclaimers throughout, especially since this information is very easy to access via our beta channel.
2021-12-01 15:39:05 +01:00
Laurens Valk 94c659ba6d pybricks.geometry: Hide module and IMU examples.
This is not part of the upcoming release.

Hiding is nicer than adding not-ready disclaimers throughout, especially since this information is very easy to access via our beta channel.
2021-12-01 15:39:04 +01:00
Laurens Valk 9c0298bad0 doc/main/index: Drop beta note.
This is a normal release.
2021-12-01 15:39:04 +01:00
Laurens Valk 602b21fe9d doc/main/hubs: Hide Prime Hub.
This is not part of the upcoming release.

Hiding is nicer than adding not-ready disclaimers throughout, especially
since this information is very easy to access via our beta channel.
2021-12-01 15:39:04 +01:00
Laurens Valk 30803fc017 pybricks.robotics.DriveBase: Add curve method.
This generalizes motion to curves (arcs), which is in
between straight lines and in-place turns.
2021-12-01 15:38:27 +01:00
Laurens Valk 749eceefc4 pybricks.robotics.DriveBase: Document then and wait arguments. 2021-12-01 15:35:37 +01:00
Laurens Valk 57f6f0fbef pybricks.pupdevices.DCMotor: Document settings method.
Also update changelog for recent changes.
2021-12-01 14:55:34 +01:00
Laurens Valk e061617c34 pybricks.common.Control: Drop integral_range.
This setting is no longer used. We leave a placeholder setting so we don't break existing programs.

See https://github.com/pybricks/pybricks-micropython/commit/e82dd6a2be4e378ab0b1ee7e3b2643fe654de4a9#diff-e529f43c94cf766ade4b68930f9713a45b62618f4305e4c0c88ba872e9f9cd0e
2021-12-01 14:54:21 +01:00
Laurens Valk eb09ecd7c7 pybricks.common.Control: Drop duty limit.
This is now a per-motor voltage limit.

See https://github.com/pybricks/support/issues/536
2021-12-01 14:41:09 +01:00
Laurens Valk 06a1542613 pybricks.pupdevices.DCMotor: Document settings method.
See https://github.com/pybricks/support/issues/536
2021-12-01 14:40:06 +01:00
Laurens Valk 82a8f2ae89 pybricks.pupdevices.Motor: Add small motor render.
Fixes https://github.com/pybricks/support/issues/441
2021-11-23 08:59:44 +01:00
Laurens Valk 7d0fe9cb85 doc/common/extensions: Fix classlink.
Allow the link to be different from the name.

This lets us fix the link for the Inventor Hub, which was linking to a non-existent page.
2021-11-22 14:49:20 +01:00
Laurens Valk 1af876ac8f pybricks.pupdevices.ColorLightMatrix: Fix render.
- Use isometric projection
- Fix broken plug
- Use correct background color

While we are at it, add colors to show which 9 colors this device supports.
2021-11-22 14:49:20 +01:00
David Lechner 718a28c0da @pybricks/ide-docs v2.0.1 2021-11-19 20:30:11 -06:00
David Lechner a2a375cb5c docs/pupdevices: fix broken link
The link to the color light matrix page was broken due to an invalid
file name.
2021-11-19 20:28:33 -06:00
29 changed files with 308 additions and 160 deletions
+14
View File
@@ -2,6 +2,20 @@
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
## 3.1.0 - 2021-12-16
### Added
- Added maximum voltage setter for `DCMotor` and `Motor`.
- Documented `DriveBase.curve()` method.
### Changed
- Removed `duty` setting from `Control.limits` method.
- Removed `integral_range` setting from `Control.pid` method.
### Fixed
- Fixed link to Color Light Matrix page.
- Fixed link to Inventor Hub page.
## 3.1.0rc1 - 2021-11-19
### Added
+3
View File
@@ -265,11 +265,14 @@ latex_documents = [
exclude_patterns = [
'ev3devices.rst',
'hubs/ev3brick.rst',
'hubs/primehub.rst',
'geometry.rst',
'iodevices/analogsensor.rst',
'iodevices/dcmotor.rst',
'iodevices/ev3devsensor.rst',
'iodevices/i2cdevice.rst',
'iodevices/lumpdevice.rst',
'iodevices/lwp3device.rst',
'iodevices/uartdevice.rst',
'media.rst',
'messaging.rst',
+4 -2
View File
@@ -5,13 +5,15 @@ from docutils.parsers.rst import Directive
class PybricksClasslinkDirective(Directive):
required_arguments = 1
optional_arguments = 1
def run(self):
# Get link name from sphinx-directive
# Get link and name from sphinx-directive
name = self.arguments[0]
link = name if len(self.arguments) == 1 else self.arguments[1]
html = (
'<a href="{0}.html">'.format(name.lower()) +
'<a href="{0}.html">'.format(link.lower()) +
'<dl class="py class">' +
'<dt>' +
'<em class="property">class </em>' +
+8 -7
View File
@@ -3,11 +3,12 @@
0 !LICENSE MIT
0 ROTATION CENTER 0 0 0 1 "Custom"
0 ROTATION CONFIG 0 0
1 15 430 -96 190 0 0 1 1 0 0 0 1 0 54675c01.dat
1 15 430 -96 400 0 0 1 1 0 0 0 1 0 54675c01.dat
1 322 430 -72 30 0 0 1 1 0 0 0 1 0 54696c01.dat
1 71 430 -72 -180 0 0 1 1 0 0 0 1 0 54696c01.dat
1 71 190 -144 -180 1 0 0 0 1 0 0 0 1 22169c01.dat
1 71 -20 -216 -140 1 0 0 0 1 0 0 0 1 22172c01.dat
1 15 120 -320 160 1 0 0 0 1 0 0 0 1 26913c01.dat
1 15 450 -76 -20 0 0 1 1 0 0 0 1 0 54675c01.dat
1 15 -30 -76 280 0 0 1 1 0 0 0 1 0 68488c01.dat
1 71 550 -76 200 0 0 1 1 0 0 0 1 0 69730c01.dat
1 15 180 -72 140 0 0 1 1 0 0 0 1 0 54696c01.dat
1 15 260 -72 350 0 0 1 1 0 0 0 1 0 54696p02c01.dat
1 71 430 -84 470 1 0 0 0 1 0 0 0 1 22169c01.dat
1 71 590 -86 360 1 0 0 0 1 0 0 0 1 22172c01.dat
1 15 300 -110 630 1 0 0 0 1 0 0 0 1 26913c01.dat
0
Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 KiB

After

Width:  |  Height:  |  Size: 860 KiB

+41 -17
View File
@@ -11,8 +11,8 @@
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="2000"
height="1118"
viewBox="0 0 529.16666 295.80416"
height="1126"
viewBox="0 0 529.16666 297.92083"
version="1.1"
id="svg8"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
@@ -58,8 +58,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="619.19211"
inkscape:cy="823.24691"
inkscape:cx="930.75599"
inkscape:cy="703.45816"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
@@ -87,18 +87,18 @@
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1.1958167)">
transform="translate(0,0.92084997)">
<image
sodipodi:absref="pupmotors.png"
xlink:href="pupmotors.png"
width="529.16669"
height="295.80417"
y="-0.92085403"
x="0"
id="image876"
preserveAspectRatio="none"
id="image853"
x="-2.220446e-16"
y="1.1958181" />
height="297.92084"
width="529.16669" />
<g
transform="matrix(1.9732825,0,0,1.9732825,82.068314,-182.19652)"
transform="matrix(1.9732825,0,0,1.9732825,94.897251,-184.86922)"
id="g2717">
<g
transform="matrix(1,-0.27773651,0,1,59.387949,102.27922)"
@@ -123,7 +123,7 @@
</g>
<g
id="g2727"
transform="matrix(1.7059944,0,0,1.7059944,-18.326438,-250.00951)">
transform="matrix(1.7059944,0,0,1.7059944,-93.696445,-190.67567)">
<g
style="fill:#2980b9;fill-opacity:1;stroke:#fffbfb;stroke-width:0.13229167;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="g2721"
@@ -147,7 +147,7 @@
sodipodi:nodetypes="ccccsc" />
</g>
<g
transform="matrix(1.7059944,0,0,1.7059944,40.772154,-187.53273)"
transform="matrix(1.7059944,0,0,1.7059944,105.45138,-208.37975)"
id="g2747">
<g
transform="matrix(1,-0.27773651,0,1,61.231459,102.02783)"
@@ -173,7 +173,7 @@
</g>
<g
id="g2757"
transform="matrix(1.9732825,0,0,1.9732825,-63.81015,-178.54646)">
transform="matrix(1.9732825,0,0,1.9732825,-99.624267,-179.081)">
<g
style="fill:#2980b9;fill-opacity:1;stroke:#fffbfb;stroke-width:0.13229167;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="g2751"
@@ -196,7 +196,7 @@
style="fill:#2980b9;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
<g
transform="matrix(1.9732825,0,0,1.9732825,-192.3424,-182.95247)"
transform="matrix(1.9732825,0,0,1.9732825,-253.27985,-174.39985)"
id="g2767">
<g
transform="matrix(1,-0.27773651,0,1,59.387949,102.27922)"
@@ -221,7 +221,7 @@
</g>
<g
id="g874"
transform="matrix(1.9732825,0,0,1.9732825,-208.72093,-323.71573)">
transform="matrix(1.9732825,0,0,1.9732825,-208.72093,-333.33743)">
<g
style="fill:#2980b9;fill-opacity:1;stroke:#fffbfb;stroke-width:0.13229167;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="g868"
@@ -244,7 +244,7 @@
style="fill:#2980b9;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
<g
transform="matrix(1.9732825,0,0,1.9732825,-134.6376,-374.36454)"
transform="matrix(1.9732825,0,0,1.9732825,-103.63433,-335.34319)"
id="g884">
<g
transform="matrix(1,-0.27773651,0,1,59.387949,102.27922)"
@@ -275,5 +275,29 @@
rx="1.295833"
ry="1.1623898"
transform="matrix(0.89702138,0.44198716,0,1,0,0)" />
<g
id="g899"
transform="matrix(1.9732825,0,0,1.9732825,15.03334,-338.81769)">
<g
style="fill:#2980b9;fill-opacity:1;stroke:#fffbfb;stroke-width:0.13229167;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="g893"
transform="matrix(1,-0.27773651,0,1,59.387949,102.27922)">
<path
id="path891"
style="fill:#2980b9;fill-opacity:1;fill-rule:evenodd;stroke:#fffbfb;stroke-width:0.13229167;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 107.60315,149.3339 -4.4195,12.01847 -4.419489,-12.01847 c 2.609269,1.92005 6.179199,1.90899 8.838989,0 z"
inkscape:connector-curvature="0" />
</g>
<path
inkscape:connector-curvature="0"
id="path895"
d="m 148.90956,215.29575 c -8.02867,2.89572 -14.60635,11.81219 -14.60635,19.93021 l 1.74541,-0.62952 c 0,-7.05178 5.7198,-14.86961 12.86094,-17.44522 7.14113,-2.57561 12.86094,1.11628 12.86094,8.16806 l 1.74541,-0.62952 c 0,-8.11802 -6.57768,-12.28973 -14.60635,-9.39401 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#2980b9;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
inkscape:connector-curvature="0"
id="path897"
d="m 161.70224,224.65346 1.85836,-0.53454 0.43431,0.40926 -0.98973,1.42822 c 0,0 -2.13398,-0.30486 -2.13398,-0.32574 0,-0.0209 0.83104,-0.9772 0.83104,-0.9772 z"
style="fill:#2980b9;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 25 KiB

+2 -1
View File
@@ -1,7 +1,8 @@
0 Name: pupmotors
0 Name: pupsensors.ldr
0 Author: Pybricks {laurens@pybricks.com}
0 !LICENSE MIT
0 !LDCAD GROUP_DEF [topLevel=true] [LID=0] [GID=9FDP9pj0O55] [name=Group 1] [center=0 0 0]
1 15 190 -290 750 -1 0 0 0 -1 0 0 0 1 47592c01.dat
1 15 600 -280 180 1 0 0 0 1 0 0 0 1 37316.dat
1 15 60 -272 160 -1 0 0 0 -1 0 0 0 1 37312c01.dat
1 15 -400 -280 240 -1 0 0 0 -1 0 0 0 1 37308c01.dat
@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="svg2"
width="504"
height="322"
viewBox="0 0 504 322"
sodipodi:docname="sensor_colorlightmatrix.svg"
inkscape:version="0.92.3 (2405546, 2018-03-11)">
<metadata
id="metadata8">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs6">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath846">
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 384.47481,408.57086 22.58181,23.6974 88.18587,13.9655 -36.98745,-79.56651 -97.14072,-16.49296 z"
id="path848"
inkscape:connector-curvature="0" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath874">
<path
style="fill:none;stroke:#000000;stroke-width:0.10000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 491.27259,265.371 c 1.71728,2.18035 5.94442,12.92235 5.94442,12.92235 l 40.68619,39.65737 -0.39629,25.87184 -22.19247,7.07325 -62.08608,-14.9528 10.83204,-57.24707 z"
id="path876"
inkscape:connector-curvature="0" />
</clipPath>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1853"
inkscape:window-height="1145"
id="namedview4"
showgrid="false"
inkscape:zoom="0.70710678"
inkscape:cx="-39.716728"
inkscape:cy="-44.222535"
inkscape:window-x="67"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
inkscape:snap-bbox="true"
inkscape:snap-global="false" />
<image
sodipodi:absref="sensor_colorlightmatrix_main.png"
xlink:href="sensor_colorlightmatrix_main.png"
y="0"
x="0"
id="image10"
preserveAspectRatio="none"
height="322"
width="504" />
<rect
style="fill:#e51a1a;fill-opacity:0.62566845;stroke:none;stroke-width:1.94267738;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect31"
width="45.163605"
height="44.564522"
x="390.70432"
y="293.66827"
transform="matrix(0.94626691,-0.32338666,0,1,0,0)" />
<rect
transform="matrix(0.94626691,-0.32338666,0,1,0,0)"
y="338.23279"
x="390.70432"
height="43.275879"
width="45.163605"
id="rect838"
style="fill:#e5701a;fill-opacity:0.62566845;stroke:none;stroke-width:1.94267738;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" />
<rect
style="fill:#e5bf1a;fill-opacity:0.62566845;stroke:none;stroke-width:1.94267738;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect840"
width="45.163605"
height="38.992153"
x="390.70432"
y="381.46179"
transform="matrix(0.94626691,-0.32338666,0,1,0,0.05126953)"
clip-path="url(#clipPath846)" />
<rect
transform="matrix(0.94626691,-0.32338666,0,1,0,0)"
y="293.66827"
x="435.86792"
height="44.564514"
width="41.462769"
id="rect856"
style="fill:#00af05;fill-opacity:0.62566847;stroke:none;stroke-width:1.94267738;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" />
<rect
style="fill:#0044fb;fill-opacity:0.62566847;stroke:none;stroke-width:1.94267738;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect858"
width="40.347229"
height="44.564514"
x="477.33069"
y="293.66827"
transform="matrix(0.94626691,-0.32338666,0,1,0,0)"
clip-path="url(#clipPath874)" />
<rect
style="fill:#5dffe2;fill-opacity:1;stroke:none;stroke-width:1.94267738;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect860"
width="41.462769"
height="43.261936"
x="435.86792"
y="338.24722"
transform="matrix(0.94626691,-0.32338666,0,1,0,0)" />
<rect
transform="matrix(0.94626691,-0.32338666,0,1,0,0)"
y="338.24722"
x="477.33069"
height="43.261951"
width="40.347229"
id="rect862"
style="fill:#941ae5;fill-opacity:0.62566847;stroke:none;stroke-width:1.94267738;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" />
<rect
transform="matrix(0.94626691,-0.32338666,0,1,0,0)"
y="381.51306"
x="435.86792"
height="38.88504"
width="41.489174"
id="rect868"
style="fill:#1acee5;fill-opacity:0.62566847;stroke:none;stroke-width:1.94267738;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" />
<rect
style="fill:#e51a9a;fill-opacity:0.62566847;stroke:none;stroke-width:1.94267738;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect870"
width="40.281181"
height="38.928104"
x="477.33069"
y="381.51306"
transform="matrix(0.94626691,-0.32338666,0,1,0,0)" />
</svg>

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

-14
View File
@@ -12,7 +12,6 @@
movehub
cityhub
technichub
primehub
.. pybricks-classlink:: MoveHub
@@ -31,16 +30,3 @@
.. figure:: ../../main/images/technichub.png
:height: 10 em
:target: technichub.html
.. pybricks-classlink:: PrimeHub
.. figure:: ../../main/images/primehub.png
:height: 10 em
:target: primehub.html
.. pybricks-classlink:: InventorHub
.. figure:: ../../main/images/inventorhub.png
:height: 10 em
:target: primehub.html
+3 -50
View File
@@ -6,8 +6,9 @@ Technic Hub
.. figure:: ../../main/images/technichub.png
:height: 15 em
.. autoclass:: pybricks.hubs.TechnicHub
:no-members:
.. class:: TechnicHub
LEGO® Technic Hub.
.. rubric:: Using the hub status light
@@ -19,20 +20,6 @@ Technic Hub
.. automethod:: pybricks.hubs::TechnicHub.light.animate
.. rubric:: Using the IMU
.. automethod:: pybricks.hubs::TechnicHub.imu.up
.. automethod:: pybricks.hubs::TechnicHub.imu.tilt
.. automethod:: pybricks.hubs::TechnicHub.imu.acceleration
.. automethod:: pybricks.hubs::TechnicHub.imu.angular_velocity
.. automethod:: pybricks.hubs::TechnicHub.imu.heading
.. automethod:: pybricks.hubs::TechnicHub.imu.reset_heading
.. rubric:: Using the battery
.. automethod:: pybricks.hubs::TechnicHub.battery.voltage
@@ -78,40 +65,6 @@ Creating light animations
.. literalinclude::
../../../examples/pup/hub_technichub/light_animate.py
IMU examples
---------------
Testing which way is up
********************************
.. literalinclude::
../../../examples/pup/hub_technichub/imu_up.py
Reading the tilt value
********************************
.. literalinclude::
../../../examples/pup/hub_technichub/imu_tilt.py
Using a custom hub orientation
**************************************************
.. literalinclude::
../../../examples/pup/hub_technichub/imu_tilt_blast.py
Reading acceleration and angular velocity vectors
**************************************************
.. literalinclude::
../../../examples/pup/hub_technichub/imu_read_vector.py
Reading acceleration and angular velocity on one axis
*****************************************************
.. literalinclude::
../../../examples/pup/hub_technichub/imu_read_scalar.py
Button and system examples
----------------------------------
Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 KiB

After

Width:  |  Height:  |  Size: 1004 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

+1 -12
View File
@@ -49,16 +49,6 @@ Pybricks Documentation
.. only:: ide
.. note::
**You are using a new beta version of Pybricks!**
This is great for trying the very latest features, but some things
might not work.
If in doubt, use the `latest stable release`_. Please report any
issues via our `support page`_. Thanks!
To begin, install the Pybricks firmware on your hub. Check
`pybricks.com/install`_ to learn how.
@@ -67,7 +57,7 @@ Pybricks Documentation
.. rubric:: Programmable hubs
.. figure:: ../main/images/hubsoverview.png
.. figure:: ../main/images/powereduphubs.png
:width: 100 %
:target: hubs/index.html
@@ -110,7 +100,6 @@ Pybricks Documentation
parameters/index
tools/index
robotics
geometry
signaltypes
.. toctree::
-7
View File
@@ -10,7 +10,6 @@
:hidden:
pupdevice
lwp3device
This module has classes for generic input/output devices.
@@ -19,9 +18,3 @@ This module has classes for generic input/output devices.
.. figure:: ../../main/images/sensor_pup.png
:width: 70 %
:target: pupdevice.html
.. pybricks-classlink:: LWP3Device
.. figure:: ../../main/images/powereduphubs.png
:width: 70 %
:target: lwp3device.html
-15
View File
@@ -26,21 +26,6 @@ Side
.. autoattribute:: pybricks.parameters.Side.RIGHT
:annotation:
Screens or light matrices have only four sides. For those,
``TOP`` is treated the same as ``FRONT``, and ``BOTTOM`` is treated the
same as ``BACK``. The diagrams below define the sides for relevant devices.
**Prime Hub**
.. figure:: ../../main/images/orientation_primehub_label.png
:height: 17 em
**Inventor Hub**
.. figure:: ../../main/images/orientation_inventorhub_label.png
:height: 17 em
**Move Hub**
.. figure:: ../../main/images/orientation_movehub_label.png
+1 -1
View File
@@ -3,7 +3,7 @@
Color Light Matrix
^^^^^^^^^^^^^^^^^^
.. figure:: ../../main/images/color_light_matrix.png
.. figure:: ../../main/images/sensor_colorlightmatrix_label.png
:width: 35 %
.. autoclass:: pybricks.pupdevices.ColorLightMatrix
+3
View File
@@ -25,6 +25,9 @@ Motors without rotation sensors
.. automethod:: pybricks.pupdevices.DCMotor.brake
:noindex:
.. automethod:: pybricks.pupdevices.DCMotor.settings
:noindex:
Examples
-------------------
+2 -2
View File
@@ -79,9 +79,9 @@
.. pybricks-classlink:: ColorLightMatrix
.. figure:: ../../main/images/color_light_matrix.png
.. figure:: ../../main/images/sensor_colorlightmatrix_label.png
:width: 35 %
:target: color-light-matrix.html
:target: colorlightmatrix.html
.. pybricks-classlink:: Light
+2
View File
@@ -70,6 +70,8 @@ Motors with rotation sensors
example, you can change them at the start of your program. Alternatively,
first call :meth:`stop() <pybricks.pupdevices.Motor.stop>`, and then change the settings.
.. automethod:: pybricks.pupdevices.Motor.settings
.. automethod:: pybricks.pupdevices.Motor.control.limits
.. automethod:: pybricks.pupdevices.Motor.control.pid
+2
View File
@@ -22,6 +22,8 @@
.. automethod:: pybricks.robotics.DriveBase.turn
.. automethod:: pybricks.robotics.DriveBase.curve
.. automethod:: pybricks.robotics.DriveBase.settings
.. rubric:: Drive forever
+5
View File
@@ -2,6 +2,11 @@
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
## 2.0.1 - 2021-11-19
### Fixed
- Fixed link to Color Light Matrix page.
## 2.0.0 - 2021-11-19
### Changed
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@pybricks/ide-docs",
"version": "2.0.0",
"version": "2.0.1",
"description": "Special build of Pybricks API docs for embedding in an IDE.",
"repository": {
"type": "git",
+1 -1
View File
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pybricks"
version = "3.1.0rc1"
version = "3.1.0"
description = "Documentation and user-API stubs for Pybricks MicroPython"
authors = ["The Pybricks Authors <dev@pybricks.com>"]
maintainers = ["Laurens Valk <laurens@pybricks.com>", "David Lechner <david@pybricks.com>" ]
+13 -7
View File
@@ -88,6 +88,16 @@ class DCMotor:
is generated while the motor is still moving."""
pass
def settings(self, max_voltage):
"""Configures motor settings. If no arguments are given,
this returns the current values.
Arguments:
max_voltage (:ref:`voltage`):
Maximum voltage applied to the motor during all motor commands.
"""
pass
class Control:
"""Class to interact with PID controller and settings."""
@@ -99,7 +109,7 @@ class Control:
motor this is the number of encoder pulses per degree of rotation.
"""
def limits(self, speed, acceleration, duty, torque):
def limits(self, speed, acceleration, torque):
"""Configures the maximum speed, acceleration, duty, and torque.
If no arguments are given, this will return the current values.
@@ -109,14 +119,12 @@ class Control:
Maximum speed. All speed commands will be capped to this value.
acceleration (:ref:`acceleration` or :ref:`linacceleration`):
Maximum acceleration.
duty (:ref:`percentage`):
Maximum duty cycle during control.
torque (:ref:`torque`):
Maximum feedback torque during control.
"""
pass
def pid(self, kp, ki, kd, integral_range, integral_rate):
def pid(self, kp, ki, kd, reserved, integral_rate):
"""Gets or sets the PID values for position and speed control.
If no arguments are given, this will return the current values.
@@ -130,9 +138,7 @@ class Control:
kd (int): Derivative position (or proportional speed) control
constant. It is the feedback torque per
unit of speed: µNm/(deg/s).
integral_range (:ref:`angle` or :ref:`distance`): Region around
the target angle or distance, in which integral control errors
are accumulated.
reserved: This setting is not used.
integral_rate (:ref:`speed` or :ref:`linspeed`): Maximum rate at
which the error integral is allowed to grow.
"""
+4 -5
View File
@@ -1,10 +1,10 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2020 The Pybricks Authors
# Copyright (c) 2020-2021 The Pybricks Authors
from pybricks.geometry import Matrix, vector
from typing import Collection, Iterable, List, Optional, Tuple, Union, overload
from typing import Collection, Iterable, Optional, Tuple, Union, overload
from .parameters import Button, Color, Direction, Side, Stop, Port, Axis
from .geometry import Axis, Matrix, vector
from .parameters import Button, Color, Direction, Side, Stop, Port
from .media.ev3dev import SoundFile
class DCMotor:
@@ -32,7 +32,6 @@ class Control:
kp: Optional[int] = None,
ki: Optional[int] = None,
kd: Optional[int] = None,
integral_range: Optional[int] = None,
integral_rate: Optional[int] = None,
) -> None: ...
@overload
+34 -17
View File
@@ -1,10 +1,12 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2018-2020 The Pybricks Authors
# Copyright (c) 2018-2021 The Pybricks Authors
"""Robotics module for the Pybricks API."""
from ._common import Control as _Control
from .parameters import Stop as _Stop
class DriveBase:
"""A robotic vehicle with two powered wheels and an optional support
@@ -14,7 +16,7 @@ class DriveBase:
makes it easy to drive a given distance in millimeters or turn by a given
number of degrees.
**Positive** distances and drive speeds mean
**Positive** distances, radii, or drive speeds mean
driving **forward**. **Negative** means **backward**.
**Positive** angles and turn rates mean turning **right**.
@@ -98,10 +100,11 @@ class DriveBase:
"""Resets the estimated driven distance and angle to 0."""
pass
def settings(self, straight_speed, straight_acceleration, turn_rate,
turn_acceleration):
def settings(
self, straight_speed, straight_acceleration, turn_rate, turn_acceleration
):
"""Configures the speed and acceleration used
by :meth:`.straight` and :meth:`.turn`.
by :meth:`.straight`, :meth:`.turn`, and :meth:`.curve`.
If you give no arguments, this returns the current values as a tuple.
@@ -109,31 +112,45 @@ class DriveBase:
either before you begin driving or after you call :meth:`.stop`.
Arguments:
straight_speed (:ref:`linspeed`): Speed of the robot during
:meth:`.straight`.
straight_acceleration (:ref:`linacceleration`): Acceleration and
deceleration of the robot at the start and end
of :meth:`.straight`.
turn_rate (:ref:`speed`): Turn rate of the robot
during :meth:`.turn`.
straight_speed (:ref:`linspeed`): Straight-line speed of the robot.
straight_acceleration (:ref:`linacceleration`): Straight-line
acceleration and deceleration of the robot.
turn_rate (:ref:`speed`): Turn rate of the robot.
turn_acceleration (:ref:`acceleration`): Angular acceleration and
deceleration of the robot at the start and end
of :meth:`.turn`.
deceleration of the robot.
"""
pass
def straight(self, distance):
def straight(self, distance, then=_Stop.HOLD, wait=True):
"""Drives straight for a given distance and then stops.
Arguments:
distance (:ref:`distance`): Distance to travel.
distance (:ref:`distance`): Distance to travel
then (Stop): What to do after coming to a standstill.
wait (bool): Wait for the maneuver to complete before continuing
with the rest of the program.
"""
pass
def turn(self, angle):
def turn(self, angle, then=_Stop.HOLD, wait=True):
"""Turns in place by a given angle and then stops.
Arguments:
angle (:ref:`angle`): Angle of the turn.
then (Stop): What to do after coming to a standstill.
wait (bool): Wait for the maneuver to complete before continuing
with the rest of the program.
"""
pass
def curve(self, radius, angle, then=_Stop.HOLD, wait=True):
"""Drives an arc along a circle of a given radius, by a given angle.
Arguments:
radius (:ref:`dimension`): Radius of the circle.
angle (:ref:`angle`): Angle along the circle.
then (Stop): What to do after coming to a standstill.
wait (bool): Wait for the maneuver to complete before continuing
with the rest of the program.
"""
pass
+6 -1
View File
@@ -1,8 +1,10 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2020 The Pybricks Authors
# Copyright (c) 2020-2021 The Pybricks Authors
from typing import Optional, Tuple, overload, Union
from ._common import Control, Motor
from .parameters import Stop
class DriveBase:
distance_control: Control
@@ -32,3 +34,6 @@ class DriveBase:
) -> None: ...
def straight(self, distance: int) -> None: ...
def turn(self, angle: int) -> None: ...
def curve(
self, radius: int, angle: int, then: Stop = Stop.HOLD, wait: bool = True
) -> None: ...