-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Support controller parameters tuning pipeline #250
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First round of review, please see the detailed review in the code. Several major issues: 1. Use LieTensor rather than re-write all the conversion by yourself. 2.Compute the partial derivative for u_k to accommodate the general loss L instead of only for x_k for sensitivity propogation. 3. Re-organize the modules , put the controller and tuner to modules rather than examples or optim. 4. Documentation should have all the core algorithms and equations with properly cited papers. 5. Some coding style really needs improved. Let's fix these before further review.
examples/module/controller_parameters_tuner/dubincar_controller_tuner.py
Outdated
Show resolved
Hide resolved
examples/module/controller_parameters_tuner/multicoptor_controller_tuner.py
Outdated
Show resolved
Hide resolved
3a14d24
to
a60f655
Compare
According to the comments, several revises have been made:
ToDo:
|
Documentation has been updated on Wednesday. |
@wang-chen Hello Chen, In this PR, I am trying to implement the function Should I also create the unit test for the |
Yes, you may do that. Thank you! |
ToDo:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can successfully run all the examples and the test files. Several major issues: 1. bad file organization in the pypose/module. 2. The controller is too problem specific. We are expecting the general PID controller, etc so that people can pass through different problem (dynamics). 3. Many of the API design are not good. Please think about it from the user perspective. 4. Some of the coding style is really not ideal. Please refer to our developer guideline SERIOUSLY and CAREFULLY.
pypose/module/dubincar_controller.py
Outdated
from pypose.module.controller import Controller | ||
|
||
class DubinCarController(Controller): | ||
def __init__(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API design is not very idea. Think about when someone is initiating a controller, what argments you need to define a controller? some parameters like PID gains, right? So I suggest put the controller parameters in the init, put the current state and ref_state in the get_control.
\end{align*} \tag{4} | ||
|
||
To make sure the controller parameters can stay in the reasonable and safe sets, after updating the parameters, it's essential to project the new parameters into | ||
the feasiable set. And the parameters can be updated using the following equation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following update rule doesn't tell you are projecting the new parameters into the feasible set. It's just the normal gradient descent.
examples/module/controller_parameters_tuner/multicoptor_controller_tuner.py
Outdated
Show resolved
Hide resolved
Setting the pid parameters as the PID controller's internal variables would cause some inconvenience when calculating the gradient inside the parameter tuner. We use the If we set pid parameters as PID's internal properties, we cannot set the There is one way to get the gradients properly but it looks much more complex than using the Here is the code example (just for showing the new way to get the gradient if set the controller parameters as PID's internal parameters):
|
6b21f7b
to
303e785
Compare
The tuner is built based on the sensitivity propagation optimization, the related paper can be found in here.
To use the tuner, four components must be defined by the user: