Aufgrund einer Störung des s3 Storage, könnten in nächster Zeit folgende GitLab Funktionen nicht zur Verfügung stehen: LFS, Container Registry, Job Artifacs, Uploads (Wiki, Bilder, Projekt-Exporte). Wir bitten um Verständnis. Es wird mit Hochdruck an der Behebung des Problems gearbeitet. Weitere Informationen zur Störung des Object Storage finden Sie hier: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/59-object-storage-pilot

Commit 69948b3e authored by Hengwen Zhang's avatar Hengwen Zhang
Browse files

Merge branch 'master' into feature-vehicle-task

# Conflicts:
#	pom.xml
parents dfbdce49 bef97194
Pipeline #362526 failed with stage
in 53 seconds
......@@ -13,10 +13,11 @@ public class JavaAutopilotProperties extends BusUserProperties {
public static final String TYPE = "java_autopilot";
public Duration compute_time = Duration.ZERO;
public transient double maxVehicleAccel;
public double maxVehicleAccel; // TODO get from properties system
public JavaAutopilotProperties(double maxVehicleAccel) {
this.maxVehicleAccel = maxVehicleAccel;
this.name = "JavaAutopilot";
}
protected JavaAutopilotProperties() {
......
......@@ -15,7 +15,8 @@ public class TestAutopilotProperties extends BusUserProperties {
public static enum Mode {
@JsonEntry("circle")
CIRCLE, @JsonEntry("start_stop")
CIRCLE,
@JsonEntry("start_stop")
START_STOP
}
......
......@@ -30,12 +30,13 @@ public class Navigation extends EEComponent {
// Might give less points if almost at target (or none if at target)
public static final String TRAJECTORY_X_MSG = "trajectory_x";
public static final String TRAJECTORY_Y_MSG = "trajectory_y";
public static final String TRAJECTORY_LENGTH_MSG = "trajectory_length";
public static final String TRAJECTORY_LON_MSG = "trajectory_lon";
public static final String TRAJECTORY_LAT_MSG = "trajectory_lat";
public static final BasicType AT_TARGET_POS_TYPE = BasicType.BOOLEAN;
public static final BasicType CURRENT_TARGET_POS_TYPE = BasicType.VEC2;
public static final VectorType TRAJECTORY_X_TYPE = new VectorType(BasicType.DOUBLE, 128);
public static final VectorType TRAJECTORY_X_TYPE = new VectorType(BasicType.DOUBLE, 10);
public static final VectorType TRAJECTORY_Y_TYPE = TRAJECTORY_X_TYPE;
public static final VectorType TRAJECTORY_LON_TYPE = TRAJECTORY_X_TYPE;
public static final VectorType TRAJECTORY_LAT_TYPE = TRAJECTORY_X_TYPE;
......@@ -51,6 +52,7 @@ public class Navigation extends EEComponent {
transient MessageInformation trajectoryXMsg;
transient MessageInformation trajectoryYMsg;
transient MessageInformation trajectoryLengthMsg;
transient MessageInformation trajectoryLonMsg;
transient MessageInformation trajectoryLatMsg;
......@@ -78,6 +80,7 @@ public class Navigation extends EEComponent {
this.trajectoryXMsg = addOutput(TRAJECTORY_X_MSG, TRAJECTORY_X_TYPE);
this.trajectoryYMsg = addOutput(TRAJECTORY_Y_MSG, TRAJECTORY_Y_TYPE);
this.trajectoryLengthMsg = addOutput(TRAJECTORY_LENGTH_MSG, BasicType.N);
this.trajectoryLonMsg = addOutput(TRAJECTORY_LON_MSG, TRAJECTORY_LON_TYPE);
this.trajectoryLatMsg = addOutput(TRAJECTORY_LAT_MSG, TRAJECTORY_LAT_TYPE);
}
......@@ -154,6 +157,7 @@ public class Navigation extends EEComponent {
y[i] = p.trajectoryY[index+i];
}
sendMessage(time, trajectoryXMsg, x, 8*size);
sendMessage(time, trajectoryLengthMsg, size);
sendMessage(time.plus(Duration.ofMillis(10)), trajectoryYMsg, y, 8*size);
}
......
......@@ -11,7 +11,7 @@ public class NavigationProperties extends BusUserProperties {
public static final String TYPE = "navigation";
public NavigationProperties() {
this.name = "DefaultNavigation";
this.name = "Navigation";
}
public NavigationProperties setName(String name) {
......
......@@ -18,7 +18,7 @@ public class ActuatorProperties extends BusUserProperties {
public String physical_value_name;
public double change_rate;
public double change_rate = Double.POSITIVE_INFINITY;
@JsonEntry("sensor")
public Optional<SensorProperties> sensorProperties;
......
......@@ -13,6 +13,10 @@ import de.rwth.montisim.simulation.eesimulator.components.EEEventProcessor;
public class ConstantBusProperties extends BusProperties {
public static final String TYPE = "constant_bus";
ConstantBusProperties() {
this.name = "DefaultBus";
}
public enum TransmissionMode {
/** Messages directly reach their target when sent. */
@JsonEntry("instant")
......@@ -25,7 +29,7 @@ public class ConstantBusProperties extends BusProperties {
CONSTANT_TIME
}
public TransmissionMode mode;
public TransmissionMode mode = TransmissionMode.INSTANT;
/**
* If TransmissionMode.CONSTANT_RATE, contains the transmission rate in
......
......@@ -4,8 +4,8 @@ package de.rwth.montisim.simulation.eesimulator;
import org.junit.Assert;
import org.junit.Test;
import de.rwth.montisim.commons.dynamicinterface.ArrayType;
import de.rwth.montisim.commons.dynamicinterface.BasicType;
import de.rwth.montisim.commons.dynamicinterface.VectorType;
import de.rwth.montisim.commons.eventsimulation.DiscreteEventSimulator;
import de.rwth.montisim.simulation.eesimulator.bridge.Bridge;
import de.rwth.montisim.simulation.eesimulator.bridge.BridgeProperties;
......@@ -138,7 +138,7 @@ public class SetupErrorsTest {
++errorsFound;
}
try {
c3.addInput("m1", new ArrayType(BasicType.INT, 5));
c3.addInput("m1", new VectorType(BasicType.INT, 5));
} catch (EEMessageTypeException e){
++errorsFound;
}
......
......@@ -7,7 +7,6 @@ import java.util.Vector;
import de.rwth.montisim.commons.map.Pathfinding;
import de.rwth.montisim.commons.simulation.*;
import de.rwth.montisim.commons.utils.json.Json;
import de.rwth.montisim.commons.utils.json.SerializationException;
import de.rwth.montisim.simulation.eecomponents.autopilots.JavaAutopilotProperties;
import de.rwth.montisim.simulation.eecomponents.autopilots.TestAutopilotProperties;
import de.rwth.montisim.simulation.eecomponents.navigation.NavigationProperties;
......@@ -174,14 +173,9 @@ public class Simulator implements ISimulator, Updatable {
}
static {
try {
Json.registerType(NavigationProperties.class);
Json.registerType(JavaAutopilotProperties.class);
Json.registerType(TestAutopilotProperties.class);
} catch (SerializationException e) {
e.printStackTrace();
System.exit(-1);
}
Json.registerType(NavigationProperties.class);
Json.registerType(JavaAutopilotProperties.class);
Json.registerType(TestAutopilotProperties.class);
}
public Vector<Updatable> getUpdatables() {
......
......@@ -25,7 +25,6 @@ public class PhysicsDebug extends JFrame implements SimulationRunner {
}
private static final Vec3 START_DIR = new Vec3(1, 0, 0);
private static final Vec3 START_CROSS = new Vec3(0, 1, 0);
private static final long serialVersionUID = 1L;
......
......@@ -3,7 +3,6 @@ package de.rwth.montisim.simulation.simulator.visualization;
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.event.*;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
......
......@@ -3,18 +3,11 @@ package de.rwth.montisim.simulation.simulator.visualization.plotter;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import javax.swing.JPanel;
......@@ -88,8 +81,8 @@ public class TimePlotter extends JPanel {
private int drawLegend(Graphics2D g) {
// Get legend size
final int height = g.getFont().getSize();
final int offset = height + UIInfo.LINE_SPACE;
//final int height = g.getFont().getSize();
//final int offset = height + UIInfo.LINE_SPACE;
int size = 0;
// Draw legend
return size;
......
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.simulator.visualization.ui;
import java.time.Instant;
import de.rwth.montisim.commons.simulation.Updatable;
public interface SimulationRunner extends Updatable {
......
......@@ -24,13 +24,13 @@ import de.rwth.montisim.commons.utils.*;
*/
public class Viewer2D extends JPanel implements MouseInputListener, MouseWheelListener {
private static final long serialVersionUID = 4687042051904715366L;
private static final ImageIcon a;
static {
java.net.URL imgURL = Control.class.getResource("/images/a.gif");
if (imgURL != null)
a = new ImageIcon(imgURL);
else a = null;
}
// private static final ImageIcon a;
// static {
// java.net.URL imgURL = Control.class.getResource("/images/a.gif");
// if (imgURL != null)
// a = new ImageIcon(imgURL);
// else a = null;
// }
private static final DecimalFormat format = new DecimalFormat("##0.00",
DecimalFormatSymbols.getInstance(Locale.ENGLISH));
......
......@@ -137,12 +137,7 @@ public class VehicleBuilder {
}
static {
try {
Json.registerType(ElectricalPTProperties.class);
Json.registerType(FuelPTProperties.class);
} catch (SerializationException e) {
e.printStackTrace();
System.exit(-1);
}
Json.registerType(ElectricalPTProperties.class);
Json.registerType(FuelPTProperties.class);
}
}
\ No newline at end of file
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.vehicle.physicalvalues;
import de.rwth.montisim.commons.dynamicinterface.BasicType;
import de.rwth.montisim.commons.dynamicinterface.DataType;
import de.rwth.montisim.commons.physicalvalue.PhysicalValueDouble;
import de.rwth.montisim.commons.simulation.*;
import de.rwth.montisim.commons.utils.*;
......
Markdown is supported
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