Replies: 4 comments 7 replies
-
|
Hey @phil-hei, could you extend a little bit on your question, also example configuration always help. Alternatively, there is the option to "close" lanes using TMC's Lastly, if you just want a static obstacle throughout the simulation, there is the option of placing a halting vehicle (see for example here), which will be evaded by other vehicles automatically. I hope these ideas help you to solve your issue, please feel free to elaborate! |
Beta Was this translation helpful? Give feedback.
-
|
I found a thread in the SUMO mailing list which suggests to just add a vehicle and stop it immediately at their spawn position to mimic an obstacle that other vehicles can react to and overtake it. You can either do that the "right" way, by adding a specific application which stops a vehicle as soon as it spawns, or by "hacking" the SumoAmbassador. By spawning a vehicle and using a custom application which stops the vehicle (might not be accurate enough): or by spawning a specific vehicle of type "Obstacle" and then adjusting the SumoAmbassador in line 302: - bridge.getSimulationControl().addVehicle(vehicleId, routeId, vehicleType, laneId, departPos, departSpeed);
+ if (vehicleType.equals("Obstacle")) {
+ bridge.getSimulationControl().addVehicle(vehicleId, routeId, vehicleType, laneId, departPos, "0");
+ bridge.getVehicleControl().stop(vehicleId, routes.get(routeId).getConnectionIds().iterator().next(), vehicleRegistration.getDeparture().getDeparturePos(), vehicleRegistration.getDeparture().getDepartureLane(), Long.MAX_VALUE, VehicleStopMode.STOP);
+} else {
+ bridge.getSimulationControl().addVehicle(vehicleId, routeId, vehicleType, laneId, departPos, departSpeed);
+} |
Beta Was this translation helpful? Give feedback.
-
|
Just an update: The position are more or less on the road, but at least close by and for the first this is sufficient. In this direction I wonder if the API for the in-vehicle application has changed as the Weather Warning Apps example is not working in 25.0 anymore? For example, |
Beta Was this translation helpful? Give feedback.
-
|
I have a follow-up question regarding the different sensor types provided. What is the actual purpose? For example, if I have Or is there a general sensor that react to all kind of events no matter what they are called as soon as the vehicle pass by? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I just wonder if there is an (easy) way to make sure that environment events, such as an obstacle, are placed on the road network so that vehicle can pass them by. Example: I have a defined simulation area where I want to generate random obstacles on the road. I'm able to generate this events within the simulation area, but haven't found a suitable way to ensure that they are on the road network.
Beta Was this translation helpful? Give feedback.
All reactions