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