Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #create subject in SUMO
- traci.person.add("subject", "CL", 80)
- traci.person.appendWalkingStage("subject", ["CL", "RC"], 60)
- #new iteration in SUMO
- traci.simulationStep()
- while traci.simulation.getMinExpectedNumber() > 0:
- #receive subject position from Unity
- message = socket.recv()
- subject = json.loads(message)
- #move subject to new position
- traci.person.moveToXY("subject", subject.edge, subject.x, subject.y, angle=subject.angle, keepRoute=3)
- #send position information of other pedestrians and vehicles to Unity
- send = sumoDataToUnity()
- socket.send_string(send)
- #new iteration in SUMO
- traci.simulationStep()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement