Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adding ability to configure Traffic Manager in SetAutopilotAction (for Carla) #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

t27
Copy link

@t27 t27 commented Apr 2, 2021

Addressing #27

Adding arguments to the SetAutopilotAction to allow for setting some TrafficManager parameters for agents in a Scenic scenario. This could be extended to add more actor specific traffic manager parameters in the future as well.

Example Scenic behavior with this in practice,

# assuming all necessary imports are done before this section

VEHICLE_PERC_SPEED_DIFF = -30
SPEED_VIOLATION_PROB = 60 # probability that a vehicle is a speed limit violator(always exceeds speed limit)
TL_VIOLATION_PROB = 70  # probability with which the vehicle may violate a traffic light - this prob is constant for all vehicles

# Background activity
background_vehicles = []
for _ in range(25):
    lane = Uniform(*network.lanes)
    spot = OrientedPoint on lane.centerline
    kwargs = {"ignore_lights_percentage":TL_VIOLATION_PROB}
    if (random()*100) < SPEED_VIOLATION_PROB:
        kwargs["vehicle_percentage_speed_difference"] = VEHICLE_PERC_SPEED_DIFF
    background_car = Car at spot,
        with behavior AutopilotBehavior(**kwargs)
    background_vehicles.append(background_car)

#assuming ego vehicle is initialized after this section

@Eric-Vin Eric-Vin linked an issue Mar 25, 2024 that may be closed by this pull request
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding additional Traffic Manager features to Carla Vehicles
1 participant