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

Improvements #3

Open
govvijaycal opened this issue Oct 19, 2020 · 4 comments
Open

Improvements #3

govvijaycal opened this issue Oct 19, 2020 · 4 comments

Comments

@govvijaycal
Copy link
Collaborator

We should sync updates made on the lanekeeping and GXZ_kin branches. This would primarily be done by modifying the parse_rosbag scripts to capture the road frame and curvature information into the mat file. And then by adjusting the messages / main controller code to handle variation of the controller used.

Also, may be a good idea to remove unneeded elements from the analysis folder and/or add a README for future improvement.

@huckl3b3rry87
Copy link

Speaking of improvements, I am curious why you switch from julia/JuMP to python/CASADI? I am also curious how the performance stacks up?

Thanks and great work!

@govvijaycal
Copy link
Collaborator Author

So there were a few reasons to move away from JuMP:
(1) Initially I used RobotOS.jl but it was slow (I think it needs to compile messages every time you run a node).
(2) I had precompilation working for the MPC module in Julia but it may still need a couple seconds to start up.
(3) I tried to use pyjulia to remove the requirement of having a main script be in Julia, so only the MPC portion could be written in Julia. This is tricky since I could only get this working smoothly with specific versions of Julia and Python.
(4) Casadi provides a similar interface to JuMP if you use the opti interface and starts almost immediately. I think, under the hood, it's basically a wrapper to Ipopt in C++ so the speeds are pretty good.

I found that, with a warm start, Casadi/Ipopt can find solutions at 50 Hz. Earlier, with JuMP/Ipopt, I could only get max 20 Hz, although it's likely I wasn't properly warm starting (just relied on whatever is cached when you call the solve function in JuMP). This hasn't been tested though with difficult optimization problems (e.g. collision avoidance); in this repo, usually the warm start is close to optimal since the reference path changes slowly.

So mostly changed due to simplicity, speed of start up with ROS/Python, and the fact that I don't need an additional install/configuration of Julia. Just need to do pip install casadi and that's it.

@huckl3b3rry87
Copy link

Thank you very much for going into the details of this.

I definitely know the struggle of setting things up with Julia/RobotOS/Python and ROS, possible, but not fun.

Wow, there is a huge difference in speed!

@huckl3b3rry87
Copy link

to stop printing all the messages, try

		p_opts = {"expand": True, "print_time":False}

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

No branches or pull requests

2 participants