Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First code refactor #1

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

GianniLunardi
Copy link
Collaborator

Main features:

  • refactor in a single python module
  • main script for creating the dataset and learning the viability kernel
  • computation of the N-step backward reachable set with the --horizon=N argument (works only with uniform sampling)

Warning: by executing this scripts, some import error should appear
Contents:
- input and parameters parser
- double and triple pendulum models
- abstract classes for model, dynamics simulator and optimal controller
- VBOC controller
- simple NN for learning
Copy link

@andreadelprete andreadelprete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the comments below

scripts/main.py Outdated Show resolved Hide resolved
scripts/main.py Show resolved Hide resolved
scripts/main.py Outdated Show resolved Hide resolved
scripts/main.py Show resolved Hide resolved
scripts/main.py Show resolved Hide resolved
scripts/main.py Outdated Show resolved Hide resolved
scripts/main.py Outdated Show resolved Hide resolved
x_limit = True
else:

if model.checkPositionBounds(x_star[j - 1, :model.nq]):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking the position bounds on x_star should be useless, as x_star is the solution of the OCP, therefore it should always satisfy the position bounds.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is along the trajectory found by the OCP, so x_star[j-1] can be on the position bounds or not.

- change name of the flag for uniform sampling
- comment on `d` sign
- some fix on the `check` conditions
- fix handling of `horizon` argument
- improved plot of viability kernel (generated data near the plotted borders)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants