Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-dev] Retrieving the type of Junction
  • From: Melhem Tawk <melhem.tawk@xxxxxxx>
  • Date: Thu, 11 Nov 2021 15:01:43 +0000
  • Accept-language: fr-FR, en-US
  • Arc-authentication-results: i=1; 1; spf=pass; dmarc=pass action=none; dkim=pass; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed;; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gbbeq3avCxzw+51Ci2xFk/Jd+eJtEGeP8YOSZEEThKc=; b=ep3+zw2dki9Z+U8qILKequN8z42BkN+/wp95dp+ImDFQaa9Q8JC5yEtFBiAqXI0OIS+XQuqJnQyJ2Xge5D8MLFI054LyBc6Ea3ozY40VTU9vE8T/XeUz4jNGlf1KuJv66lv04mOGJC025CAH1hemyZ0Ue6Wmr7ET25TwCvUaU/ZbjUezWYLXLlvMAvgYWU9NTrcD4lhbIJ3UbnCACKcKimhxT/jm+fYc5zYw70xCjMOPiBhe30k9C/54o6s93z3byrf0IOOXUak/lYD2UTlKLqF1rHjyBLneyn50LDqlT2VfIJ4daHifRPxnSow7FSlE6gbr3hWzZ234zu4Sd6afCA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901;; cv=none; b=F+sOncoA3TFOIlX3wIHT9XkUagxDnLhiZJJzoiw7V6NpZZGjz5JFwcdDkV9iVCIzrR/VqcV9A6QVejIoXYJqwl6frUKUuSaHbtlB+hAgZK2PRAwWPBRi9VBPOSeGwcqH4z2u6wu+FywLLVysXdWadKo8EQVvruhsWoPZXveJgc6bTxEE7avWrBme2pxIV9nuxC7EYPEKn8FQT5Icq3tnOc9xOr8swx97Et1mfV3nuZl9nMx78FxdwvbstxioLHqqWDCpjXnNmWovMk574Nr6TzdwvW5Z3JNNgDSBjxfVbOnfqWmRxlTJLYM2+sTGjYfp63ODTyCni7yXttzvgLhwGQ==
  • Delivered-to: sumo-dev@xxxxxxxxxxx
  • List-archive: <>
  • List-help: <>
  • List-subscribe: <>, <>
  • List-unsubscribe: <>, <>
  • Thread-index: AdfPQ4m3YfuNrhChQyylfx+WTG2BFgAD6ViAAGIePfAACQVvgAAr87FAABnf5AAAFK29kAACW0jwAFKi/4AAo3f6wAAE8wuAACqBRvA=
  • Thread-topic: [sumo-dev] Retrieving the type of Junction

Hello Jackob,


I consider what you advice. Attached is the log generated by sumo-gui. As you can see there is nothing referring the error. I still have the error:

tcpip::Socket::recvAndCheck @ recv: peer shutdown


and the connection with the client is lost and the sumo-gui end  the simulation.


The simulation started as following :  Simulation::start({“sumo-gui”, “-c”, “ <scenario_name>/osm.sumocfg”,  “--step-length”, “1”}, 5678)


NB: we are using tracicpp in linux environment and our code works well with scenario where crossing is not activated. So we were able to see external pedestrians in sumo and the collision avoidance where vehicles are blocked waiting pedestrian’ crosswalks to pass. WE are only adding pedestrian entering the crosswalk and remove them when they exit the cross walk. We are using sumo to simulation the traffic collision avoidance in Sumo.


Thank you to advice or refer us some command line option to test.


Your help is Well appreciated.





From: Jakob Erdmann <namdre.sumo@xxxxxxxxx>
Sent: Wednesday, November 10, 2021 1:19 PM
To: Melhem Tawk <melhem.tawk@xxxxxxx>
Subject: Re: [sumo-dev] Retrieving the type of Junction



please try running your simulation with sumo-gui and report what happens. I expected that either:


a) there is an error message in the sumo-gui message window. This indicates that your traci client script crashed. The most likely cause is that one of your traci commands raised a libsumo::TraCIException (i.e. because a person could not be added for a good reason). In this case sumo reports "peer shutdown".  The solution is to use try/catch in your script and maybe to change the commands arguments.


b) sumo-gui crashes. In this case your traci script reports "peer shutdown". The solution is that I fix some bug in sumo.






Am Mi., 10. Nov. 2021 um 17:43 Uhr schrieb Melhem Tawk <melhem.tawk@xxxxxxx>:

Thank you Jakob for your time.


Based on your answer#1 below, I create my scenario with count 0 while checking the box "pedestrians". Sumo run the generated scenario without any errors. But when we run sumo  with adding external pedestrians sumo crash with the following error:


terminate called after throwing an instance of 'tcpip::SocketException'

  what():  tcpip::Socket::recvAndCheck @ recv: peer shutdown


FYI, We use the following Sumo’s APis to add Update and remove external pedestrians:

externalPersonID = 999999


libsumo::TraCIRoadPosition wEdge = Simulation::convertRoad(iLong, iLat, true, pedestrian”);

double wPosition = iEdge.pos – 0.01;

Person::add(externalPersonID, wEdge.edgeID , wPosition, libsumo::DEPARTFLAG_NOW);

Person::appendWalkingStage(externalPersonID, { wEdge.edgeID }, wPosition, -1, -1, “”);


    libsumo::TraCIPosition wCartesianPos = Simulation::convertGeo(iLong, iLat, true);

    double wAngle = libsumo::INVALID_DOUBLE_VALUE;

    int wkeepRoute = 1;

    double wMatchThreshold = 100;

    Person::moveToXY(externalPersonID, , { wEdge.edgeID }, wCartesianPos.x, wCartesianPos.y, wAngle, wKeepRoute, wMatchThreshold);

    Person::setSpeed(externalPersonID, 0.0);


      while (1 < Person::getRemainingStages(externalPersonID))


        Person::removeStage(externalPersonID, 1);


      Person::removeStage(externalPersonID, 0);


Before every step() we add a new pedestrian and we update the existing ones and remove pedestrians when a decision is made (outside sumo). Then after Simulation::Step() is called.


The mentioned error is generated at the second call of Simulation::step().


Would you please advice.


NB: that code works well with scenarios where the checkbox "pedestrians" is not checked.






From: Jakob Erdmann <namdre.sumo@xxxxxxxxx>
Sent: Sunday, November 7, 2021 4:56 AM
To: Melhem Tawk <melhem.tawk@xxxxxxx>
Subject: Re: [sumo-dev] Retrieving the type of Junction


1. The easiest way to get crosswalks into your scenario is the set the checkbox "pedestrians" in the traffic tab of osmWebWizard and set the 'count' field to 0. This will set the appropriate netconvert options for adding sidewalks and crossings to the network without adding any pedestrians to the simulation.

2. Simulation::load reloads the whole network. If you call Simulaton::loadState only the state is reset and the network is kept. However, this only makes a difference when having lots of short simulations (rather than 2 hour simulations as in your case).





Am Fr., 5. Nov. 2021 um 19:30 Uhr schrieb Melhem Tawk <melhem.tawk@xxxxxxx>:

Dear Jakob,


Thank you for you answer mentioning than there are no crosswalks in our scenario.


Attached is the screen shot of files list of our scenario generated via OSMWebWizad script. By the way we have vehicles in the scenarios but the pedestrians are inserted remotely from external simulator during the simulation using the following as you told  me in a previous email:



- the easiest way to couple with a pedestrian simulator is to remote-control each person using the traci function person.moveToXY (after adding it with person.add and person.appendWalkingStage)

- if your original network data (probably OSM) does not contain sidewalk information, there are various ways to add sidwalks. See

- you can obtain permission data using traci.lane.getAllowed






First, Based on what we have could you please explain to us how we can generate the cross walks. By the way we despite that there are no crosswlaks in our scenario, we can see in sumo the pedestrian coming from external simulator on crosswalk.

Second Point, we are using the c++ api to start sumo

Simulation::Start({“sumo”, “-c”, “osm.sumocfg”, “--load-state” , “statetakenat750SimulationTimename”, “--step-length”, “0.5”}).

This will run for 7200 simulation time then we use

Simulation::Load(({“sumo”, “-c”, “osm.sumocfg”, “--load-state” , “statename”, “--load-state.offset”, “7200”)

to reload the simulation without restaring the full scenario.

Do you think this the best way to reload the simulation in an efficient way or there is another way ?


Please advice




Thank you for answer


From: sumo-dev <sumo-dev-bounces@xxxxxxxxxxx> On Behalf Of Jakob Erdmann
Sent: Friday, November 5, 2021 3:31 AM
To: sumo developer discussions <
Subject: Re: [sumo-dev] Retrieving the type of Junction


I'm guessing that your network doesn't have any crosswalks. See for how to get them.

This is what a pedestrian-enabled network should look like:


Am Do., 4. Nov. 2021 um 21:25 Uhr schrieb Adrien Dubedat <adrien.dubedat@xxxxxxx>:

This a simple JSON file I created while running SUMO.

In there, I write the traffic light ID and then the controlled lanes ID in that traffic light.

However, I don’t see the format you were mentioning in your previous email.


I also tried to go through the list of controlled links but it’s the same format.

See the second file attached.


I’m guessing this is because the naming convention in the file might not be correct ?


This is how a junction is defined in the file:


<junction id="10018180" type="dead_end" x="9550.31" y="6845.42" incLanes="260842179_0" intLanes="" shape="9549.40,6845.01 9551.22,6845.82"/>


Thank you for your help,



De : sumo-dev <sumo-dev-bounces@xxxxxxxxxxx> De la part de Jakob Erdmann
Envoyé : Wednesday, November 3, 2021 6:11 PM
À : sumo developer discussions <
Objet : Re: [sumo-dev] Retrieving the type of Junction


You can use traci.trafficlight.getControlledLanes and getControlledLinks

Lanes with ids of the form :<JUNCTIONID>_w<index>_0 are walkingareas

Lanes with ids of the form :<JUNCTIONID>_c<index>_0 are crossings


The index in the result lists corresponds to the index in the phase state.






Am Mi., 3. Nov. 2021 um 20:10 Uhr schrieb Adrien Dubedat <adrien.dubedat@xxxxxxx>:

Hi Jakob,


Thank you for your reply, I only just see it now because your emails were considered as spams by my company’s IT department …


It looks like I’ve been able to extract those controlled junctions, perfect.


I have another question. I’m interested in retrieving the state of the traffic lights associated to pedestrian crosswalks.

In the documentation, it says that the crosswalks’ states are at the end of “state” string when calling “getRedYellowGreenState()”.

Is there a way to know where do the pedestrian crosswalks start in that string ? Or is there a way to identify those crosswalks ?


Thank you,



De : sumo-dev <sumo-dev-bounces@xxxxxxxxxxx> De la part de Jakob Erdmann
Envoyé : Monday, November 1, 2021 3:04 PM
À : sumo developer discussions <
Objet : Re: [sumo-dev] Retrieving the type of Junction


ATTENTION : Ce courriel provient de l’extérieur de l’organisation. Ne cliquez pas sur les liens ni sur les pièces jointes à moins que vous reconnaissiez l’expéditeur et que vous sachiez que le contenu est sûr.
CAUTION : This email originated from outside the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

The junction type is currently not accessible via the TraCI API.  (for static network analysis, the python library sumolib is recommended:


If you only need to identify traffic light junctions, you can use the functions in TrafficLight.h to retrieve this information:

- all traffic light controllers with getIDList

- all junction ids controller by a given controller with getControlledJunctions





Am Mo., 1. Nov. 2021 um 18:16 Uhr schrieb Adrien Dubedat <adrien.dubedat@xxxxxxx>:



I’m trying to retrieve the type of a Junction, I’m using the C++ library.


In an file which lists all junctions, I see there are some different node types ( :


<junction id="101335548" type="traffic_light" x="9587.74" y="5049.51" incLanes="-770022998#1_0 480644124#1_0 690226256#9_0 -11661029#1_0" intLanes=":101335548_0_0 :101335548_1_0 :101335548_16_0 :101335548_17_0 :101335548_4_0 :101335548_5_0 :101335548_18_0 :101335548_19_0 :101335548_8_0 :101335548_9_0 :101335548_20_0 :101335548_21_0 :101335548_12_0 :101335548_13_0 :101335548_22_0 :101335548_23_0" shape="9587.30,5041.43 9593.31,5043.64 9592.97,5045.85 9593.23,5046.73 9593.79,5047.47 9594.63,5048.06 9595.77,5048.51 9593.99,5054.65 9591.44,5054.42 9590.39,5054.75 9589.50,5055.38 9588.76,5056.31 9588.18,5057.54 9582.17,5055.32 9582.52,5053.10 9582.26,5052.21 9581.71,5051.46 9580.87,5050.85 9579.74,5050.39 9581.63,5044.27 9584.11,5044.53 9585.13,5044.20 9586.00,5043.58 9586.72,5042.65">


I looked in the C++ classes / headers, mostly in “Junction” class, and I didn’t find anything related to that type, while we can get the Position or the Shape for example.


Does anyone have an idea on how to get this data ?


Thank you,


sumo-dev mailing list
To unsubscribe from this list, visit

sumo-dev mailing list
To unsubscribe from this list, visit

sumo-dev mailing list
To unsubscribe from this list, visit

Attachment: scenario_crossing.log
Description: scenario_crossing.log

Back to the top