Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Controlling the lateral alignment via TraCI

getting the leader and follower vehicles on a neighboring lanes is currently not well supported by traci. We'll probably add functions to that end in the near future.
Until then your best approach is to
1) determine the id of the neighboring lane
2) iterate over all vehicles on that lane and determine of some of them have a position that is close enough to the ego vehicle to count as "parallel"
3) check their type
4) if the type matches, call setLatAlignment on the ego vehicle

The problematic cases are those where the ego vehicle is close to the start or end of its lane and the surrounding vehicles must be found on other edges. (the severety of this depends on your definition of "parallel")

regards,
Jakob

2018-07-16 19:03 GMT+02:00 Umair Durrani <durraniu@xxxxxxxxxxx>:
Thank you Jakob.

This is a request to the community to please provide any examples of manipulating vtype behavior using TraCI based on some condition. I have a particular problem about controlling the lateral alignment, but an example would help me to write the appropriate code. My problem is explained below.

So, the condition that I want to specify is this: Check the class of the vehicle which is parallel to a particular car (ID = "EXT") in the neighboring lane.  If the class is a "trailer" then change the lateral alignment of the "EXT" car, otherwise, keep the alignment at the default value.  

Parallel is arbitrary so I want to specify that any part of the neighboring vehicle is within the range equal to length + 5 meters of "EXT" (or any other helpful rule).

I have found getLaneIndex(), setLatAlignment(), getLanePosition(), etc. functions in traci module that are helpful. Now I'm trying to use an if else statement to write this rule. But am not successful so far. Any ideas are welcome. Thanks in advance.

best regards,
Umair Durrani 
Ph.D. Candidate
Civil and Environmental Engineering

On Sun, Jul 15, 2018 at 9:28 AM, Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:
Hello,
currently, you can only do this via TraCI by checking the condition yourself and then setting the alignment parameter or lateral change explicitly.
regards,
Jakob

2018-07-13 17:42 GMT+02:00 Umair Durrani <durraniu@xxxxxxxxxxx>:
Hi,

Is it possible to programmatically change the lateral alignment (and other parameters of sublane model) via TraCI using some condition? For instance, I want to align the vehicle to the left when overtaking a truck but keep it center aligned when overtaking a car.

best regards,
Umair Durrani 
Ph.D. Candidate
Civil and Environmental Engineering

_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user



_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user



_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user



Back to the top