shahriarHasan09 / PlatoonSAFE

GNU General Public License v2.0
4 stars 0 forks source link

Implementing Heterogenous Platooning #1

Open Sid9993 opened 7 months ago

Sid9993 commented 7 months ago

Hi there, can we implement heterogenous platooning with PlatoonSAFE? If so, can you assist with how we can do the same?

Gorospe commented 7 months ago

Hello,

With heterogeneous are you referring to multiple controllers in the same platoon or multiple communication interfaces?

Anyway, this PlatoonSAFE version is based on PLEXE 2.1, while those both features were implemented in 3.1. We are working on migrating everything to the newest PLEXE version, but we haven't integrated all our features yet.

Depending on what you want to implement, I can either share the version we are working on or assist you.

Sid9993 commented 7 months ago

Hello,

With heterogeneous are you referring to multiple controllers in the same platoon or multiple communication interfaces?

Anyway, this PlatoonSAFE version is based on PLEXE 2.1, while those both features were implemented in 3.1. We are working on migrating everything to the newest PLEXE version, but we haven't integrated all our features yet.

Depending on what you want to implement, I can either share the version we are working on or assist you.

By Heterogenous I meant abt different types of vehicles which can differ in length,speed etc.

Gorospe commented 7 months ago

Those parameters are configured same as in plexe. All vehicles in the platoon are the same type of vehicle (vtypeauto). If I am not wrong, you can change for example the length of them in freeway.rou.xml (Options available in SUMO).

<vType id="vtypeauto" accel="2.5" decel="9.0" sigma="0.5" length="4"** minGap="0" maxSpeed="1000" color="1,0,0" probability="1" speedFactor="2"
        carFollowModel="CC" tauEngine="0.5" omegaN="0.2" xi="1" c1="0.5" lanesCount="4" ccAccel="1.5" ploegKp="0.2" ploegKd="0.7" ploegH="0.5" />

Changing the sizes independently might be more tricky. I would suggest to check BaseScenario.h. Again, I am not sure, but i think that here is where the length of the vehicle is set up for sumo.

vehicleData.length = traciVehicle->getLength();

Regarding the speed, you configure the leaders speed, but the following platooning vehicles will adjust their speed based on the platoon controller they are using. The leader's behavior is implemented in the Scenario (there are several, such as sinusoidal scenario, where the speed is changed as a sin function). You have some examples of how to configure them in the .ini file. You could also implement a new scenario if needed.

Sid9993 commented 7 months ago

Hello, With heterogeneous are you referring to multiple controllers in the same platoon or multiple communication interfaces? Anyway, this PlatoonSAFE version is based on PLEXE 2.1, while those both features were implemented in 3.1. We are working on migrating everything to the newest PLEXE version, but we haven't integrated all our features yet. Depending on what you want to implement, I can either share the version we are working on or assist you.

By Heterogenous I meant abt different types of vehicles which can differ in length,speed etc.

Yea u r ryt. Its in BaseScenario.h but how can I change the length there or what I can do in order to run the sinusoidal scenario and braking scenario with different vehicles varying in lengths

Gorospe commented 7 months ago

It is not even close to be a clean solution, but if you just want to do some simulations, maybe you can include a vector with the lengths in BaseScenario.h (initialized either from the ini file or as a constant vector), and then, instead of setting the length like:

vehicleData.length = traciVehicle->getLength();

You could try to do something like:

vehicleData.length = yourVector[positionHelper->getPosition()];

My doubt then would be if this "traciVehicle->getLength();" is used somewhere else and then the lengths are mixed. I think it is used in BaseProtocol.cc while creating beacon messages.

I have no idea on how the proper implementation would be. I guess you will have to implement a new trafficManager, like in PlatoonsTrafficManager. Maybe change something in freeway.rou.xml to have different type of vehicles (with different lengths), and then include all of them in PlatoonsTrafficManager.insertPlatoon();