Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd77c548d2 | ||
|
|
022afabd30 | ||
|
|
ce17123325 | ||
|
|
f2346df4e5 | ||
|
|
94c659ba6d | ||
|
|
9c0298bad0 | ||
|
|
602b21fe9d | ||
|
|
30803fc017 | ||
|
|
749eceefc4 | ||
|
|
57f6f0fbef | ||
|
|
e061617c34 | ||
|
|
eb09ecd7c7 | ||
|
|
06a1542613 | ||
|
|
82a8f2ae89 | ||
|
|
7d0fe9cb85 | ||
|
|
1af876ac8f |
@@ -2,10 +2,19 @@
|
|||||||
|
|
||||||
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
|
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
|
||||||
|
|
||||||
## Unreleased
|
## 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
|
||||||
- Fixed link to Color Light Matrix page.
|
- Fixed link to Color Light Matrix page.
|
||||||
|
- Fixed link to Inventor Hub page.
|
||||||
|
|
||||||
## 3.1.0rc1 - 2021-11-19
|
## 3.1.0rc1 - 2021-11-19
|
||||||
|
|
||||||
|
|||||||
@@ -265,11 +265,14 @@ latex_documents = [
|
|||||||
exclude_patterns = [
|
exclude_patterns = [
|
||||||
'ev3devices.rst',
|
'ev3devices.rst',
|
||||||
'hubs/ev3brick.rst',
|
'hubs/ev3brick.rst',
|
||||||
|
'hubs/primehub.rst',
|
||||||
|
'geometry.rst',
|
||||||
'iodevices/analogsensor.rst',
|
'iodevices/analogsensor.rst',
|
||||||
'iodevices/dcmotor.rst',
|
'iodevices/dcmotor.rst',
|
||||||
'iodevices/ev3devsensor.rst',
|
'iodevices/ev3devsensor.rst',
|
||||||
'iodevices/i2cdevice.rst',
|
'iodevices/i2cdevice.rst',
|
||||||
'iodevices/lumpdevice.rst',
|
'iodevices/lumpdevice.rst',
|
||||||
|
'iodevices/lwp3device.rst',
|
||||||
'iodevices/uartdevice.rst',
|
'iodevices/uartdevice.rst',
|
||||||
'media.rst',
|
'media.rst',
|
||||||
'messaging.rst',
|
'messaging.rst',
|
||||||
|
|||||||
@@ -5,13 +5,15 @@ from docutils.parsers.rst import Directive
|
|||||||
class PybricksClasslinkDirective(Directive):
|
class PybricksClasslinkDirective(Directive):
|
||||||
|
|
||||||
required_arguments = 1
|
required_arguments = 1
|
||||||
|
optional_arguments = 1
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# Get link name from sphinx-directive
|
# Get link and name from sphinx-directive
|
||||||
name = self.arguments[0]
|
name = self.arguments[0]
|
||||||
|
link = name if len(self.arguments) == 1 else self.arguments[1]
|
||||||
|
|
||||||
html = (
|
html = (
|
||||||
'<a href="{0}.html">'.format(name.lower()) +
|
'<a href="{0}.html">'.format(link.lower()) +
|
||||||
'<dl class="py class">' +
|
'<dl class="py class">' +
|
||||||
'<dt>' +
|
'<dt>' +
|
||||||
'<em class="property">class </em>' +
|
'<em class="property">class </em>' +
|
||||||
|
|||||||
@@ -3,11 +3,12 @@
|
|||||||
0 !LICENSE MIT
|
0 !LICENSE MIT
|
||||||
0 ROTATION CENTER 0 0 0 1 "Custom"
|
0 ROTATION CENTER 0 0 0 1 "Custom"
|
||||||
0 ROTATION CONFIG 0 0
|
0 ROTATION CONFIG 0 0
|
||||||
1 15 430 -96 190 0 0 1 1 0 0 0 1 0 54675c01.dat
|
1 15 450 -76 -20 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 15 -30 -76 280 0 0 1 1 0 0 0 1 0 68488c01.dat
|
||||||
1 322 430 -72 30 0 0 1 1 0 0 0 1 0 54696c01.dat
|
1 71 550 -76 200 0 0 1 1 0 0 0 1 0 69730c01.dat
|
||||||
1 71 430 -72 -180 0 0 1 1 0 0 0 1 0 54696c01.dat
|
1 15 180 -72 140 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 15 260 -72 350 0 0 1 1 0 0 0 1 0 54696p02c01.dat
|
||||||
1 71 -20 -216 -140 1 0 0 0 1 0 0 0 1 22172c01.dat
|
1 71 430 -84 470 1 0 0 0 1 0 0 0 1 22169c01.dat
|
||||||
1 15 120 -320 160 1 0 0 0 1 0 0 0 1 26913c01.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
|
0
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 866 KiB After Width: | Height: | Size: 860 KiB |
@@ -11,8 +11,8 @@
|
|||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
width="2000"
|
width="2000"
|
||||||
height="1118"
|
height="1126"
|
||||||
viewBox="0 0 529.16666 295.80416"
|
viewBox="0 0 529.16666 297.92083"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
id="svg8"
|
id="svg8"
|
||||||
inkscape:version="0.92.3 (2405546, 2018-03-11)"
|
inkscape:version="0.92.3 (2405546, 2018-03-11)"
|
||||||
@@ -58,8 +58,8 @@
|
|||||||
inkscape:pageopacity="0.0"
|
inkscape:pageopacity="0.0"
|
||||||
inkscape:pageshadow="2"
|
inkscape:pageshadow="2"
|
||||||
inkscape:zoom="0.35"
|
inkscape:zoom="0.35"
|
||||||
inkscape:cx="619.19211"
|
inkscape:cx="930.75599"
|
||||||
inkscape:cy="823.24691"
|
inkscape:cy="703.45816"
|
||||||
inkscape:document-units="mm"
|
inkscape:document-units="mm"
|
||||||
inkscape:current-layer="layer1"
|
inkscape:current-layer="layer1"
|
||||||
showgrid="false"
|
showgrid="false"
|
||||||
@@ -87,18 +87,18 @@
|
|||||||
inkscape:label="Layer 1"
|
inkscape:label="Layer 1"
|
||||||
inkscape:groupmode="layer"
|
inkscape:groupmode="layer"
|
||||||
id="layer1"
|
id="layer1"
|
||||||
transform="translate(0,-1.1958167)">
|
transform="translate(0,0.92084997)">
|
||||||
<image
|
<image
|
||||||
sodipodi:absref="pupmotors.png"
|
sodipodi:absref="pupmotors.png"
|
||||||
xlink:href="pupmotors.png"
|
xlink:href="pupmotors.png"
|
||||||
width="529.16669"
|
y="-0.92085403"
|
||||||
height="295.80417"
|
x="0"
|
||||||
|
id="image876"
|
||||||
preserveAspectRatio="none"
|
preserveAspectRatio="none"
|
||||||
id="image853"
|
height="297.92084"
|
||||||
x="-2.220446e-16"
|
width="529.16669" />
|
||||||
y="1.1958181" />
|
|
||||||
<g
|
<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">
|
id="g2717">
|
||||||
<g
|
<g
|
||||||
transform="matrix(1,-0.27773651,0,1,59.387949,102.27922)"
|
transform="matrix(1,-0.27773651,0,1,59.387949,102.27922)"
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
</g>
|
</g>
|
||||||
<g
|
<g
|
||||||
id="g2727"
|
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
|
<g
|
||||||
style="fill:#2980b9;fill-opacity:1;stroke:#fffbfb;stroke-width:0.13229167;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#2980b9;fill-opacity:1;stroke:#fffbfb;stroke-width:0.13229167;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
id="g2721"
|
id="g2721"
|
||||||
@@ -147,7 +147,7 @@
|
|||||||
sodipodi:nodetypes="ccccsc" />
|
sodipodi:nodetypes="ccccsc" />
|
||||||
</g>
|
</g>
|
||||||
<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">
|
id="g2747">
|
||||||
<g
|
<g
|
||||||
transform="matrix(1,-0.27773651,0,1,61.231459,102.02783)"
|
transform="matrix(1,-0.27773651,0,1,61.231459,102.02783)"
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
</g>
|
</g>
|
||||||
<g
|
<g
|
||||||
id="g2757"
|
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
|
<g
|
||||||
style="fill:#2980b9;fill-opacity:1;stroke:#fffbfb;stroke-width:0.13229167;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#2980b9;fill-opacity:1;stroke:#fffbfb;stroke-width:0.13229167;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
id="g2751"
|
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" />
|
style="fill:#2980b9;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||||
</g>
|
</g>
|
||||||
<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">
|
id="g2767">
|
||||||
<g
|
<g
|
||||||
transform="matrix(1,-0.27773651,0,1,59.387949,102.27922)"
|
transform="matrix(1,-0.27773651,0,1,59.387949,102.27922)"
|
||||||
@@ -221,7 +221,7 @@
|
|||||||
</g>
|
</g>
|
||||||
<g
|
<g
|
||||||
id="g874"
|
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
|
<g
|
||||||
style="fill:#2980b9;fill-opacity:1;stroke:#fffbfb;stroke-width:0.13229167;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#2980b9;fill-opacity:1;stroke:#fffbfb;stroke-width:0.13229167;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
id="g868"
|
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" />
|
style="fill:#2980b9;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||||
</g>
|
</g>
|
||||||
<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">
|
id="g884">
|
||||||
<g
|
<g
|
||||||
transform="matrix(1,-0.27773651,0,1,59.387949,102.27922)"
|
transform="matrix(1,-0.27773651,0,1,59.387949,102.27922)"
|
||||||
@@ -275,5 +275,29 @@
|
|||||||
rx="1.295833"
|
rx="1.295833"
|
||||||
ry="1.1623898"
|
ry="1.1623898"
|
||||||
transform="matrix(0.89702138,0.44198716,0,1,0,0)" />
|
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>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 25 KiB |
@@ -1,7 +1,8 @@
|
|||||||
0 Name: pupmotors
|
0 Name: pupsensors.ldr
|
||||||
0 Author: Pybricks {laurens@pybricks.com}
|
0 Author: Pybricks {laurens@pybricks.com}
|
||||||
0 !LICENSE MIT
|
0 !LICENSE MIT
|
||||||
0 !LDCAD GROUP_DEF [topLevel=true] [LID=0] [GID=9FDP9pj0O55] [name=Group 1] [center=0 0 0]
|
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 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 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
|
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 |
|
After Width: | Height: | Size: 58 KiB |
@@ -12,7 +12,6 @@
|
|||||||
movehub
|
movehub
|
||||||
cityhub
|
cityhub
|
||||||
technichub
|
technichub
|
||||||
primehub
|
|
||||||
|
|
||||||
.. pybricks-classlink:: MoveHub
|
.. pybricks-classlink:: MoveHub
|
||||||
|
|
||||||
@@ -31,16 +30,3 @@
|
|||||||
.. figure:: ../../main/images/technichub.png
|
.. figure:: ../../main/images/technichub.png
|
||||||
:height: 10 em
|
:height: 10 em
|
||||||
:target: technichub.html
|
: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
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ Technic Hub
|
|||||||
.. figure:: ../../main/images/technichub.png
|
.. figure:: ../../main/images/technichub.png
|
||||||
:height: 15 em
|
:height: 15 em
|
||||||
|
|
||||||
.. autoclass:: pybricks.hubs.TechnicHub
|
.. class:: TechnicHub
|
||||||
:no-members:
|
|
||||||
|
LEGO® Technic Hub.
|
||||||
|
|
||||||
.. rubric:: Using the hub status light
|
.. rubric:: Using the hub status light
|
||||||
|
|
||||||
@@ -19,20 +20,6 @@ Technic Hub
|
|||||||
|
|
||||||
.. automethod:: pybricks.hubs::TechnicHub.light.animate
|
.. 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
|
.. rubric:: Using the battery
|
||||||
|
|
||||||
.. automethod:: pybricks.hubs::TechnicHub.battery.voltage
|
.. automethod:: pybricks.hubs::TechnicHub.battery.voltage
|
||||||
@@ -78,40 +65,6 @@ Creating light animations
|
|||||||
.. literalinclude::
|
.. literalinclude::
|
||||||
../../../examples/pup/hub_technichub/light_animate.py
|
../../../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
|
Button and system examples
|
||||||
----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 1009 KiB After Width: | Height: | Size: 1004 KiB |
|
After Width: | Height: | Size: 67 KiB |
@@ -49,16 +49,6 @@ Pybricks Documentation
|
|||||||
|
|
||||||
.. only:: ide
|
.. 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
|
To begin, install the Pybricks firmware on your hub. Check
|
||||||
`pybricks.com/install`_ to learn how.
|
`pybricks.com/install`_ to learn how.
|
||||||
|
|
||||||
@@ -67,7 +57,7 @@ Pybricks Documentation
|
|||||||
|
|
||||||
.. rubric:: Programmable hubs
|
.. rubric:: Programmable hubs
|
||||||
|
|
||||||
.. figure:: ../main/images/hubsoverview.png
|
.. figure:: ../main/images/powereduphubs.png
|
||||||
:width: 100 %
|
:width: 100 %
|
||||||
:target: hubs/index.html
|
:target: hubs/index.html
|
||||||
|
|
||||||
@@ -110,7 +100,6 @@ Pybricks Documentation
|
|||||||
parameters/index
|
parameters/index
|
||||||
tools/index
|
tools/index
|
||||||
robotics
|
robotics
|
||||||
geometry
|
|
||||||
signaltypes
|
signaltypes
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
:hidden:
|
:hidden:
|
||||||
|
|
||||||
pupdevice
|
pupdevice
|
||||||
lwp3device
|
|
||||||
|
|
||||||
This module has classes for generic input/output devices.
|
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
|
.. figure:: ../../main/images/sensor_pup.png
|
||||||
:width: 70 %
|
:width: 70 %
|
||||||
:target: pupdevice.html
|
:target: pupdevice.html
|
||||||
|
|
||||||
.. pybricks-classlink:: LWP3Device
|
|
||||||
|
|
||||||
.. figure:: ../../main/images/powereduphubs.png
|
|
||||||
:width: 70 %
|
|
||||||
:target: lwp3device.html
|
|
||||||
|
|||||||
@@ -26,21 +26,6 @@ Side
|
|||||||
.. autoattribute:: pybricks.parameters.Side.RIGHT
|
.. autoattribute:: pybricks.parameters.Side.RIGHT
|
||||||
:annotation:
|
: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**
|
**Move Hub**
|
||||||
|
|
||||||
.. figure:: ../../main/images/orientation_movehub_label.png
|
.. figure:: ../../main/images/orientation_movehub_label.png
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Color Light Matrix
|
Color Light Matrix
|
||||||
^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. figure:: ../../main/images/color_light_matrix.png
|
.. figure:: ../../main/images/sensor_colorlightmatrix_label.png
|
||||||
:width: 35 %
|
:width: 35 %
|
||||||
|
|
||||||
.. autoclass:: pybricks.pupdevices.ColorLightMatrix
|
.. autoclass:: pybricks.pupdevices.ColorLightMatrix
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ Motors without rotation sensors
|
|||||||
.. automethod:: pybricks.pupdevices.DCMotor.brake
|
.. automethod:: pybricks.pupdevices.DCMotor.brake
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
.. automethod:: pybricks.pupdevices.DCMotor.settings
|
||||||
|
:noindex:
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
.. pybricks-classlink:: ColorLightMatrix
|
.. pybricks-classlink:: ColorLightMatrix
|
||||||
|
|
||||||
.. figure:: ../../main/images/color_light_matrix.png
|
.. figure:: ../../main/images/sensor_colorlightmatrix_label.png
|
||||||
:width: 35 %
|
:width: 35 %
|
||||||
:target: colorlightmatrix.html
|
:target: colorlightmatrix.html
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ Motors with rotation sensors
|
|||||||
example, you can change them at the start of your program. Alternatively,
|
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.
|
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.limits
|
||||||
|
|
||||||
.. automethod:: pybricks.pupdevices.Motor.control.pid
|
.. automethod:: pybricks.pupdevices.Motor.control.pid
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
.. automethod:: pybricks.robotics.DriveBase.turn
|
.. automethod:: pybricks.robotics.DriveBase.turn
|
||||||
|
|
||||||
|
.. automethod:: pybricks.robotics.DriveBase.curve
|
||||||
|
|
||||||
.. automethod:: pybricks.robotics.DriveBase.settings
|
.. automethod:: pybricks.robotics.DriveBase.settings
|
||||||
|
|
||||||
.. rubric:: Drive forever
|
.. rubric:: Drive forever
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "pybricks"
|
name = "pybricks"
|
||||||
version = "3.1.0rc1"
|
version = "3.1.0"
|
||||||
description = "Documentation and user-API stubs for Pybricks MicroPython"
|
description = "Documentation and user-API stubs for Pybricks MicroPython"
|
||||||
authors = ["The Pybricks Authors <dev@pybricks.com>"]
|
authors = ["The Pybricks Authors <dev@pybricks.com>"]
|
||||||
maintainers = ["Laurens Valk <laurens@pybricks.com>", "David Lechner <david@pybricks.com>" ]
|
maintainers = ["Laurens Valk <laurens@pybricks.com>", "David Lechner <david@pybricks.com>" ]
|
||||||
|
|||||||
@@ -88,6 +88,16 @@ class DCMotor:
|
|||||||
is generated while the motor is still moving."""
|
is generated while the motor is still moving."""
|
||||||
pass
|
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 Control:
|
||||||
"""Class to interact with PID controller and settings."""
|
"""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.
|
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.
|
"""Configures the maximum speed, acceleration, duty, and torque.
|
||||||
|
|
||||||
If no arguments are given, this will return the current values.
|
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.
|
Maximum speed. All speed commands will be capped to this value.
|
||||||
acceleration (:ref:`acceleration` or :ref:`linacceleration`):
|
acceleration (:ref:`acceleration` or :ref:`linacceleration`):
|
||||||
Maximum acceleration.
|
Maximum acceleration.
|
||||||
duty (:ref:`percentage`):
|
|
||||||
Maximum duty cycle during control.
|
|
||||||
torque (:ref:`torque`):
|
torque (:ref:`torque`):
|
||||||
Maximum feedback torque during control.
|
Maximum feedback torque during control.
|
||||||
"""
|
"""
|
||||||
pass
|
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.
|
"""Gets or sets the PID values for position and speed control.
|
||||||
|
|
||||||
If no arguments are given, this will return the current values.
|
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
|
kd (int): Derivative position (or proportional speed) control
|
||||||
constant. It is the feedback torque per
|
constant. It is the feedback torque per
|
||||||
unit of speed: µNm/(deg/s).
|
unit of speed: µNm/(deg/s).
|
||||||
integral_range (:ref:`angle` or :ref:`distance`): Region around
|
reserved: This setting is not used.
|
||||||
the target angle or distance, in which integral control errors
|
|
||||||
are accumulated.
|
|
||||||
integral_rate (:ref:`speed` or :ref:`linspeed`): Maximum rate at
|
integral_rate (:ref:`speed` or :ref:`linspeed`): Maximum rate at
|
||||||
which the error integral is allowed to grow.
|
which the error integral is allowed to grow.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# SPDX-License-Identifier: MIT
|
# 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, Optional, Tuple, Union, overload
|
||||||
from typing import Collection, Iterable, List, 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
|
from .media.ev3dev import SoundFile
|
||||||
|
|
||||||
class DCMotor:
|
class DCMotor:
|
||||||
@@ -32,7 +32,6 @@ class Control:
|
|||||||
kp: Optional[int] = None,
|
kp: Optional[int] = None,
|
||||||
ki: Optional[int] = None,
|
ki: Optional[int] = None,
|
||||||
kd: Optional[int] = None,
|
kd: Optional[int] = None,
|
||||||
integral_range: Optional[int] = None,
|
|
||||||
integral_rate: Optional[int] = None,
|
integral_rate: Optional[int] = None,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@overload
|
@overload
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
# Copyright (c) 2018-2020 The Pybricks Authors
|
# Copyright (c) 2018-2021 The Pybricks Authors
|
||||||
|
|
||||||
"""Robotics module for the Pybricks API."""
|
"""Robotics module for the Pybricks API."""
|
||||||
|
|
||||||
from ._common import Control as _Control
|
from ._common import Control as _Control
|
||||||
|
|
||||||
|
from .parameters import Stop as _Stop
|
||||||
|
|
||||||
|
|
||||||
class DriveBase:
|
class DriveBase:
|
||||||
"""A robotic vehicle with two powered wheels and an optional support
|
"""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
|
makes it easy to drive a given distance in millimeters or turn by a given
|
||||||
number of degrees.
|
number of degrees.
|
||||||
|
|
||||||
**Positive** distances and drive speeds mean
|
**Positive** distances, radii, or drive speeds mean
|
||||||
driving **forward**. **Negative** means **backward**.
|
driving **forward**. **Negative** means **backward**.
|
||||||
|
|
||||||
**Positive** angles and turn rates mean turning **right**.
|
**Positive** angles and turn rates mean turning **right**.
|
||||||
@@ -98,10 +100,11 @@ class DriveBase:
|
|||||||
"""Resets the estimated driven distance and angle to 0."""
|
"""Resets the estimated driven distance and angle to 0."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def settings(self, straight_speed, straight_acceleration, turn_rate,
|
def settings(
|
||||||
turn_acceleration):
|
self, straight_speed, straight_acceleration, turn_rate, turn_acceleration
|
||||||
|
):
|
||||||
"""Configures the speed and acceleration used
|
"""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.
|
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`.
|
either before you begin driving or after you call :meth:`.stop`.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
straight_speed (:ref:`linspeed`): Speed of the robot during
|
straight_speed (:ref:`linspeed`): Straight-line speed of the robot.
|
||||||
:meth:`.straight`.
|
straight_acceleration (:ref:`linacceleration`): Straight-line
|
||||||
straight_acceleration (:ref:`linacceleration`): Acceleration and
|
acceleration and deceleration of the robot.
|
||||||
deceleration of the robot at the start and end
|
turn_rate (:ref:`speed`): Turn rate of the robot.
|
||||||
of :meth:`.straight`.
|
|
||||||
turn_rate (:ref:`speed`): Turn rate of the robot
|
|
||||||
during :meth:`.turn`.
|
|
||||||
turn_acceleration (:ref:`acceleration`): Angular acceleration and
|
turn_acceleration (:ref:`acceleration`): Angular acceleration and
|
||||||
deceleration of the robot at the start and end
|
deceleration of the robot.
|
||||||
of :meth:`.turn`.
|
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def straight(self, distance):
|
def straight(self, distance, then=_Stop.HOLD, wait=True):
|
||||||
"""Drives straight for a given distance and then stops.
|
"""Drives straight for a given distance and then stops.
|
||||||
|
|
||||||
Arguments:
|
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
|
pass
|
||||||
|
|
||||||
def turn(self, angle):
|
def turn(self, angle, then=_Stop.HOLD, wait=True):
|
||||||
"""Turns in place by a given angle and then stops.
|
"""Turns in place by a given angle and then stops.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
angle (:ref:`angle`): Angle of the turn.
|
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
|
pass
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
# SPDX-License-Identifier: MIT
|
# 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 typing import Optional, Tuple, overload, Union
|
||||||
|
|
||||||
from ._common import Control, Motor
|
from ._common import Control, Motor
|
||||||
|
from .parameters import Stop
|
||||||
|
|
||||||
class DriveBase:
|
class DriveBase:
|
||||||
distance_control: Control
|
distance_control: Control
|
||||||
@@ -32,3 +34,6 @@ class DriveBase:
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def straight(self, distance: int) -> None: ...
|
def straight(self, distance: int) -> None: ...
|
||||||
def turn(self, angle: int) -> None: ...
|
def turn(self, angle: int) -> None: ...
|
||||||
|
def curve(
|
||||||
|
self, radius: int, angle: int, then: Stop = Stop.HOLD, wait: bool = True
|
||||||
|
) -> None: ...
|
||||||
|
|||||||