[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [sumo-user] Inquiry : Retrieve all traffic lights between source and destination for a given vehicle
|
Namaste,
Here are the links which refers to the files which are used to reproduce the issue.
Route contains about 5 vehicles, map is about 70MB.
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Sumo-small-net.xml
sumo-rou.xml
testconfig.sumocfg
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Please run the python code, to reproduce the behavior. (file is also attached herewith)
When we ran the getNextTLS() api, we weren't able to get the traffic signals.
From: sumo-user-bounces@xxxxxxxxxxx <sumo-user-bounces@xxxxxxxxxxx> on behalf of Jakob Erdmann <namdre.sumo@xxxxxxxxx>
Sent: 10 May 2019 02:58
To: Sumo project User discussions
Subject: Re: [sumo-user] Inquiry : Retrieve all traffic lights between source and destination for a given vehicle
Please provide a *minimal* example input (network and traci script) that demonstrates missing tls in getNextTLS.
Namaste,
I have the following requirement.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Requirement:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Given vehicleId, I want to know the following things
Input: vehicleId
Output: List [ (traffic-signal1, lane, state-of-signal), (traffic-signal2,
lane, state-of-signal), ..................(traffic-signal-n, lane, state-of-signal) ]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Problem:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The output of the above api getNextTLS() is
not returning the complete list of traffic signals between the source and destination of the vehicle.
Many traffic signals are skipped in the returned list.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Question:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
How to retrieve the
complete ordered list of traffic signals for a given vehicle following a particular route?
How to know which lane the vehicle will go on the specified edge in the current route it is following?
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Please advise on the above problem.
Regards,
Sheshadri K R
+91-9845213149
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user
|
import traci
sumo_binary = "/usr/local/bin/sumo"
sumo_cmd = [sumo_binary, "--collision.action", "none", "-c", "testconfig.sumocfg"]
traci.start(sumo_cmd)
#Retrying in 1 seconds
#Loading configuration... done.
#(19, 'SUMO 1.1.0')
traci.simulationStep()
custom_edge_list = ['372083757', '372083758#0', '372083758#1', '503401199', '503401200#0', '503401200#1', '458439808', '45715647#0', '45715647#1', '135088035#0', '135088035#1', '372083754', '372083755#0', '372083755#1', '372083755#2', '372083755#3', '372083755#4', '202289062#0', '202289062#1', '202289062#2', '458439810#0', '36884555#7', '458439811#0', '458439811#1', '52242930#0', '52242930#1', '161416660#0', '161416660#1', '161416660#2', '257625430', '115837334', '26807972#0', '26807972#1', '26807972#2', '26807972#3', '161416662', '172920277#0', '172920277#1', '360861358#0', '360861358#1', '503401205', '589685544', '52063523#1', '52063523#2', '52063523#3', '506310567#0', '554901332', '362900185#0', '362900185#1', '107215079#0', '107215079#1', '107215079#2', '107215079#3', '107215079#4', '107215079#5', '107215079#6', '544761377#0', '544761377#1', '544761379', '544761381#0', '544761381#1', '544761381#2', '544761383#0', '544761383#1', '544761383#2', '542070645', '542070643#0', '542070643#1', '224621537#0', '224621537#1', '484510041#0', '484510040#0', '484510040#1', '484510040#2', '484510040#3', '484510040#4', '484510040#5', '484510040#6', '484510040#7', '36257667#0', '36257667#1', '36257667#2', '36257667#3', '36257667#4', '36257667#5', '36257667#6', '36257667#7', '36257667#8', '36257667#9', '36257667#10', '36257667#11', '638541497#12', '638541497#13', '638541497#14', '638541497#15', '638541497#16', '638541497#17', '638541497#18', '638541497#19', '638541497#20', '461556542#0', '461556542#1', '461556542#2', '461556542#3', '461556542#4', '461556542#5', '30877924#0', '30877924#1', '30877924#2', '30877924#3', '30877924#4', '128510749#0', '328758435#4', '328758435#5', '328758435#6']
print(len(custom_edge_list))
# 115
traci.route.add("7777", custom_edge_list)
traci.vehicle.add("99", "7777")
traci.vehicle.moveTo("99", "372083757_0", pos=1)
traci.simulationStep()
print(traci.vehicle.getSpeed("99"))
# 2.5408767523476854
traffic_sequence = traci.vehicle.getNextTLS("99")
print (traffic_sequence)
# () This was supposed to return 20 traffic signals
# the expected output : ['1837445449', '5372295313', '294081382', '2382036292', '251082959', '3352035441', '481754476', '26529522', '1213632636', '294083859', '253521405', '2382016055', '287908720', '663596568', '287911537', '249082186', '1837783514', '254665635', '1837595259', '287904671']
traci.simulationStep()
traffic_sequence = traci.vehicle.getNextTLS("99")
print (traffic_sequence)
# ()
edges = traci.route.getEdges("7777")
print (edges)
# ('372083757', '372083758#0', '372083758#1', '503401199', '503401200#0', '503401200#1', '458439808', '45715647#0', '45715647#1', '135088035#0', '135088035#1', '372083754', '372083755#0', '372083755#1', '372083755#2', '372083755#3', '372083755#4', '202289062#0', '202289062#1', '202289062#2', '458439810#0', '36884555#7', '458439811#0', '458439811#1', '52242930#0', '52242930#1', '161416660#0', '161416660#1', '161416660#2', '257625430', '115837334', '26807972#0', '26807972#1', '26807972#2', '26807972#3', '161416662', '172920277#0', '172920277#1', '360861358#0', '360861358#1', '503401205', '589685544', '52063523#1', '52063523#2', '52063523#3', '506310567#0', '554901332', '362900185#0', '362900185#1', '107215079#0', '107215079#1', '107215079#2', '107215079#3', '107215079#4', '107215079#5', '107215079#6', '544761377#0', '544761377#1', '544761379', '544761381#0', '544761381#1', '544761381#2', '544761383#0', '544761383#1', '544761383#2', '542070645', '542070643#0', '542070643#1', '224621537#0', '224621537#1', '484510041#0', '484510040#0', '484510040#1', '484510040#2', '484510040#3', '484510040#4', '484510040#5', '484510040#6', '484510040#7', '36257667#0', '36257667#1', '36257667#2', '36257667#3', '36257667#4', '36257667#5', '36257667#6', '36257667#7', '36257667#8', '36257667#9', '36257667#10', '36257667#11', '638541497#12', '638541497#13', '638541497#14', '638541497#15', '638541497#16', '638541497#17', '638541497#18', '638541497#19', '638541497#20', '461556542#0', '461556542#1', '461556542#2', '461556542#3', '461556542#4', '461556542#5', '30877924#0', '30877924#1', '30877924#2', '30877924#3', '30877924#4', '128510749#0', '328758435#4', '328758435#5', '328758435#6')