Re: [sumo-user] Pedestrain crossing IDs, Pedestrian XY coordinates information using TraCI

2019-12-11 Thread Jakob Erdmann
After subscribing, you need to perform another simulation step to receive
subscription results.

Am Mi., 11. Dez. 2019 um 13:45 Uhr schrieb Mohsin Memon <
mohsin.l...@gmail.com>:

> Hi Jakob,
>
> I want to use context subscription to get all pedestrians around the
> vehicle
> in a radius. I tried the following code but unfortunately I am not getting
> any pedestrians values in subscription results.
>
> I have already added one crossing into the sumo network and generated
> random
> pedestrians using randomtrips.py. What changes should I make in my code in
> order to detect pedestrians in font of my ego vehicle.
>
> Here is my matlab code below:
>
>
> vehID = '1060';
> traci.simulationStep()
>
> traci.vehicle.subscribeContext(vehID,traci.constants.CMD_GET_PERSON_VARIABLE,100
> {traci.constants.VAR_LANEPOSITION,traci.constants.VAR_SPEED});
> M = traci.vehicle.getContextSubscriptionResults(vehID);
> key = keys(M);
>
> I would be very much grateful if you please let me know the correct
> procedure to get all the pedestrians around my ego vehicle or in front of
> my
> ego vehicle in a radius.
>
>
> Thanks and regards,
> Mohammed Mohsin Memon
>
>
>
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] Pedestrain crossing IDs, Pedestrian XY coordinates information using TraCI

2019-12-11 Thread Mohsin Memon
Hi Jakob,

I want to use context subscription to get all pedestrians around the vehicle
in a radius. I tried the following code but unfortunately I am not getting
any pedestrians values in subscription results.

I have already added one crossing into the sumo network and generated random
pedestrians using randomtrips.py. What changes should I make in my code in
order to detect pedestrians in font of my ego vehicle.

Here is my matlab code below:


vehID = '1060';
traci.simulationStep()
traci.vehicle.subscribeContext(vehID,traci.constants.CMD_GET_PERSON_VARIABLE,100
{traci.constants.VAR_LANEPOSITION,traci.constants.VAR_SPEED});
M = traci.vehicle.getContextSubscriptionResults(vehID);
key = keys(M);

I would be very much grateful if you please let me know the correct
procedure to get all the pedestrians around my ego vehicle or in front of my
ego vehicle in a radius.


Thanks and regards,
Mohammed Mohsin Memon






--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] Pedestrain crossing IDs, Pedestrian XY coordinates information using TraCI

2019-12-04 Thread Jakob Erdmann
Hello,
It's not straight- forward to retrieve this information.
Option 1:
- use context subscription to get all pedestrians around the vehicle in a
radius. Then do your own filtering

Option 2:
- retrieve the list of lanes that the vehicle will drive using
traci.vehicle.getBestLanes(vehID)[traci.vehicle.getLaneIndex(vehID)][-1]
- retrieve the internal lanes that the vehicle will drive using
traci.lane.getLinks(laneID, True) for each of the upcoming lanes
   if there are multiple connections from a lane, you need to pick the
connection that targets the subsequent lane the vehicle wants to drive
   (target lane and internal lane are all in the resulting list of tuples)
- for each of the upcoming internal lanes, call traci.lane.getInternalFoes.
This will return all internal lanes which are in conflict with the vehicle
- from these foes retrieve the ones that have '_c' in their name. These are
crossings
- for each of the crossings you can get the pedestrians using
traci.edge.getLastStepPersonIDs(traci.lane.getEdgeID(crossingID))
- for each person you can get its position using traci.person.getPosition

regards,
Jakob

Am Di., 3. Dez. 2019 um 11:51 Uhr schrieb Mohsin Memon <
mohsin.l...@gmail.com>:

> Hello All,
> I have developed a scenario in SUMO, in which, the pedestrians have been
> generated randomly using randomtrips.py and are moving along the sidewalks
> and are crossing a priority zebra crossing. My ego-vehicle in SUMO halts in
> front of the zebra crossing after detecting walking pedestrians.
> I would like to obtain the following information using TraCI,
> 1)  Immediate zebra crossing ID
> 2)  Pedestrian ID’s walking on that corresponding crossing
> 3)  Pedestrian X,Y co-ordinates and velocity
> I have tried the functions mentioned in this example, but was unsuccessful
> in obtaining the above
> information(https://sumo.dlr.de/docs/Tutorials/TraCIPedCrossing.html).
> I am using traci4matlab as my interface with SUMO. I would be grateful if
> you could please suggest me which functions would be appropriate to be used
> to solve my problem?
>
>
> Regards,
> Mohsin Memon
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


[sumo-user] Pedestrain crossing IDs, Pedestrian XY coordinates information using TraCI

2019-12-03 Thread Mohsin Memon
Hello All, 
I have developed a scenario in SUMO, in which, the pedestrians have been
generated randomly using randomtrips.py and are moving along the sidewalks
and are crossing a priority zebra crossing. My ego-vehicle in SUMO halts in
front of the zebra crossing after detecting walking pedestrians.
I would like to obtain the following information using TraCI, 
1)  Immediate zebra crossing ID
2)  Pedestrian ID’s walking on that corresponding crossing
3)  Pedestrian X,Y co-ordinates and velocity 
I have tried the functions mentioned in this example, but was unsuccessful
in obtaining the above
information(https://sumo.dlr.de/docs/Tutorials/TraCIPedCrossing.html).
I am using traci4matlab as my interface with SUMO. I would be grateful if
you could please suggest me which functions would be appropriate to be used
to solve my problem?


Regards,
Mohsin Memon



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user