michele-segata / plexe-pyapi Goto Github PK
View Code? Open in Web Editor NEWPython APIs to control Plexe models in SUMO
Python APIs to control Plexe models in SUMO
Hi Michele:
Recently, I used the plexe-pyapi tool to simulate more complex traffic scenario, but some errors and problems confused me.
Problems descriptions:
I simulate a bottleneck sceneriao which contains Autonomous Vehicles(AV) and Human Driven Vehicles(HDV):
1)AV: CC-cfmodel vehicles (ACC OR CACC) ; 2)HDV: Wideman99
When I use the plexe-pyapi tool to form AV platoons(set the CC vehicles to CACC model) dynamicly during simulation running,
some longcollisions occur:
In addition to the collision, it seems that the CACC platooning vehicles will ignore the right of ways in junctions, and the platooning vehicles can't wait other vehicles which have the potential conflict with them, and they drive agressively and collisions occur in junction.
Note:
PATH_CACC and plog_CACC are used. Both have the above problems.
The SUMO1.8.0, ubuntu 18, python3.7 are used.
Hello, thanks for this library.
I am trying to run joindemo.py:
$python /home/alpha/plexe-pyapi/examples/joindemo.py
I get the following error:
Retrying in 1 seconds
Loading configuration... done.
No Plexe API implementation found for SUMO UNKNOWN
Traceback (most recent call last):
File "/home/alpha/plexe-pyapi/examples/joindemo.py", line 217, in <module>
main(True, False)
File "/home/alpha/plexe-pyapi/examples/joindemo.py", line 159, in main
plexe = Plexe()
File "/home/alpha/plexe-pyapi/examples/plexe.py", line 110, in __init__
raise Exception()
Exception
Thank you very much!
Hello, developer, I want to let the team vehicles take over. I can't take over successfully using Traci.toc settings. How should it be implemented?
Hello author, the code you provided is very helpful to me, thank you very much!
In addition, I would like to ask if it is possible to implement the insertion of a platoon into another platoon based on the example you provided? Similar to joindemo, but the single vehicle becomes a platoon.
Hi. I want to create an intersection to test Platoon's influence. In the examples above I see only creating 1 Platoon going in a certain direction.
So is there a way to make multiple Platoons go in different directions? Thank you. I tried the code but it didn't work
Hello Michele,
I apologize for having so many questions. It seems that something got broken between my installation of PLEXE-VEINS and this PlexeAPI. My sense is that the error comes from the SUMO side, but I can't tell for sure, since SUMO seems to work.
I am able to run the PLEXE-VEINS example, on SUMO 1.6 (built from source). See screenshot below.
But when I try to use the API, I get the following messages:
(plexe) alpha@alpha:~/src/plexe-pyapi/examples$ python joindemo.py
Retrying in 1 seconds
Loading configuration ... done.
Traceback (most recent call last):
File "joindemo.py", line 217, in <module>
main(True, False)
File "joindemo.py", line 176, in main
topology = add_vehicles(plexe, N_VEHICLES, real_engine)
File "joindemo.py", line 75, in add_vehicles
50, 0, SPEED, DISTANCE, real_engine)
File "/home/alpha/src/plexe-pyapi/examples/utils.py", line 83, in add_platooning_vehicle
add_vehicle(plexe, vid, position, lane, speed, vtype)
File "/home/alpha/src/plexe-pyapi/examples/utils.py", line 64, in add_vehicle
typeID=vtype)
File "/usr/share/sumo/tools/traci/_vehicle.py", line 1444, in add
arrivalLane, arrivalPos, arrivalSpeed, fromTaz, toTaz, line, personCapacity, personNumber)
File "/usr/share/sumo/tools/traci/domain.py", line 184, in _setCmd
self._connection._sendCmd(self._cmdSetID, varID, objectID, format, *values)
File "/usr/share/sumo/tools/traci/connection.py", line 178, in _sendCmd
return self._sendExact()
File "/usr/share/sumo/tools/traci/connection.py", line 95, in _sendExact
raise TraCIException(err, prefix[1], _RESULTS[prefix[2]])
traci.exceptions.TraCIException: Invalid route 'platoon_route' for vehicle 'v.0'.
And the SUMO log:
Loading configuration ... done.
***Starting server on port 41585 ***
Loading net-file from 'cfg/freeway.net.xml' ... done (21ms).
Loading done.
Error: attribute 'departSpeed' is not declared for element 'vType'
In file 'cfg/freeway.rou.xml'
At line/column 11/29.
Quitting (on error).
Simulation started with time: 0.00
Error: Answered with error to command 0xc4: Invalid route 'platoon_route' for vehicle 'v.0'.
Error: tcpip::Socket::recvAndCheck @ recv: peer shutdown
Quitting (on error).
I have re installed this plexe-pyapi whith no luck. This library was working before I've compiled the PLEXE-VEINS one. Here is a screenshot of the plexe-veins library where you can see it running and the SUMO version on top.
The following is my SUMO information. I had to build it from source since installing the package 'osgearth' (and OpenSceneGraph) broke my vanilla installation.
(plexe) alpha@alpha:~/src/plexe-pyapi/examples$ sumo --version
Eclipse SUMO sumo Version v1_6_0+1506-2afc834eec
Build features: Linux-5.3.0-62-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG GDAL GL2PS
Hello. I want to change the model of "vtypeauto" to another model. But when I switch the model is faulty. This type must not be changed right?
Error: tcpip::Socket::recvAndCheck @ recv: peer shutdown
Quitting (on error).
hello, developer,I want the platoon vehicle to be released after reaching a certain road section. How should it be implemented?
Hi Michele,
This is Prashanth, PhD student in Network engineering from Polytechnic University of Catalonia (UPC), SPAIN. I'm using Plexe Instant 3.0 for creating platoon scenarios. Now I'm trying to use Plexe API for connecting TRACI with Plexe and alter the route, lanes and vehicle connections.
But while doing this everytime it is showing as "ModuleNotFoundError: No module named 'plexe'".
Could you please let me know how to resolve this issue. Below is the screenshot that tells the location of PlexeAPI.
Hi Michele.
The PlexeAPI seems a feasible option for me to generate custom platoon scenarios. I just wondering will there be an option for me to generate results for analysis. Will the PlexeAPI will be enhanced to results generation? or will you suggest me a lead for me to try out a way to generate the results? Thank you.
Regards,
Safras
Hello developers, in the demo case you gave, the vehicle driving path is not defined in the functions add_vehicles and add_platooning_vehicle for generating vehicles. If I now have a new route (already declared in the rou file), how can I set it on the new path for generating platoon vehicles?
I noticed that the lane-changing maneuvers in Plexe is the continuous lane-changing action, like the following:
The lane-changing action in the joindemo.py is decided by the function:
def set_fixed_lane(self, vid, lane, safe=True)
But I want to know what is the mechanism or logic of lane change by the function def set_fixed_lane(self, vid, lane, safe=True)
. For example, how much steering angle is implemented by the controller of this function.
And, another similar question exists in the function def enable_auto_lane_changing(self, vid, enable)
in demo of platoon-lane-change-test.py. What is the mechanism or logic of the auto lane-changing.
If anyone can give me an answer about the two questions, I would be greatly grateful.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.