Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2fd997c
add logger setup code
Tsmorz Nov 19, 2025
1dd8ed5
update doc strings
Tsmorz Nov 19, 2025
6175e57
rename old data
Tsmorz Nov 19, 2025
dc8dde3
update doc string
Tsmorz Nov 19, 2025
7e734c1
add plotter for controller results and fix wrong path in tests
Tsmorz Nov 19, 2025
751a076
big fix in controller results plot
Tsmorz Nov 20, 2025
66af16c
add exception handling for data dirs that dont exist
Tsmorz Nov 20, 2025
858ac39
remove dead code
Tsmorz Nov 20, 2025
21e4a4d
add default omega init to AOParameters
Tsmorz Nov 20, 2025
8b34af8
add method to clip gait phase from -pi to pi
Tsmorz Nov 20, 2025
caf2dd1
update plots
Tsmorz Nov 20, 2025
18b0735
add repr method to AO Step Result
Tsmorz Nov 20, 2025
dde6399
update plot labels
Tsmorz Nov 20, 2025
b3a8bd6
remove dead code
Tsmorz Nov 20, 2025
29189bb
add a delta time method
Tsmorz Nov 20, 2025
fc99c46
formatting
Tsmorz Nov 20, 2025
1075697
change omega init to 1e-3
Tsmorz Nov 20, 2025
fb943e9
add data
Tsmorz Nov 20, 2025
025bddc
add data and replace plot in readme
Tsmorz Nov 21, 2025
aeaddc1
update example code
Tsmorz Nov 21, 2025
037352d
add flag to save results plot
Tsmorz Nov 21, 2025
21855aa
add iter methods
Tsmorz Nov 21, 2025
fae1efc
commit result plots and txt files
Tsmorz Nov 21, 2025
e71aef1
fix test
Tsmorz Nov 21, 2025
87efbf2
update file names
Tsmorz Nov 21, 2025
5ec77a7
update angle offset code
Tsmorz Nov 24, 2025
9eec76a
update offsets to remove hardcoded value
Tsmorz Nov 25, 2025
2d1cc57
add updates to angle offset results
Tsmorz Nov 25, 2025
9c38ff7
move paper to docs
Tsmorz Nov 25, 2025
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
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ typecheck:

test:
poetry run pytest --cov=src/adaptive_oscillator --cov-report=term-missing --no-cov-on-fail --cov-report=xml --cov-fail-under=85
rm .coverage

format:
make lint
make typecheck

clean:
rm -rf .venv
rm -rf .mypy_cache
Expand All @@ -35,5 +37,5 @@ update:
poetry cache clear pypi --all
poetry update

app:
poetry run python -m adaptive_oscillator --log-dir data/walk_4 --plot
help:
poetry run python -m src.adaptive_oscillator --help
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@ To install the library run: `pip install adaptive-oscillator`

## Usage
```
"""Basic usage for our module."""
"""Basic usage for the adaptive oscillator."""

def main() -> None:
"""Run a simple demonstration."""
# Initialize system
controller = AOController(show_plots=True)

while True:
try:
self.step(t=t, th=angle, dth=angle_derivative)
except KeyboardInterrupt as KI:
print("Exiting...")
t, x_axis_angle, x_axis_vel = read_from_sensor()
th = np.deg2rad(x_axis_angle)
dth = np.deg2rad(x_axis_vel)
controller.step(t=t, x=th, x_dot=dth)

controller.plot_results()

if __name__ == "__main__":
main()
Expand All @@ -38,4 +40,4 @@ if __name__ == "__main__":
## Results
The plot below shows the results being plotted in real time.

<img src="docs/plot_screenshot.png" width="800">
<img src="docs/results.png" width="1000">
28,361 changes: 28,361 additions & 0 deletions data/2025_11_20/17_36_59/Accelerometers_left.txt

Large diffs are not rendered by default.

28,361 changes: 28,361 additions & 0 deletions data/2025_11_20/17_36_59/Accelerometers_right.txt

Large diffs are not rendered by default.

28,361 changes: 28,361 additions & 0 deletions data/2025_11_20/17_36_59/Angles_left.txt

Large diffs are not rendered by default.

28,361 changes: 28,361 additions & 0 deletions data/2025_11_20/17_36_59/Angles_right.txt

Large diffs are not rendered by default.

28,361 changes: 28,361 additions & 0 deletions data/2025_11_20/17_36_59/Gravity_left.txt

Large diffs are not rendered by default.

28,361 changes: 28,361 additions & 0 deletions data/2025_11_20/17_36_59/Gravity_right.txt

Large diffs are not rendered by default.

28,361 changes: 28,361 additions & 0 deletions data/2025_11_20/17_36_59/Gyroscopes_left.txt

Large diffs are not rendered by default.

28,361 changes: 28,361 additions & 0 deletions data/2025_11_20/17_36_59/Gyroscopes_right.txt

Large diffs are not rendered by default.

28,361 changes: 28,361 additions & 0 deletions data/2025_11_20/17_36_59/Quaternions_left.txt

Large diffs are not rendered by default.

28,361 changes: 28,361 additions & 0 deletions data/2025_11_20/17_36_59/Quaternions_right.txt

Large diffs are not rendered by default.

22,348 changes: 22,348 additions & 0 deletions data/2025_11_20/17_42_41/Accelerometers_left.txt

Large diffs are not rendered by default.

22,348 changes: 22,348 additions & 0 deletions data/2025_11_20/17_42_41/Accelerometers_right.txt

Large diffs are not rendered by default.

22,348 changes: 22,348 additions & 0 deletions data/2025_11_20/17_42_41/Angles_left.txt

Large diffs are not rendered by default.

22,348 changes: 22,348 additions & 0 deletions data/2025_11_20/17_42_41/Angles_right.txt

Large diffs are not rendered by default.

22,348 changes: 22,348 additions & 0 deletions data/2025_11_20/17_42_41/Gravity_left.txt

Large diffs are not rendered by default.

22,348 changes: 22,348 additions & 0 deletions data/2025_11_20/17_42_41/Gravity_right.txt

Large diffs are not rendered by default.

22,348 changes: 22,348 additions & 0 deletions data/2025_11_20/17_42_41/Gyroscopes_left.txt

Large diffs are not rendered by default.

Loading