Aufgrund einer Wartung wird GitLab am 18.01. zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 18.01. between 8:00 and 9:00 am.

Commit 94269565 authored by Jean Meurice's avatar Jean Meurice
Browse files

License Headers, Imports clean

parent e6f49c1d
#
# (c) https://github.com/MontiCore/monticore
#
# The license generally applicable for this project
# can be found under https://github.com/MontiCore/monticore.
#
stages:
......
# (c) https://github.com/MontiCore/monticore
script:
- git checkout ${TRAVIS_BRANCH}
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install cobertura:cobertura org.eluder.coveralls:coveralls-maven-plugin:report --settings "settings.xml"
......
@REM
@REM (c) https://github.com/MontiCore/monticore
@REM
@REM The license generally applicable for this project
@REM can be found under https://github.com/MontiCore/monticore.
@REM
mvn clean install -DskipTests -s settings.xml
(c) https://github.com/MontiCore/monticore
The license generally applicable for this project
can be found under https://github.com/MontiCore/monticore.
\ No newline at end of file
(c) https://github.com/MontiCore/monticore
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
(c) https://github.com/MontiCore/monticore
The license generally applicable for this project
can be found under https://github.com/MontiCore/monticore.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.eecomponents.navigation;
import java.time.Duration;
import java.time.Instant;
import java.util.Optional;
import java.util.Stack;
import de.rwth.montisim.commons.dynamicinterface.ArrayType;
import de.rwth.montisim.commons.dynamicinterface.DataType;
import java.time.*;
import java.util.*;
import de.rwth.montisim.commons.dynamicinterface.*;
import de.rwth.montisim.commons.dynamicinterface.ArrayType.Dimensionality;
import de.rwth.montisim.commons.utils.IPM;
import de.rwth.montisim.commons.utils.Vec2;
import de.rwth.montisim.simulation.environment.pathfinding.Path;
import de.rwth.montisim.simulation.environment.pathfinding.Pathfinding;
import de.rwth.montisim.commons.utils.*;
import de.rwth.montisim.simulation.environment.pathfinding.*;
import de.rwth.montisim.simulation.vehicle.physicalvalues.TruePosition;
import de.rwth.montisim.simulation.eesimulator.components.EEComponent;
import de.rwth.montisim.simulation.eesimulator.components.EEComponentType;
import de.rwth.montisim.simulation.eesimulator.components.*;
import de.rwth.montisim.simulation.eesimulator.events.MessageReceiveEvent;
import de.rwth.montisim.simulation.eesimulator.exceptions.EEMessageTypeException;
import de.rwth.montisim.simulation.eesimulator.message.Message;
import de.rwth.montisim.simulation.eesimulator.message.MessageInformation;
import de.rwth.montisim.simulation.eesimulator.message.*;
// TODOS:
// Send Empty "Overwrite" trajectory on errors
// Only send trajectory every X seconds
public class Navigation extends EEComponent {
public static final String GPS_POS_MSG = "gps_pos";
//public static final String GPS_POS_MSG = "gps_pos";
public static final String PUSH_TARGET_POS_MSG = "push_target_pos";
public static final String POP_TARGET_POS_MSG = "push_target_pos";
public static final String POP_TARGET_POS_MSG = "pop_target_pos";
public static final String AT_TARGET_POS_MSG = "at_target_pos";
public static final String CURRENT_TARGET_POS_MSG = "current_target_pos";
......@@ -53,7 +40,7 @@ public class Navigation extends EEComponent {
public static final DataType TRAJECTORY_LON_TYPE = TRAJECTORY_X_TYPE;
public static final DataType TRAJECTORY_LAT_TYPE = TRAJECTORY_X_TYPE;
MessageInformation gpsPosMsg;
//MessageInformation gpsPosMsg;
MessageInformation truePosMsg;
MessageInformation pushTargetPosMsg;
......@@ -80,11 +67,11 @@ public class Navigation extends EEComponent {
@Override
protected void init() throws EEMessageTypeException {
this.gpsPosMsg = addInput(GPS_POS_MSG, DataType.VEC2);
//this.gpsPosMsg = addInput(GPS_POS_MSG, DataType.VEC2);
this.truePosMsg = addInput(TruePosition.VALUE_NAME, TruePosition.TYPE);
this.pushTargetPosMsg = addInput(PUSH_TARGET_POS_MSG, DataType.VEC2, true);
this.popTargetPosMsg = addInput(POP_TARGET_POS_MSG, DataType.EMPTY, true);
this.pushTargetPosMsg = addInput(PUSH_TARGET_POS_MSG, DataType.VEC2, true, true);
this.popTargetPosMsg = addInput(POP_TARGET_POS_MSG, DataType.EMPTY, true, true);
this.atTargetPosMsg = addOutput(AT_TARGET_POS_MSG, AT_TARGET_POS_TYPE);
this.currentTargetPosMsg = addOutput(CURRENT_TARGET_POS_MSG, CURRENT_TARGET_POS_TYPE);
......@@ -100,10 +87,11 @@ public class Navigation extends EEComponent {
// TODO Auto-generated method stub
Message msg = msgRecvEvent.getMessage();
Instant time = msgRecvEvent.getEventTime();
if (msg.msgId == gpsPosMsg.messageId) {
// Update position -> Check current routing
// TODO
} else if (msg.msgId == truePosMsg.messageId) {
// if (msg.msgId == gpsPosMsg.messageId) {
// // Update position -> Check current routing
// // TODO
// } else
if (msg.msgId == truePosMsg.messageId) {
currentPos = Optional.of((Vec2) msg.message);
if (!currentPath.isPresent() && !targets.empty()){
newTrajectory(time);
......@@ -115,10 +103,12 @@ public class Navigation extends EEComponent {
// Add new position to routing stack -> compute new routing
// TODO
pushTargetPos((Vec2)msg.message, time);
newTrajectory(time);
} else if (msg.msgId == popTargetPosMsg.messageId) {
// Remove target from routing stack -> compute new routing
// TODO
popTargetPos();
newTrajectory(time);
}
}
......@@ -128,8 +118,9 @@ public class Navigation extends EEComponent {
public void pushTargetPos(Vec2 target, Instant time){
targets.push(target);
send(time, new Message(currentTargetPosMsg, target, currentTargetPosMsg.type.dataSize, id));
sendMessage(time, currentTargetPosMsg, target);
}
public void popTargetPos() {
if (!targets.empty()) targets.pop();
}
......@@ -138,7 +129,7 @@ public class Navigation extends EEComponent {
currentPath = Optional.empty();
if (!currentPos.isPresent()) return;
if (targets.empty()){
send(time, new Message(atTargetPosMsg, new Boolean(true), atTargetPosMsg.type.dataSize, id));
sendMessage(time, atTargetPosMsg, new Boolean(true));
return;
}
try {
......@@ -149,7 +140,7 @@ public class Navigation extends EEComponent {
}
}
public void updateTrajectory(Instant time){
public void updateTrajectory(Instant time) {
if (!currentPos.isPresent()) return;
if (!currentPath.isPresent()) return;
int index = getNearestSegment(currentPos.get());
......@@ -162,8 +153,8 @@ public class Navigation extends EEComponent {
x[i] = p.trajectoryX[index+i];
y[i] = p.trajectoryY[index+i];
}
send(time, new Message(trajectoryXMsg, x, 8*size, id));
send(time.plus(Duration.ofMillis(10)), new Message(trajectoryYMsg, y, 8*size, id));
sendMessage(time, trajectoryXMsg, x, 8*size);
sendMessage(time.plus(Duration.ofMillis(10)), trajectoryYMsg, y, 8*size);
}
private int getNearestSegment(Vec2 pos) {
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.eecomponents.navigation;
import de.rwth.montisim.simulation.environment.pathfinding.Pathfinding;
......@@ -25,4 +20,9 @@ public class NavigationProperties extends ServiceComponentProperties {
this.name = "UnnamedNavigation";
}
public NavigationProperties setName(String name) {
this.name = name;
return this;
}
}
\ No newline at end of file
(c) https://github.com/MontiCore/monticore
The license generally applicable for this project
can be found under https://github.com/MontiCore/monticore.
\ No newline at end of file
(c) https://github.com/MontiCore/monticore
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
(c) https://github.com/MontiCore/monticore
The license generally applicable for this project
can be found under https://github.com/MontiCore/monticore.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.eesimulator;
import de.rwth.montisim.commons.eventsimulation.DiscreteEventSimulator;
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.eesimulator.actuator;
import java.util.logging.Logger;
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.eesimulator.actuator;
import java.util.Optional;
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.eesimulator.bridge;
import de.rwth.montisim.commons.eventsimulation.exceptions.UnexpectedEventException;
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.eesimulator.bridge;
import java.time.Duration;
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.eesimulator.bus;
import de.rwth.montisim.commons.eventsimulation.exceptions.*;
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.eesimulator.bus;
import de.rwth.montisim.simulation.eesimulator.components.EEComponentProperties;
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.eesimulator.bus;
public class BusUtils {
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.eesimulator.bus;
import java.util.Comparator;
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.eesimulator.bus;
public interface OperationMode {
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.montisim.simulation.eesimulator.bus.can;
import java.time.Duration;
......
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