scirodev 0.5.4__tar.gz → 0.5.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {scirodev-0.5.4/scirodev.egg-info → scirodev-0.5.5}/PKG-INFO +1 -1
- {scirodev-0.5.4 → scirodev-0.5.5}/pyproject.toml +1 -1
- {scirodev-0.5.4 → scirodev-0.5.5}/sciro/robotics.py +59 -4
- {scirodev-0.5.4 → scirodev-0.5.5/scirodev.egg-info}/PKG-INFO +1 -1
- {scirodev-0.5.4 → scirodev-0.5.5}/LICENSE +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/README.md +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/sciro/__init__.py +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/sciro/_common.py +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/sciro/floorpro.py +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/sciro/hubs.py +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/sciro/iodevices.py +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/sciro/parameters.py +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/sciro/pump.py +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/sciro/py.typed +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/sciro/tools.py +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/scirodev/__init__.py +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/scirodev/cli.py +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/scirodev.egg-info/SOURCES.txt +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/scirodev.egg-info/dependency_links.txt +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/scirodev.egg-info/entry_points.txt +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/scirodev.egg-info/requires.txt +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/scirodev.egg-info/top_level.txt +0 -0
- {scirodev-0.5.4 → scirodev-0.5.5}/setup.cfg +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scirodev"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.5"
|
|
8
8
|
description = "PeakHub / sciro extensions to Pybricks: typed API stubs (sciro.*) and hub tooling on top of pybricksdev"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -73,19 +73,74 @@ class DriveBase(_DriveBase):
|
|
|
73
73
|
upstream meaning: continue at the drive speed.
|
|
74
74
|
"""
|
|
75
75
|
|
|
76
|
+
def turn( # type: ignore[override]
|
|
77
|
+
self,
|
|
78
|
+
angle: Number,
|
|
79
|
+
then: Stop = Stop.HOLD,
|
|
80
|
+
wait: bool = True,
|
|
81
|
+
absolute: bool = False,
|
|
82
|
+
turn_rate: Optional[Number] = None,
|
|
83
|
+
) -> MaybeAwaitable:
|
|
84
|
+
"""turn(angle, then=Stop.HOLD, wait=True, absolute=False, turn_rate=None)
|
|
85
|
+
|
|
86
|
+
Turns in place, as in Pybricks, with one PeakHub extension:
|
|
87
|
+
|
|
88
|
+
``turn_rate``: turn rate in deg/s for this move only; ``None`` uses the
|
|
89
|
+
``turn_rate`` setting, which is left untouched either way.
|
|
90
|
+
|
|
91
|
+
``absolute=True`` turns *to* the given heading rather than *by* it,
|
|
92
|
+
taking the nearest whole-turn equivalent, so the correction is always
|
|
93
|
+
within +/-180 degrees (the same rule as ``straight(heading=)``).
|
|
94
|
+
"""
|
|
95
|
+
|
|
76
96
|
def curve(
|
|
77
97
|
self,
|
|
78
98
|
radius: Number,
|
|
79
99
|
angle: Number,
|
|
80
100
|
then: Stop = Stop.HOLD,
|
|
81
101
|
wait: bool = True,
|
|
102
|
+
speed: Optional[Number] = None,
|
|
103
|
+
exit_speed: Number = 0,
|
|
82
104
|
) -> MaybeAwaitable:
|
|
83
|
-
"""curve(radius, angle, then=Stop.HOLD, wait=True)
|
|
105
|
+
"""curve(radius, angle, then=Stop.HOLD, wait=True, speed=None, exit_speed=0)
|
|
84
106
|
|
|
85
107
|
Drives an arc of ``angle`` degrees along a circle of ``radius`` mm.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
108
|
+
Upstream dropped this method in favour of :meth:`arc`, but the firmware
|
|
109
|
+
still has it, so it is declared here to keep it usable without a type
|
|
110
|
+
error. ``arc()`` takes the same extensions and is preferred in new code.
|
|
111
|
+
|
|
112
|
+
``speed``: drive speed in mm/s along the arc for this move only. The
|
|
113
|
+
matching turn rate is derived from it, so the linear speed is what
|
|
114
|
+
governs the duration; ``None`` uses the ``straight_speed`` and
|
|
115
|
+
``turn_rate`` settings.
|
|
116
|
+
|
|
117
|
+
``exit_speed``: speed in mm/s the robot has when it reaches the end of
|
|
118
|
+
the arc. The *turn rate is brought to zero* at that point, so the robot
|
|
119
|
+
leaves on the tangent and keeps driving straight at ``exit_speed``
|
|
120
|
+
until the next command. This makes a curve-to-straight handover smooth;
|
|
121
|
+
without it a continuing move keeps rotating at the arc's turn rate and
|
|
122
|
+
the next command has to cancel that rotation. The price is that the
|
|
123
|
+
last fraction of the path is slightly flatter than a true arc. Implies
|
|
124
|
+
``then=Stop.NONE``; any other explicit ``then`` raises ``ValueError``.
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
def arc( # type: ignore[override]
|
|
128
|
+
self,
|
|
129
|
+
radius: Number,
|
|
130
|
+
angle: Optional[Number] = None,
|
|
131
|
+
distance: Optional[Number] = None,
|
|
132
|
+
then: Stop = Stop.HOLD,
|
|
133
|
+
wait: bool = True,
|
|
134
|
+
speed: Optional[Number] = None,
|
|
135
|
+
exit_speed: Number = 0,
|
|
136
|
+
) -> MaybeAwaitable:
|
|
137
|
+
"""arc(radius, angle=None, distance=None, then=Stop.HOLD, wait=True, speed=None, exit_speed=0)
|
|
138
|
+
|
|
139
|
+
Drives an arc, as in Pybricks, with the same two PeakHub extensions as
|
|
140
|
+
:meth:`curve`: ``speed`` in mm/s for this move only (the turn rate is
|
|
141
|
+
derived from it), and ``exit_speed``, which ends the arc at that speed
|
|
142
|
+
with the turn rate at zero so the robot exits on the tangent and keeps
|
|
143
|
+
driving straight. ``exit_speed`` implies ``then=Stop.NONE``.
|
|
89
144
|
"""
|
|
90
145
|
|
|
91
146
|
def heading_target(self, angle: Optional[Number] = None) -> Optional[float]:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|