Skip to content

Commit 9cde749

Browse files
committed
pybricks.geometry: Drop module.
See pybricks/pybricks-micropython#160
1 parent 8bca5eb commit 9cde749

File tree

19 files changed

+201
-213
lines changed

19 files changed

+201
-213
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
### Changed
1616
- Change implementation status of `IMU.heading` and `IMU.reset_heading`. They
1717
are now implemented, with some limitations as noted in a note box.
18+
- Moved `Matrix` and `vector` from `pybricks.geometry` to `pybricks.tools`.
19+
- Moved `Axis` from `pybricks.geometry` to `pybricks.parameters`.
20+
21+
### Removed
22+
- Removed `pybricks.geometry` module.
23+
24+
### Changed
1825

1926
## 3.2.0 - 2022-12-20
2027

doc/common/extensions/requirements-static.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
# Medium feature set.
1212
FEATURES_MEDIUM = FEATURES_SMALL | {
13-
"pybricks-geometry",
1413
"pybricks-common-control",
1514
"pybricks-iodevices",
1615
"stm32-extra",

doc/main/geometry.rst

Lines changed: 0 additions & 51 deletions
This file was deleted.

doc/main/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ above to reveal this menu.
6060
parameters/index
6161
tools/index
6262
robotics
63-
geometry
6463
signaltypes
6564

6665
.. toctree::

doc/main/parameters/axis.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.. pybricks-requirements:: stm32-float
2+
3+
Axis
4+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5+
6+
.. autoclass:: pybricks.parameters.Axis
7+
:no-members:

doc/main/parameters/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
:maxdepth: 1
1111
:hidden:
1212

13+
axis
1314
button
1415
color
1516
direction
@@ -18,6 +19,8 @@
1819
side
1920
stop
2021

22+
.. pybricks-classlink:: Axis
23+
2124
.. pybricks-classlink:: Button
2225

2326
.. pybricks-classlink:: Color

doc/main/signaltypes.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,3 +260,36 @@ Fahrenheit (°F) or Kelvin (K), you can use the following conversion formulas:
260260
hue: deg
261261
--------------
262262
Hue of a color (0-359 degrees).
263+
264+
.. _robotframe:
265+
266+
Reference frames
267+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
268+
269+
The Pybricks module and this documentation use the following conventions:
270+
271+
- X: Positive means forward. Negative means backward.
272+
- Y: Positive means to the left. Negative means to the right.
273+
- Z: Positive means upward. Negative means downward.
274+
275+
To make sure that all hub measurements (such as acceleration) have the correct
276+
value and sign, you can specify how the hub is mounted in your creation. This
277+
adjust the measurements so that it is easy to see how your *robot* is moving,
278+
rather than how the *hub* is moving.
279+
280+
For example, the hub may be mounted upside down in your design. If you
281+
configure the settings as shown in :numref:`fig_imuexamples`, the hub
282+
measurements will be adjusted accordingly. This way, a positive acceleration
283+
value in the X direction means that your *robot* accelerates forward, even
284+
though the *hub* accelerates backward.
285+
286+
.. _fig_imuexamples:
287+
288+
.. figure:: ../main/diagrams/imuexamples.png
289+
:width: 100 %
290+
291+
How to configure the ``top_side`` and ``front_side`` settings for three
292+
different robot designs. The same technique can be applied to other hubs
293+
and other creations, by noting which way the top and
294+
front :class:`Side <Side>` of the hub are pointing. The example
295+
on the left is the default configuration.

doc/main/tools/index.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,15 @@
1919

2020
.. automethod:: pybricks.tools.StopWatch.reset
2121

22+
.. pybricks-requirements:: stm32-float
23+
24+
.. autoclass:: pybricks.tools.Matrix
25+
:no-members:
26+
27+
.. autoattribute:: pybricks.tools::Matrix.T
28+
29+
.. autoattribute:: pybricks.tools::Matrix.shape
30+
31+
.. pybricks-requirements:: stm32-float
32+
33+
.. autofunction:: pybricks.tools.vector

examples/pup/hub_common/imu_read_scalar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ThisHub = TechnicHub PrimeHub EssentialHub
22
from pybricks.hubs import ThisHub
33
from pybricks.tools import wait
4-
from pybricks.geometry import Axis
4+
from pybricks.parameters import Axis
55

66
# Initialize the hub.
77
hub = ThisHub()

examples/pup/hub_common/imu_tilt_blast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ThisHub = TechnicHub PrimeHub EssentialHub
22
from pybricks.hubs import ThisHub
33
from pybricks.tools import wait
4-
from pybricks.geometry import Axis
4+
from pybricks.parameters import Axis
55

66
# Initialize the hub. In this case, specify that the hub is mounted with the
77
# top side facing forward and the front side facing to the right.

0 commit comments

Comments
 (0)