Commit 7235e101 authored by Jean Meurice's avatar Jean Meurice Committed by Evgeny Kusmenko
Browse files

Upgrade to SoftwareSimulator, using CarLang controller configuration

parent 405ec2a5
**/target/*
.settings/*
.settings/
.project
.classpath
.directory
.idea
.idea/*
.vscode/
/target
*.pyc
*.DS_Store
......@@ -12,3 +13,5 @@
/restful/src/main/resources/resources
*.jar
/bin/
HardwareEmulator.*
unittest.txt
\ No newline at end of file
......@@ -5,62 +5,51 @@
# can be found under https://github.com/MontiCore/monticore.
#
image: maven:3-jdk-8
# The docker stage builds the projects and runs the tests
# If it succeeds, run the maven stage to deploy the artifacts (master only)
stages:
- windows
- linux
- docker
- maven
masterJobWindowsRpc:
stage: windows
RPC_maven_master_windows:
stage: maven
only:
- master
tags:
- Windows10_OS
script:
- cd rpc
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean deploy --settings ..\settings.xml
- mvn package sonar:sonar --settings ..\settings.xml -DskipTests
tags:
- Windows10
Restful_maven_master_windows:
stage: maven
only:
- master
masterJobWindowsRestful:
stage: windows
tags:
- Windows10_OS
script:
- cd restful
# TODO: we have to skip tests for now, because most tests require a running instance of zookeeper
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean deploy --settings ..\settings.xml -DskipTests
- mvn package sonar:sonar --settings ..\settings.xml -DskipTests
tags:
- Windows10
only:
- master
branchJobWindowsRpc:
stage: windows
script:
- cd rpc
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install --settings ..\settings.xml
tags:
- Windows10
except:
- master
branchJobWindowsRestful:
stage: windows
script:
- cd restful
# TODO: we have to skip tests for now, because most tests require a running instance of zookeeper
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install --settings ..\settings.xml -DskipTests
tags:
- Windows10
except:
- master
# run tests
branchJobLinux:
docker_branch_linux:
image: docker:dind
stage: docker
except:
- master
tags:
- docker
stage: linux
- shell
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
......@@ -71,18 +60,20 @@ branchJobLinux:
- docker rmi restful-server || true
# pull the latest RMIServer image
- docker pull registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/rmimodelserver:latest
- cd docker
- ./build.sh
- cd scripts/linux/docker
- ./build_server.sh
- ./run_test.sh
- ./run_integration_test.sh
except:
- master
# build, test and publish docker images
masterJobLinux:
docker_master_linux:
image: docker:dind
stage: docker
only:
- master
tags:
- docker
stage: linux
- shell
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
......@@ -93,13 +84,11 @@ masterJobLinux:
- docker rmi restful-server || true
# pull the latest RMIServer image
- docker pull registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/rmimodelserver:latest
- cd docker
- ./build.sh
- cd scripts/linux/docker
- ./build_server.sh
- ./run_test.sh
- ./run_integration_test.sh
- docker tag rpc-server:latest $CI_REGISTRY_IMAGE:rpc
- docker tag restful-server:latest $CI_REGISTRY_IMAGE:restful
- docker push $CI_REGISTRY_IMAGE:rpc
- docker push $CI_REGISTRY_IMAGE:restful
only:
- master
......@@ -2,31 +2,38 @@
![pipeline](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/server/badges/master/build.svg)
![coverage](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/server/badges/master/coverage.svg)
Server repository contains a project binding all modules for running the _simulator_ together with _visualization_ using client/server architecture. The project is based on _SmartFoxServer_ development kit and therefore has to be deployed on running _SmartFoxServer 2X_ server. To provide accessible web application, the _visualization_ project has to be built to _.war_ file and then deployed as a web application on the embedded in SFS _Jetty_ server.
# Server 2.0
## Overview
This project repository contains the [**RPC**](rpc/) and [**RESTful**](rpc/) projects. The **RPC** project is a server wrapper around a Simulator (TODO link) instance. Its goal is to be started on multiple machines to allow scaled-up simulations. An **RPC** server will try to connect to **Zookeeper** (TODO link). This is a service started as server inside the network. It allows nodes like the RPC servers or Software servers (aka RMIModelServer) to register themselves and be available to **RESTful** servers to perform simulations.
The **RESTful** server is an HTTP server. It listens for HTTP requests to setup and start simulations. Setup is done by specifying CarLang and SimLang files that describe the properties of vehicles in the simulation (CarLang) as when as the scenario to simulate (SimLang). On simulation start, it will ask the local *Zookeeper* for RPC/Software servers to perform the simulation on.
Since this project provides a distributed setup, testing and running it requires an "advanced" setup. Two ways of doing it:
- Using **Docker**: a series of scripts allow the building, testing and running of the setup inside docker images.
- Using manual local instances: install & start Zookeeper, install & start an RMIModelServer, build and run an RPC server then finally start a RESTful server. (Scripts are available in the respective projects to do that.)
Additionally, the **Visulization** project can be install, it is a Web Visualization that allows the control (and visualization) of the RESTful server.
## Install
```bash
$ mvn clean install -DskipTests -settings=../settings.xml
mvn clean install -DskipTests -s settings.xml
```
After installation, the executables can be found in restful/target and rpc/target directory.
To use them, please refer to corresponding instructions:
[rpc](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/server/blob/master/rpc/README.md)
and
[restful](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/server/blob/master/restful/README.md)
## Docker(optional)
Build the docker images:
```bash
$ cd docker
$ ./build.sh
```
Test:
```bash
$ cd docker
$ ./run_test.sh
```
README of [restful](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/server/blob/master/restful/README.md)
## Docker (optional)
- Run the `docker/build_server` script to build the whole project. This will also run the tests of the RPC project.
- The `docker/run_test` & `docker/run_integration_test` scripts will run all the tests of the RESTful project. (Requires seperate setup.)
The README of [restful](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/server/blob/master/restful/README.md)
includes instructions of how to use docker to run this project.
## Just have a look
......@@ -45,7 +52,7 @@ To try it with visualization, download
[visualization project](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/visualization),
uncomment the `nginx` part of `docker/docker-compose.yml`, comment or remove the `ports` field of `server`.
# Portable version
# Portable version (Outdated)
A portable version for Windows of the SmartFoxServer based simulator together with a portable PostgreSQL database is available as [archive](https://github.com/MontiSim/server/releases/download/portable/distributed-simulator.zip). Running the portable version can be done by running the `start-script.bat` file, provided in the archive.
......@@ -92,16 +99,6 @@ This folder contains the last version of the _EMAM-showcase_ autopilot (_Autopil
# Installation
Running the complete simulation platform requires deployment of the __visualization__ and __server__ repository deliverables to an installed SmartFoxServer 2X.
## Installation of SmartFoxServer 2X
To install a SmartFoxServer 2X, the following steps have to be undertaken:
1. Download the [installer](http://www.smartfoxserver.com/download#p=installer) for the OS of the machine, which is to run the simulation platform
2. Install SmartFoxServer 2X in preferred directory (__NOTE__: Additional configuration in pom.xml may be necessary to allow correct deployment of the web- and server applications)
3. Start the SmartFoxServer using one of _sfs2x-standalone_, _sfs2x-service_ or _sfs2x.bat_ (_sfs2x.sh_ on Linux) files.
## Configuration of Database Service
This project supports both PostgreSQL and SQLite database. Using PostgreSQL can benefit from its satisfying performance, but requires more steps to setup. On the contrast, SQLite is quite easy to setup and thus make it easier to start developing this project.
......@@ -168,86 +165,6 @@ For **Linux/Mac** users, the models have to be compiled by yourself. To do so, f
6. Copy all the `.fmu` files into the `SFS2X/lib/` directory of smartfox.
7. Alternatively, there are pre-compiled *Mac* version of fmu files that you can use. See `libs/fmu_for_mac/`. With this you can skip step 1 to 5.
## Configuration of JFMI
To interact with modelica models, a library is needed. Download this [here](https://ptolemy.berkeley.edu/java/jfmi/), unzip it and copy the `jna.rar` into `SFS2X/lib/` directory of smartfox.
## Deployment of Server application
Depending on the used OS, change deployment directory in either _deploy.bat_ or _deploy.sh_ located in _docs/scripts_ directory, to match the directory, in which SmartFoxServer has been installed. For example:
* for linux with `<SmartFoxServer directory>` at `/opt/SmartFoxServer_2X/SFS2X`
SFS_DIR="/opt/SmartFoxServer_2X/SFS2X"
* for windows with `<SmartFoxServer directory>` at `C:\Users\Administrator\SmartFoxServer_2X\SFS2X`
SET SFS_DIR=C:\Users\Administrator\SmartFoxServer_2X\SFS2X
In _pom.xml_, change the `<sfs.directory>` path to match the directory, in which the server has been installed. For example, if `<sfs.directory>` is located at `C:\Users\Administrator\SmartFoxServer_2X\SFS2X`, then the `<sfs.directory>` should be as follows:
<sfs.directory>C:\Users\Administrator\SmartFoxServer_2X\SFS2X\extensions\AllInOne</sfs.directory>
Deployment of the server extension is done via `mvn clean install --settings ./settings.xml` command, which will built, test and deploy as a single jar the server application in SmartFoxServer _extensions_ directory. If an instance of the SmartFoxServer is running, the new extension will be automatically loaded.
## Server configuration
Initially SmartFoxServer is not configured to handle custom extensions, thus one has to register its extensions via the _SmartFoxServer Administration tool. It is accessible initially at `http://localhost:8080/admin`.
Initial credentials to login in the administration tool are:
__host__: _localhost_
__user__: _sfsadmin_
__password__: _sfsadmin_
Once logged in the administration tool, the following tabs have to be visited and configured:
1. Server Configurator:
* in _Server Configurator_ -> _General_:
* the _Session maximum idle time_ should not be set to a too high value, but should also not be less than or equal 60 sec (we recomend a value of 70 sec)
* the _User maximum idle time_ has to be set to a value greater than _Session maximum idle time_ (we recommend __difference__ of 10 seconds).
* in _Server Configurator_ -> _Web server_:
* the _HTTP/WS port_ has to be changed to `80`
* _Enable WS/WSS_ and _Use WS binary protocol_ have to be __checked__
2. Prepare _JDBC_ driver:
* Download [postgres JDBC driver](https://jdbc.postgresql.org/) for the OS of the machine, which is to run the _SmartFoxServer_ (we use version _42.1.4_), if you choose to use postgres.
* Download [sqlite JDBC driver](https://bitbucket.org/xerial/sqlite-jdbc/downloads/) if you choose to use sqlite.
* Copy the driver and place it at `<SmartFoxServer directory>/lib`
3. Prepare Java FMI library:
* Download [Java FMI library](https://ptolemy.berkeley.edu/java/jfmi/)
* Open your downloaded archive and extract the file `lib/jna.jar` to `<SmartFoxServer directory>/lib`
4. Prepare simulation dependencies:
* Download from the [simulation repository](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/simulation/) all 4 fmu-files located in the `lib` directory
* Place the downloaded files at `<SmartFoxServer directory>/lib`
5. Zone Configurator:
* in _Zone Configurator_:
* add new zone
* in _General_ tab set _Zone name_ to `World`
* in _General_ tab enable _Allow file uploading_
* in _Zone Extension_ tab:
* for _Name_ select _AllInOne_
* for _Type_ select `JAVA`
* _Main class_ has to be set to _rwth.server.extensions.ZoneExt_
* _Properties file_ has to be set to `config.properties`
* in _Database manager_ tab(If using postgresql):
* _Activate_ has to be __checked_
* _Database driver class_ has to be set to `org.postgresql.Driver`
* _Connection string_ has to be set to `jdbc:postgresql://localhost:5432/mmosim` (__NOTE__: if different database name or port are used, change accordingly)
* _Username_ has to be set to `server` (__NOTE__: if different username is used, change accordingly)
* _Password_ has to be set to `mmosim` (__NOTE__: if different password is used, change accordingly)
* _Test SQL_ has to be set to `SELECT COUNT(*) FROM users;`
* in _Database manager_ tab(If using sqlite):
* _Activate_ has to be __checked__
* _Database driver class_ has to be set to `org.sqlite.JDBC`
* _Connection string_ has to be set to `jdbc:sqlite:extensions/AllInOne/world.db`
* _Username_ and _Password_ can be left blank.
* _Test SQL_ has to be set to `SELECT COUNT(*) FROM users;`
__Submit__ and the SmartFoxServer will be configured to load and use the new extension automatically with start up of the server. __Restart__ the SmartFoxServer to start using the new extension.
__NOTE__: if SmartFox server cannot start anymore, then it is more likely that the port `80` is already bound to another process. By running `NET stop HTTP` command, one can see which services are using port `80`. In Windows 10, this is mostly `WWW-Publishing Service`. By running `services.msc` and then stopping the `WWW-Publishing Service` one can free port `80`.
## Deployment of Web application (visualization)
Check out [visualization](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/visualization) repository documentation.
......
......@@ -2,10 +2,12 @@ FROM maven:3-jdk-8 AS montisim-server-builder
WORKDIR /app
COPY . .
RUN apt-get update && \
apt-get install -y --no-install-recommends metis && \
apt-get install -y --no-install-recommends libxext6 libxrender1 libxtst6 metis && \
rm -rf /var/lib/apt/lists/* && \
mvn install -s settings.xml -DskipTests && \
cp rpc/target/rpc-jar-with-dependencies.jar rpc/target/rpc.jar
echo "export LD_LIBRARY_PATH=/usr/local/openjdk-8/jre/lib/amd64" > ~/.bashrc
COPY . .
RUN mvn install -s settings.xml -DskipTests && \
mv rpc/target/rpc-jar-with-dependencies.jar rpc/target/rpc.jar
#!/usr/bin/env bash
CURR_DIR=$(pwd)
cd ..
docker build -f "${CURR_DIR}/Dockerfile" -t montisim-server-builder .
cd rpc
./build.sh
cd ../restful
./build.sh
......@@ -9,7 +9,7 @@ version: "3"
services:
zoo1:
image: zookeeper:3.4
image: zookeeper:latest
restart: always
hostname: zoo1
environment:
......@@ -26,7 +26,7 @@ services:
entrypoint:
- bash
- -c
- "source ~/.bashrc && java -Djava.rmi.server.useLocalHostname -jar rmi-model-server.jar port=10101 autopilots_folder=autopilots no_time os=windows"
- "source ~/.bashrc && java -Djava.rmi.server.useLocalHostname -jar rmi-model-server.jar port=10101 softwares_folder=softwares"
rpc-server:
image: registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/server:rpc
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- (c) 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">
<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">
<modelVersion>4.0.0</modelVersion>
<artifactId>server</artifactId>
<groupId>montisim-server</groupId>
<version>${revision}</version>
<packaging>pom</packaging>
<artifactId>server</artifactId>
<groupId>montisim-server</groupId>
<version>${revision}</version>
<packaging>pom</packaging>
<modules>
<module>rpc</module>
......@@ -16,40 +15,31 @@
</modules>
<properties>
<revision>2.2.5</revision>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<properties>
<revision>2.2.6</revision>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<smartfox.version>2.13</smartfox.version>
<montisim.version>1.0.1</montisim.version>
<!-- .. Plugins ....................................................... -->
<!-- .. Plugins ....................................................... -->
<assembly.plugin>2.5.4</assembly.plugin>
<compiler.plugin>3.3</compiler.plugin>
<source.plugin>2.4</source.plugin>
<shade.plugin>2.4.3</shade.plugin>
<jacoco.plugin>0.8.1</jacoco.plugin>
<wagon.provider.version>2.6</wagon.provider.version>
<!-- Deployment properties -->
<project.name>ServerExtension</project.name>
<config.file>config.properties</config.file>
<config.dir>main/resources</config.dir>
<wagon.provider.version>2.6</wagon.provider.version>
<java.version>1.8</java.version>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
</properties>
<!-- ================================================================================ -->
<!-- External additional maven repositories -->
<!-- ================================================================================ -->
<!-- ================================================================================ -->
<!-- External additional maven repositories -->
<!-- ================================================================================ -->
<repositories>
<repository>
<repository>
<id>jboss-public-repository</id>
<name>JBoss Public Maven Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
......@@ -62,16 +52,16 @@
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repository>
<!-- In Project (temporal) -->
<repository>
<id>in-project</id>
<name>In Project Repo</name>
<url>file://${project.basedir}/libs</url>
</repository>
</repositories>
<dependencies>
<repository>
<id>in-project</id>
<name>In Project Repo</name>
<url>file://${project.basedir}/libs</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
......@@ -93,11 +83,11 @@
<version>3.6.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!--Unit test-->
......@@ -118,7 +108,7 @@
</dependency>
</dependencies>
<!-- == PROJECT BUILD SETTINGS =========================================== -->
<!-- == PROJECT BUILD SETTINGS =========================================== -->
<build>
<plugins>
......@@ -162,17 +152,17 @@
</plugins>
</build>
<!-- == DISTRIBUTION ==================================================== -->
<distributionManagement>
<repository>
<id>se-nexus</id>
<url>https://nexus.se.rwth-aachen.de/content/repositories/embeddedmontiarc-releases/</url>
</repository>
<snapshotRepository>
<id>se-nexus</id>
<url>https://nexus.se.rwth-aachen.de/content/repositories/embeddedmontiarc-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<!-- == DISTRIBUTION ==================================================== -->
<distributionManagement>
<repository>
<id>se-nexus</id>
<url>https://nexus.se.rwth-aachen.de/content/repositories/embeddedmontiarc-releases/</url>
</repository>
<snapshotRepository>
<id>se-nexus</id>
<url>https://nexus.se.rwth-aachen.de/content/repositories/embeddedmontiarc-snapshots/</url>
</snapshotRepository>
</distributionManagement>
</project>
......@@ -7,9 +7,8 @@
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">
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>montisim-server</groupId>
......@@ -21,13 +20,14 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<revision>2.2.5</revision>
<revision>2.2.6</revision>
<montisim.commons.version>1.0.11</montisim.commons.version>
<montisim.simulation.version>2.0.4</montisim.simulation.version>
<montisim.simulation.version>2.0.6</montisim.simulation.version>
<montisim.controller.version>1.0.4</montisim.controller.version>
<montisim.simulationlanguage.version>1.1.0-SNAPSHOT</montisim.simulationlanguage.version>
......@@ -72,7 +72,7 @@
<groupId>montisim</groupId>
<artifactId>commons</artifactId>
<version>${montisim.commons.version}</version>
<!-- <version>2.1.0-SNAPSHOT</version>-->
<!-- <version>2.1.0-SNAPSHOT</version>-->
<scope>provided</scope>
<!--<exclusions>
<exclusion>
......@@ -247,10 +247,10 @@
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
......
......@@ -224,7 +224,7 @@ public class MetisGraph {
String line;
while ((line = reader.readLine()) != null) {
lines.add(line);
logger.info(line);
logger.debug(line);
} while (line != null);
} catch (IOException e) {
logger.warn(e.getMessage(), e);
......
......@@ -33,7 +33,7 @@ import java.util.stream.Collectors;
public class NavigationService {
static Map<String, de.rwth.monticore.EmbeddedMontiArc.simulators.controller.library.structures.Graph> osmGraphs;
private static Logger logger = LoggerFactory.getLogger(VehicleService.class);
private static Logger logger = LoggerFactory.getLogger(NavigationService.class);
public static GraphPath<Vertex, OverlayEdge> findShortestOverlayPath(Graph<Vertex, OverlayEdge> g, Vertex source, Vertex target) {
DijkstraShortestPath<Vertex, OverlayEdge> d = new DijkstraShortestPath<>(g);
......@@ -189,7 +189,7 @@ public class NavigationService {
"no path found between %d(sector: %d) and %d(sector: %d)",
source, sourceSectorIdx, target, targetSectorIdx
);
logger.error(msg);
//logger.error(msg);
throw new PathNotExistException(msg);
}
return bestPath;
......@@ -273,11 +273,11 @@ public class NavigationService {
}
// log it
StringBuilder sb = new StringBuilder();
for (List<Long> segment : result) {
sb.append(String.format("[%s]", segmentToString(mapService, segment)));
}
logger.info(String.format("Trajectory segments:\n[%s]", sb.toString()));
// StringBuilder sb = new StringBuilder();
// for (List<Long> segment : result) {
// sb.append(String.format("[%s]", segmentToString(mapService, segment)));
// }
// logger.info(String.format("Trajectory segments:\n[%s]", sb.toString()));
return result;
}
......
......@@ -43,6 +43,7 @@ public class SimulatorService {
String filename = "";
if (Util.isWindows()){
filename = mapPath.substring(mapPath.lastIndexOf("\\") + 1);
filename = filename.substring(filename.lastIndexOf("/") + 1);
}else{
filename = mapPath.substring(mapPath.lastIndexOf("/") + 1);
}
......
......@@ -86,7 +86,6 @@ public class Util {
public static CarContainer getDefaultCarContainer() {
if (defaultCarContainer == null) {
defaultCarContainer = CarLangTool.parse(Paths.get("src/main/resources/default"), "default").get().getCarContainer();
defaultCarContainer.setController(getProperties().getProperty("v_model", "AutopilotAdapter"));
}