Pure Pursuit Controller Implementation + Lane Error calculation Script#357
Pure Pursuit Controller Implementation + Lane Error calculation Script#357aryavenkatesan wants to merge 4 commits intoBerkeleyLearnVerify:ScenicControllersfrom
Conversation
Eric-Vin
left a comment
There was a problem hiding this comment.
Looking good so far! There are a few changes we should make to the code, and we need to add tests (ensuring we get as close to 100% coverage of new lines as possible) and ideally we should move the CSV-based plots to a Python script that we can put under utils.
|
|
||
| param map = localPath('../../assets/maps/CARLA/Town05.xodr') | ||
| param carla_map = 'Town05' | ||
| param time_step = 1.0/10 |
There was a problem hiding this comment.
A more reliable way to get timestep length in Scenic is to use the simulation function, and then accessing the timestep property (see here). Note that this can only be done at simulation time, but that's probably the only time you need to get the timestep anyway.
There was a problem hiding this comment.
This code was copied from Scenic/examples/driving/badlyParkedCarPullingIn.scenic- I can make changes to this if you want me to.
pid_err.csv
Outdated
There was a problem hiding this comment.
Instead of CSVs, I think we should go with a Python script that runs Scenic programs live and then generates a plot in matplotlib. That way we don't have these bulky files in the repo, and if we run the benchmarks we know the results are relevant to the current state of the code.
| # Sometimes no point is found, this is an error | ||
| # In that case, dont touch steering wheel | ||
| # Pure Pursuit is a self correcting algorithm so it should be fine | ||
| cte = self.past_cte |
There was a problem hiding this comment.
How do we handle reaching the end of a desired trajectory? We might want to add some proper handling for this. Any thoughts @psduggirala?
| return lon_controller, lat_controller | ||
|
|
||
| def getPurePursuitControllers(self, agent, cl = 4.5, ld = 7, clwbr = 0.65): | ||
| dt = self.timestep |
There was a problem hiding this comment.
As above, let's grab this directly from simulator().timestep
There was a problem hiding this comment.
I changed this to dt = Simulation.timestep and got AttributeError: type object 'Simulation' has no attribute 'timestep'
There was a problem hiding this comment.
Also, simulator is an undefined variable
There was a problem hiding this comment.
make this being passed from scenic to python
Description
Added a new simulation file for testing purposes. Added code to behaviors.scenic, simulators.py, and controllers.py in src/scenic/domains/driving.
Issue Link
N/A
Checklist
pytestand/or other meansAdditional Notes
Will refine the algorithm within this branch. Once quality is reached, I will autoformat everything and add the proper documentation before attempting to merge this branch to main.
Here is some footage of the algorithm in action: https://drive.google.com/file/d/1MYkoEuXbe4OmTyklxB5KJ-kcIxRbGGbJ/view?usp=sharing