Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions examples/driving/arya.scenic
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
'''
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
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 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.

Copy link
Author

@aryavenkatesan aryavenkatesan Aug 2, 2025

Choose a reason for hiding this comment

The 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
_lon_controller, _lat_controller = simulation().getPurePursuitControllers()
do FollowLaneBehavior(_lon_controller, _lat_controller, laneToFollow=ego.lane)

ego = new Car with behavior DriveAvoidingCollisions(_lon_controller, _lat_controller, avoidance_threshold=5, pure_pursuit=True, plot=True)

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 15 seconds # in case ego never breaks
102 changes: 102 additions & 0 deletions pid_err.csv
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Large diffs are not rendered by default.

Loading