[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [sumo-user] Pedestrian Collision in SUMO
|
Hi! I have used the setSpeedMode(vehID, 30), but still the cars are stopping for pedestrians (even in green light) and no accident is happening. I have attached my source files herewith. Can you please check if I am doing anything wrong?
|
import os,sys
import time
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("please declare environment variable 'SUMO_HOME'")
import traci
import traci.constants as tc
sumoCmd = ["sumo-gui", "-c", "ped_crossing/run.sumocfg", "--start"]
traci.start(sumoCmd)
step = 0
time.sleep(5)
while step < 100:
traci.simulationStep()
vehicles=traci.vehicle.getIDList()
pedestrians = traci.person.getIDList()
for vehicle in vehicles:
speed = round(traci.vehicle.getSpeed(vehicle))
pos = traci.vehicle.getPosition(vehicle)
angle = traci.vehicle.getAngle(vehicle)
traci.vehicle.setSpeedMode(vehicle,30)
for pedestrian in pedestrians:
speed = round(traci.person.getSpeed(pedestrian))
print(speed)
step = step + 1
traci.close()
Attachment:
pedcrossing.net.xml
Description: XML document
Attachment:
pedcrossing.rou.xml
Description: XML document
Note, that vehicles will always try to brake once a pedestrian violates a red light.
You could use set setSpeedMode(vehID, 30) to ignore the pedestians while still complying to traffic lights but you will have to mange not-crashing-into-the-leader-vehicle in your own code (vehicle.getLeader, vehicle.getFollowSpeed).
regards, Jakob
Hello! I am trying to simulate collisions between pedestrian and vehicle in an intersection under the following assumptions: - The intersection will be traffic light regulated
- The cars will follow the traffic light.
- The pedestrian will not follow the traffic light and cross using the crosswalks whenever they reaches the crosswalk.
- The cars will not stop or slow down for the pedestrians and hit them
First of all, I have tried to make the pedestrian violate the red light and use jmDriveAfterRedTime=“1000” in the *.rou.xml file, but still the pedestrians are stopping at the red light. For vehicle, I tried the TraCI speed mode, but if I set the mode to 0, they will also violate the traffic light, which I do not want.
So, in summary, Can anyone give me some pointers on: - How to make the pedestrians violate the red light and
- How vehicles will hit pedestrian while following all other rules like red light, etc.
Regards, Proyash _______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________ sumo-user mailing list sumo-user@xxxxxxxxxxxTo unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
|