Replies: 1 comment
-
Hey @yibork, final VehicleRoute vehicleRoute;
try {
vehicleRoute = SimulationKernel.SimulationKernel.getCentralNavigationComponent().getRouting().createRouteForRTI(<YourCandidateRoute>);
} catch (IllegalRouteException e) {
throw new RuntimeException(e);
}
VehicleRouteRegistration routeRegistration = new VehicleRouteRegistration(
getOs().getSimulationTime(),
vehicleRoute
);
getOs().sendInteractionToRti(routeRegistration);
VehicleRegistration vehicleRegistration = new VehicleRegistration(
getOs().getSimulationTime(),
UnitNameGenerator.nextVehicleName(),
null,
Lists.newArrayList(
<YourApp>.class.getCanonicalName()
),
new VehicleDeparture.Builder(<Your.getId())
.departureLane(VehicleDeparture.LaneSelectionMode.FIRST, 0, 0)
.departureSpeed(VehicleDeparture.DepartureSpeedMode.MAXIMUM, 0)
.create(),
<YourVehicleType>
);
getOs().sendInteractionToRti(vehicleRegistration); Furthermore, then you could control the vehicles either by using V2X-Messages or by directly using TraCI-commands using the respective API (see https://github.com/eclipse/mosaic/blob/main/app/tutorials/example-applications/src/main/java/org/eclipse/mosaic/app/tutorial/traci/SumoTraciInteractionApp.java and https://sumo.dlr.de/docs/TraCI/Change_Vehicle_State.html). I hope this gives you an initial starting point. Feel free to ask ahead if further questions arise! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am wondering if it is possible to have a single vehicle class that manages other vehicles. In other words, in Mosaic Mapping, I would declare the vehicle manager as a Vehicle which is a java application, and this manager would create different vehicles, assign positions to them, and also be responsible for controlling them.
Beta Was this translation helpful? Give feedback.
All reactions