Closed omgbu closed 4 years ago
python version is 2.7 or 3.5? thank you!!
ImportError: No module named 'sumolib' i find sumolib in plexe-sumo, why ???
Hi, the SUMO_HOME environment variable must point to the plexe-sumo directory (where bin, tools, etc. directories can be found). PERMIT should work with both, Python 2.7 and Python 3.5. If you declare the SUMO_HOME environment variable correctly, sumolib and traci should be found when executing PERMIT.
Thanks. I use Instant Plexe, and export plexe-sumo, but still failed. However, when i use Veins, and export sumo, the error disappeared, but the cfg file was not found. May it mean i need install plexe-sumo again??
In your readme, the link of plexe-sumo is sumo, is it wrong or having some differences?Thank you!
In order to use PERMIT you have to use the plexe-sumo version that can be found in the link of the README (https://github.com/michele-segata/sumo/tree/plexe-sumo-0.32.0). You don't need Veins, PERMIT assumes that wireless communications are perfect.
Thank you very much. I use this version: https://github.com/michele-segata/plexe-sumo. So, the difference and the problem is this !!?
Yes, PERMIT only works with some versions of plexe-sumo. That's why I recommend to use the version 0.32.0 (the one linked in the README).
Ok, thank you, i will try again. And i want to combine PERMIT with omnet to do some research on communication. Could you please give me some advice?
If you only need the FCD traces of the vehicles for the communications simulations, then you can use PERMIT and export FCD traces and use them in OMNET (sorry, I don't do research on communications, so I don't know how to do this, but I know that it is possible with Veins). On the other hand, in case you need to simulate intervehicle communications in order to perform the maneuvers, I'm afraid that you would need to redefine the execution of the maneuvers in Veins, since all intervehicle communications are assumed perfect in PERMIT (we don't simulate communications).
All right ~ Thanks again !
Hi, I did "python simulator.py -c freeway.sumo.cfg", but terminal showed: (l_v, l_a, l_u, l_x, l_y, l_t) = cc.unpack(leader_data) ValueError: too many values to unpack Is that wrong? I think there is something wrong in the cfg and xml files. Could you give me some useful cfg and xml files? Thanks!
Hi, sorry for the late reply, I've been a bit disconnected from Github.
Are you sure that your Plexe-SUMO version is the one indicated in the PERMIT's repository? In case it is, try simulating the following highway scenario with PERMIT. The files are the following:
<nodes>
<node id="0" x="0.0" y="0.0"/>
<node id="1" x="10.0" y="0.0"/>
<node id="2" x="5010.0" y="0.0"/>
<node id="3" x="5990.0" y="0.0"/>
<node id="4" x="6000.0" y="0.0"/>
</nodes>
<edges>
<edge id="0to1" from="0" to="1" type="type0"/>
<edge id="1to2" from="1" to="2" type="type0"/>
<edge id="2to3" from="2" to="3" type="type1"/>
<edge id="3to4" from="3" to="4" type="type0"/>
</edges>
<types>
<type id="type0" numLanes="2" speed="33.33"/>
<type id="type1" numLanes="2" speed="20.00"/>
</types>
With these three files you should execute netconvert -n example.nod.xml -e example.edg.xml -t example.typ.xml -o example.net.xml
in order to generate the SUMO network file. The SUMO route file and the configuration file are the following:
<routes>
<vType id="type1">
<carFollowing-CC tauEngine="0.5" omegaN="0.2" xi="1" c1="0.5" decel="9" lanesCount="4" ccAccel="1.5"/>
</vType>
<vType id="type2">
<carFollowing-CC tauEngine="0.5" omegaN="0.2" xi="1" c1="0.5" decel="9" lanesCount="4" ccAccel="1.5"/>
</vType>
<route id="route0" edges="0to1 1to2 2to3"/>
<vehicle id="car0" route="route0" depart="0.0" type="type1" departSpeed="max" departLane="0"/>
<vehicle id="car1" route="route0" depart="0.2" type="type2" departSpeed="max" departLane="1"/>
<vehicle id="car2" route="route0" depart="0.4" type="type1" departSpeed="max" departLane="0"/>
<vehicle id="car3" route="route0" depart="0.6" type="type2" departSpeed="max" departLane="1"/>
<vehicle id="car4" route="route0" depart="0.8" type="type1" departSpeed="max" departLane="0"/>
<vehicle id="car5" route="route0" depart="1.0" type="type2" departSpeed="max" departLane="1"/>
</routes>
<configuration>
<input>
<net-file value="example.net.xml"/>
<route-files value="example.rou.xml"/>
</input>
<time>
<step-length value="0.1"/>
</time>
<gui_only>
<start value="true"/>
</gui_only>
</configuration>
Try to simulate this scenario calling PERMIT with python simulator.py -c example.sumo.cfg -g -ef 1to2 2to3 -vf type1 type2 -pl 8
. I can simulate that scenario without errors. Let's check first if you can simulate it without errors too.
Thank u very much! Error Still occurs. I use the sumo-plexe in Plexe, maybe i need try the version indicated in the PERMIT's repository?
Yes, you should use that version (https://github.com/michele-segata/sumo/tree/plexe-sumo-0.32.0). Newer versions of Plexe change some things that break PERMIT.
File "simulator.py", line 113, in main platoon.communicate() File "/home/plexe/src/PERMIT/platooning.py", line 143, in communicate (l_v, l_a, l_u, l_x, l_y, l_t) = cc.unpack(leader_data)
I try to print leader_data, find that the number of parameters of leader_data is 9, but (l_v, l_a, l_u, l_x, l_y, l_t) is 6
So, i add other 3 parameters, it can work!! I can see cars merge, but cannot see them split.
That's weird, because I'm using that Plexe-SUMO version and I don't get any error. I will try again. In that SUMO scenario vehicles only merge. They don't split because none of the vehicles will leave the platoon while the rest remain inside. At the end of the simulation you can see the platoon dissolve (all the vehicles leave the platoon at the same time).
Perhaps because i use the different version of SUMO(http://plexe.car2x.org/download/), thanks a lot, how can i simulate the split and leave ?
Yes, it is the SUMO version for sure. In order to use PERMIT, the recommended version is this one:
https://github.com/michele-segata/sumo/tree/plexe-sumo-0.32.0
In order to simulate the split and leave maneuvers you need some vehicles to leave the platoon while the platoon remains formed, for example with an off-ramp. Whenever the route of the vehicles leaving does not coincide with the route of the platoon leader, vehicles will leave the platoon.
Thank you very much for your help. I will try the recommended version. And in Plexe:
http://plexe.car2x.org/download/
It also says the version of SUMO is 0.32.0. If you have time, I am looking forward to your development of a compatible version of the official website.
I try to change the route of car4, the car leaves, however, error occurs:
traci.exceptions.TraCIException: Vehicle 'car4' does not support carFollowModel
It seems that traci thinks car4 leave the platoon ahead of time.
Can you give me an example of the cfg? Very grateful!!!
Thanks again!
Hi,
The link you provided to download Plexe-SUMO is not working. https://github.com/michele-segata/sumo/tree/plexe-sumo-0.32.0
Is there any other way to download Plexe-SUMO 0.32.0? Looking forward to your reply.
Hi, how can I make cars split? I try to change the route of car4, the car leaves, however, error occurs:
traci.exceptions.TraCIException: Vehicle 'car4' does not support carFollowModel
It seems that traci thinks car4 leave the platoon ahead of time.
Can you give me an example of the cfg? Very grateful!!!
Thanks again!
Hi, sorry for the late reply, I've been busy trying to fix some problems with the branch of Plexe-SUMO that dissapeared from Michele Segata's repository. Now the required Plexe-SUMO is is another repository. This repository is linked in PERMIT's README.
In order to make cars leave a platoon, they should have a different route than the platoon leader's. I have made an example scenario for this maneuver. The files for this example are the following:
<nodes>
<node id="0" x="0.0" y="0.0"/>
<node id="1" x="10.0" y="0.0"/>
<node id="2" x="5010.0" y="0.0"/>
<node id="3" x="5990.0" y="0.0"/>
<node id="4" x="6000.0" y="0.0"/>
<node id="5" x="5750.0" y="-750.0"/>
</nodes>
<edges>
<edge id="0to1" from="0" to="1" type="type0"/>
<edge id="1to2" from="1" to="2" type="type0"/>
<edge id="2to3" from="2" to="3" type="type1"/>
<edge id="3to4" from="3" to="4" type="type0"/>
<edge id="2to5" from="2" to="5" type="type0"/>
</edges>
<types>
<type id="type0" numLanes="2" speed="33.33"/>
<type id="type1" numLanes="2" speed="20.00"/>
</types>
<connections>
<connection from="0to1" to="1to2" fromLane="0" toLane="0"/>
<connection from="0to1" to="1to2" fromLane="1" toLane="1"/>
<connection from="1to2" to="2to3" fromLane="0" toLane="0"/>
<connection from="1to2" to="2to3" fromLane="1" toLane="1"/>
<connection from="1to2" to="2to5" fromLane="0" toLane="0"/>
<connection from="1to2" to="2to5" fromLane="1" toLane="1"/>
<connection from="2to3" to="3to4" fromLane="0" toLane="0"/>
<connection from="2to3" to="3to4" fromLane="1" toLane="1"/>
</connections>
With these four files you should execute netconvert -n example.nod.xml -e example.edg.xml -t example.typ.xml -x example.con.xml -o example.net.xml
in order to generate the SUMO network file. The SUMO route file and the configuration file are the following:
<routes>
<vType id="type1">
<carFollowing-CC tauEngine="0.5" omegaN="0.2" xi="1" c1="0.5" decel="9" lanesCount="4" ccAccel="1.5"/>
</vType>
<vType id="type2">
<carFollowing-CC tauEngine="0.5" omegaN="0.2" xi="1" c1="0.5" decel="9" lanesCount="4" ccAccel="1.5"/>
</vType>
<route id="route0" edges="0to1 1to2 2to3"/>
<route id="route1" edges="0to1 1to2 2to5"/>
<vehicle id="car0" route="route0" depart="0.0" type="type1" departSpeed="max" departLane="0"/>
<vehicle id="car1" route="route0" depart="0.2" type="type2" departSpeed="max" departLane="1"/>
<vehicle id="car2" route="route1" depart="0.4" type="type1" departSpeed="max" departLane="0"/>
<vehicle id="car3" route="route0" depart="0.6" type="type2" departSpeed="max" departLane="1"/>
<vehicle id="car4" route="route0" depart="0.8" type="type1" departSpeed="max" departLane="0"/>
<vehicle id="car5" route="route0" depart="1.0" type="type2" departSpeed="max" departLane="1"/>
</routes>
<configuration>
<input>
<net-file value="example.net.xml"/>
<route-files value="example.rou.xml"/>
</input>
<time>
<step-length value="0.1"/>
</time>
<gui_only>
<start value="true"/>
</gui_only>
</configuration>
This scenario can be simulated using the same command as the one in a previous message. This command was python simulator.py -c example.sumo.cfg -g -ef 1to2 2to3 -vf type1 type2 -pl 8
. I can simulate this scenario without errors.
Hi,
The link you provided to download Plexe-SUMO is not working. https://github.com/michele-segata/sumo/tree/plexe-sumo-0.32.0
Is there any other way to download Plexe-SUMO 0.32.0? Looking forward to your reply.
Hi,
If you check the link in the README of PERMIT, the Michele Segata link is not used anymore. I forked Plexe-SUMO and now the link points to my own Plexe-SUMO repository. The new link is: https://github.com/susomena/plexe-sumo.
I am using the same link you just mentioned. But still, get this error: platooning.py", line 143, in communicate (l_v, l_a, l_u, l_x, l_y, l_t) = cc.unpack(leader_data) ValueError: too many values to unpack (expected 6)
Have you changed your SUMO_HOME environment variable to the new SUMO location? It seems that it is still pointing to the previous SUMO location. PERMIT should work fine with the Plexe-SUMO version in my repo.
I am a bit confused with SUMO_HOME and Plexe_SUMO. Once I set my environment variable by appending ";C:\Program Files\sumo-1.6.0\bin" to the path according to the instructions here: https://sumo.dlr.de/docs/Basics/Basic_Computer_Skills.html Should I change it again to use Plexe_SUMO?
Yes, anytime you use a different SUMO version you have to change the SUMO_HOME environment variable to point to the location of the SUMO version you want to use.
I did so:
If you still get that error then your SUMO_HOME variable is not pointing to the correct folder. I just tested it in my computer and it works fine. Are you compiling the Plexe-SUMO version from my repo? Or you are just cloning it?
Just cloned it.
There you have it, the repo only contains code, you have to compile it before you can use it. I guess you cloned the repo in the same directory as another SUMO version, then, you always had the same SUMO executable.
I tried to follow the instruction (https://sumo.dlr.de/docs/Installing/Windows_Build.html#doing_everything_inside_visual_studio_2017_or_later) to compile the codes using Visual Studio 2019. But when downloading SUMOlibraries it fails since it finds a virus! Not sure if I am following the right instruction though!
I have never compiled SUMO in Windows, so I cannot help you with that. However, those libraries are uploaded to GitHub by DLR, so they shoul be free of viruses. That link with instructions for building SUMO in Windows are the official instructions, so you are right.
This is very strange. I tried to clone SUMO libraries using Git webpage, Git desktop, and also Visual Studio. All of them failed because of the virus (Trojan.TR/Patched.Gen) and the system deletes everything as soon as it finds the virus. Anyway, thanks for the explanations.
I recommend to use Linux for SUMO if you can. SUMO compilation is easier in Linux and it is the operastive system I used for developing PERMIT, so it should work.
Hi, how can I make cars split? I try to change the route of car4, the car leaves, however, error occurs:
traci.exceptions.TraCIException: Vehicle 'car4' does not support carFollowModel
It seems that traci thinks car4 leave the platoon ahead of time. Hi @omgbu I am having the same issue.
Where you ever able to make this library work? Thanks!
hey!, i am getting this error plexe-sumo-master (1)/plexe-sumo-master/platooning.py", line 142, in communicate (l_v, l_a, l_u, l_x, l_y, l_t) = cc.unpack(leader_data) ValueError: need more than 0 values to unpack
how to resolve it.
I also encountered the same problem, I get the same error:
platooning.py", line 143, in communicate (l_v, l_a, l_u, l_x, l_y, l_t) = cc.unpack(leader_data) ValueError: too many values to unpack (expected 6) Error: tcpip::Socket::recvAndCheck @ recv: peer shutdown Quitting (on error).
Question: 'SUMO_HOME' means sumo_plexe or sumo ? Thanks!