Skip to content

Add python#56

Open
Chachay wants to merge 7 commits intoalexliniger:masterfrom
Chachay:python
Open

Add python#56
Chachay wants to merge 7 commits intoalexliniger:masterfrom
Chachay:python

Conversation

@Chachay
Copy link
Contributor

@Chachay Chachay commented Jan 26, 2021

The implementation is far from perfect (obviously the behaviour is different from your work), but added python version.

I have an interest in comparing NMPC and RL algorithms and thought to reproduce your work in Python, which is easier to interface with existing implementations. I'm debugging to get a closer result to yours but will take more time.

Hoping somebody in this community might notice my fatal mistake, I make this PR.

@alexliniger
Copy link
Owner

Thanks for adding you python version. I try to have a look what is not working properly and will merge it if everything is fine.
Regarding RL I also have a gym replicating the RC car environment. It is inspired by my paper "Learning in Simulation, Racing in Reality" https://arxiv.org/abs/2011.13332

@Chachay
Copy link
Contributor Author

Chachay commented Jan 27, 2021

Thank you very much for taking your time and an inspiring paper.

Regarding a gym environment, I planned to add it to this repository but have been wondering the license compliant way to include parameter files(tracks and models) from this repo.

About my script, I should have commented it, but this python script has two 'duplicated' vehicle model.
One is defined in nmpc_sim.py and the other /python/model/sim_model.py.

I defined two separately to separate two models as follows

  1. Ground Truth model and the real environment [/python/model/sim_model.py]
  2. Controller internal model which has currently identical parameters as ground truth [nmpc_sim.py ]
v = VehicleSimModel(scale=2, control_dt = dT*1000) # <-- #1 world model (environment in RL gym context)
dmodel = ExBicycleModel(param=model_params, NX=10, NU=3)  # <-- #2 controller internal model

To run script

python3 nmpc_sim.py --render

shows animation.

I'm sorry about the bad documentation. I'll add a bit more comments.

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.

3 participants