Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/docs-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
python -m pip install --upgrade pip
pip install -e .
pip install -r requirements.txt
pip install -r docs/requirements.txt

- name: Generate API stubs
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ self.neo_pixel.change_color(255, 128, 0)
Sphinx documentation lives in `docs/` and is auto-generated on pushes to `dev` via GitHub Actions, then deployed to GitHub Pages. To build locally:

```bash
pip install -r docs/requirements.txt
pip install -r requirements.txt
sphinx-apidoc -o docs/api src/robot
python -m sphinx -b html docs docs/_build/html
open docs/_build/html/index.html
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ pip install -e .
From the repository root:

```bash
pip install -r docs/requirements.txt
pip install -r requirements.txt
sphinx-apidoc -o docs/api src/robot
python -m sphinx -b html docs docs/_build/html
```

Or from inside the `docs/` directory:

```bash
pip install -r requirements.txt
pip install -r ../requirements.txt
make apidoc
make html
```
Expand Down
6 changes: 0 additions & 6 deletions docs/requirements.txt

This file was deleted.

6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
flake8==7.3.0
furo==2025.12.19
myst-parser==4.0.1
packaging==25.0
paho-mqtt==2.1.0
pytest==8.4.2
Sphinx==8.2.3
sphinx-autobuild==2025.8.25
sphinx-autodoc-typehints<3
sphinx_rtd_theme==3.1.0
20 changes: 6 additions & 14 deletions src/robot/helpers/motion_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def publish_coordinate(self):
pass

coordinate = _StubCoord() # type: ignore[assignment]
self.c = coordinate # type: ignore[assignment]
self.c: Coordinate = coordinate # type: ignore[assignment]

# Wrappers -----------------------------------------------------------
def move(
Expand Down Expand Up @@ -86,9 +86,7 @@ def rotate_degree(self, speed: int, degree: float) -> None:
2 * math.pi * RobotSettings.ROBOT_RADIUS * (abs(degree) / 360)
) * self.CM_2_MM
duration = float(distance / abs(speed)) * self.SEC_2_MS
self._debug(
f"Sign: {sign} Distance: {distance} Duration: {duration}"
)
self._debug(f"Sign: {sign} Distance: {distance} Duration: {duration}")
self._rotate(sign * speed, duration)
except MotionControllerException: # noqa: F841
pass
Expand All @@ -104,13 +102,11 @@ def _move(
duration: float,
) -> None:
if not (
self._is_speed_in_range(left_speed)
and self._is_speed_in_range(right_speed)
self._is_speed_in_range(left_speed) and self._is_speed_in_range(right_speed)
):
try:
raise MotionControllerException(
"One of the provided speeds is out of "
"range in move() function"
"One of the provided speeds is out of range in move() function"
)
except MotionControllerException:
return
Expand All @@ -128,10 +124,7 @@ def _move(

x = self.c.get_x() + d * math.cos(h)
y = self.c.get_y() + d * math.sin(h)
heading = (
self.c.get_heading_rad()
+ (dR - dL) / (RobotSettings.ROBOT_WIDTH)
)
heading = self.c.get_heading_rad() + (dR - dL) / (RobotSettings.ROBOT_WIDTH)

self.c.set_coordinate_heading(x, y, math.degrees(heading))

Expand All @@ -154,8 +147,7 @@ def _move(
def _is_speed_in_range(self, speed: int) -> bool:
if speed > 0:
return (
RobotSettings.ROBOT_SPEED_MIN <= speed
<= RobotSettings.ROBOT_SPEED_MAX
RobotSettings.ROBOT_SPEED_MIN <= speed <= RobotSettings.ROBOT_SPEED_MAX
)
elif speed < 0:
return (
Expand Down
Loading