-
Notifications
You must be signed in to change notification settings - Fork 135
Pure Pursuit Controller Implementation + Lane Error calculation Script #357
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
base: ScenicControllers
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| ''' | ||
| To run this file using the MetaDrive simulator: | ||
| scenic examples/driving/arya.scenic --2d --model scenic.simulators.metadrive.model --simulate | ||
|
|
||
| To run this file using the Carla simulator: | ||
| scenic examples/driving/arya.scenic --2d --model scenic.simulators.carla.model --simulate | ||
|
|
||
|
|
||
| TODO: | ||
| Make some kinda waypoints that the car can follow | ||
| make the car follow the waypoints using pure pursuit. | ||
| ''' | ||
|
|
||
| param map = localPath('../../assets/maps/CARLA/Town05.xodr') | ||
| param carla_map = 'Town05' | ||
| param time_step = 1.0/10 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A more reliable way to get timestep length in Scenic is to use the simulation function, and then accessing the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code was copied from Scenic/examples/driving/badlyParkedCarPullingIn.scenic- I can make changes to this if you want me to. |
||
|
|
||
| model scenic.domains.driving.model | ||
|
|
||
| behavior PullIntoRoad(): | ||
| while (distance from self to ego) > 15: | ||
| wait | ||
| do FollowLaneBehavior(laneToFollow=ego.lane) | ||
|
|
||
| ego = new Car with behavior DriveAvoidingCollisions(avoidance_threshold=5) | ||
|
|
||
| rightCurb = ego.laneGroup.curb | ||
| spot = new OrientedPoint on visible rightCurb | ||
| badAngle = Uniform(1.0, -1.0) * Range(10, 20) deg | ||
| #parkedCar = new Car left of spot by 0.5, | ||
| #facing badAngle relative to roadDirection, | ||
| #with behavior PullIntoRoad | ||
|
|
||
| #require (distance to parkedCar) > 20 | ||
|
|
||
| monitor StopAfterInteraction(): | ||
| for i in range(50): | ||
| wait | ||
| while ego.speed > 2: | ||
| wait | ||
| for i in range(50): | ||
| wait | ||
| terminate | ||
| require monitor StopAfterInteraction() | ||
| terminate after 30 seconds # in case ego never breaks | ||
Uh oh!
There was an error while loading. Please reload this page.