Commit 8bed4bb0 authored by Robert Meyer's avatar Robert Meyer
Browse files

new bus setup

parent 8b9ffe6f
Pipeline #186497 failed with stage
in 1 minute and 13 seconds
...@@ -14,12 +14,14 @@ import sensors.StaticPlannedTrajectoryYSensor; ...@@ -14,12 +14,14 @@ import sensors.StaticPlannedTrajectoryYSensor;
import simulation.EESimulator.DirectModelAsEEComponent; import simulation.EESimulator.DirectModelAsEEComponent;
import simulation.EESimulator.EEComponent; import simulation.EESimulator.EEComponent;
import simulation.EESimulator.EESimulator; import simulation.EESimulator.EESimulator;
import simulation.bus.FlexRay;
import simulation.bus.InstantBus; import simulation.bus.InstantBus;
import simulation.simulator.Simulator; import simulation.simulator.Simulator;
import de.rwth.monticore.EmbeddedMontiArc.simulators.hardware_emulator.HardwareEmulatorInterface; import de.rwth.monticore.EmbeddedMontiArc.simulators.hardware_emulator.HardwareEmulatorInterface;
import simulation.vehicle.*; import simulation.vehicle.*;
import sensors.*; import sensors.*;
import java.time.Duration;
import java.time.Instant; import java.time.Instant;
import java.util.*; import java.util.*;
...@@ -59,10 +61,15 @@ public class VehicleBuilder { ...@@ -59,10 +61,15 @@ public class VehicleBuilder {
public void createVehicle(VehicleConfig config, MapData map) throws Exception { public void createVehicle(VehicleConfig config, MapData map) throws Exception {
EESimulator eeSim = new EESimulator(Instant.EPOCH); EESimulator eeSim = new EESimulator(Instant.EPOCH);
EEVehicleBuilder eeVehicleBuilder = new EEVehicleBuilder(eeSim); EEVehicleBuilder eeVehicleBuilder = new EEVehicleBuilder(eeSim);
InstantBus bus = new InstantBus(eeSim); InstantBus sensorBus = new InstantBus(eeSim);
eeVehicleBuilder.createControllerSensors(bus); InstantBus actuatorBus = new InstantBus(eeSim);
eeVehicleBuilder.createMassPointActuators(bus); FlexRay controllerBus = new FlexRay(eeSim);
eeVehicleBuilder.createController(model_server, config.autopilot_config, bus); eeVehicleBuilder.connectBuses(sensorBus, controllerBus, Duration.ofMillis(1));
eeVehicleBuilder.connectBuses(actuatorBus, controllerBus, Duration.ofMillis(1));
eeVehicleBuilder.createControllerSensors(sensorBus);
eeVehicleBuilder.createMassPointActuators(actuatorBus);
DirectModelAsEEComponent controller = eeVehicleBuilder.createController(model_server, config.autopilot_config, controllerBus);
//controller.setCycleTime(bus.getCycleTime());
PhysicalVehicleBuilder physicalVehicleBuilder = getVehicleBuilder(config.physics_model); PhysicalVehicleBuilder physicalVehicleBuilder = getVehicleBuilder(config.physics_model);
Vehicle simVehicle = new Vehicle(physicalVehicleBuilder ,eeVehicleBuilder); Vehicle simVehicle = new Vehicle(physicalVehicleBuilder ,eeVehicleBuilder);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment