Commit 7216e012 authored by Alexander David Hellwig's avatar Alexander David Hellwig

Merge branch 'BumbBot_test' into 'master'

Bumb bot example

See merge request !1
parents e8d10745 e920008c
Pipeline #151874 failed with stage
in 5 minutes and 39 seconds
stages:
- build
buildLinux:
stage: build
image: registry.git.rwth-aachen.de/monticore/embeddedmontiarc/applications/carlacomponents/emam-carla-ros-bridge
script:
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install --settings settings.xml -U
package test;
conforms to de.monticore.lang.monticar.generator.roscpp.RosToEmamTagSchema;
tags Bumb{
tag collisionDetection.other_actor_id with RosConnection = {topic = (/carla/ego_vehicle/collision, carla_msgs/CarlaCollisionEvent), msgField = other_actor_id};
tag collisionDetection.stdout with RosConnection = {topic = (/echo, std_msgs/Int64), msgField = data};
}
package test;
component CollisionDetection{
port in Z other_actor_id,
out Z stdout;
connect other_actor_id -> stdout;
}
<?xml version="1.0" encoding="UTF-8"?>
<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>de.monticore.lang.monticar.utilities</groupId>
<artifactId>Carla2EMAM</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>de.monticore.lang.monticar.utilities</groupId>
<artifactId>Carlacomponents-bumper</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>de.monticore.lang.monticar.utilities</groupId>
<artifactId>maven-streamtest</artifactId>
<version>0.0.6-SNAPSHOT</version>
<configuration>
<pathMain>Carla2EMAM/models</pathMain>
<pathTest>Carla2EMAM/src/test/emam</pathTest>
<runStreamTestBefore>true</runStreamTestBefore>
<pathTmpOut>Carla2EMAM/target/tmp</pathTmpOut>
<generator>MinGW</generator>
<pathMiddlewareOut>Carla2EMAM/target/middleware</pathMiddlewareOut>
<middlewareRootModels>
<param>test.collisionDetection</param>
</middlewareRootModels>
</configuration>
<executions>
<execution>
<id>compilemiddleware</id>
<configuration>
<middlewareGenerator>
<param>cpp</param>
<param>roscpp</param>
</middlewareGenerator>
</configuration>
<phase>test</phase>
<goals>
<goal>streamtest-middleare-build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
{
"modelsDir": "models/",
"outputDir": "target/",
"rootModel": "test.collisionDetection",
"generators": ["cpp", "roscpp"]
}
package test;
conforms to de.monticore.lang.monticar.generator.roscpp.RosToEmamTagSchema;
tags Bumb{
tag bumpBot.test with RosConnection = {topic = (/carla/ego_vehicle/vehicle_control_cmd, carla_msgs/CarlaEgoVehicleControl)};
tag bumpBot.collision_actor_id with RosConnection = {topic = (/carla/ego_vehicle/collision, carla_msgs/CarlaCollisionEvent), msgField = other_actor_id};
}
package test;
import test.structures.*;
component BumpBot{
port out Ego_Vehicle test,
in Z collision_actor_id;
implementation Math{
test.throttle = 1.0;
test.brake = 0.0;
test.hand_brake = false;
test.reverse = false;
test.gear = 1;
test.manual_gear_shift = false;
if collision_actor_id > 0 //if a collision occurred drive into the other direction
test.reverse = true;
end
}
}
package test.structures;
struct Ego_Vehicle{
Q throttle;
Q steer;
Q brake;
B hand_brake;
B reverse;
Z gear;
B manual_gear_shift;
}
<?xml version="1.0" encoding="UTF-8"?>
<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>de.monticore.lang.monticar.utilities</groupId>
<artifactId>EMAM2Carla</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>de.monticore.lang.monticar.utilities</groupId>
<artifactId>Carlacomponents-bumper</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>de.monticore.lang.monticar.utilities</groupId>
<artifactId>maven-streamtest</artifactId>
<version>0.0.6-SNAPSHOT</version>
<configuration>
<pathMain>EMAM2Carla/models</pathMain>
<pathTest>EMAM2Carla/src/test/emam</pathTest>
<runStreamTestBefore>true</runStreamTestBefore>
<pathTmpOut>EMAM2Carla/target/tmp</pathTmpOut>
<generator>MinGW</generator>
<pathMiddlewareOut>Carla2EMAM/target/middleware</pathMiddlewareOut>
<middlewareRootModels>
<param>test.bumpBot</param>
</middlewareRootModels>
</configuration>
<executions>
<execution>
<id>compilemiddleware</id>
<configuration>
<middlewareGenerator>
<param>cpp</param>
<param>roscpp</param>
</middlewareGenerator>
</configuration>
<phase>test</phase>
<goals>
<goal>streamtest-middleare-build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
{
"modelsDir": "models/",
"outputDir": "target/",
"rootModel": "test.bumpBot",
"generators": ["cpp", "roscpp"]
}
# CarlaComponents Steps to build a component:
EMAM Components for the Carla Simulator * 1.) move **mw-generator.jar** to the directory of the component you wish to build.
\ No newline at end of file * 2.) open shell, cd to the directory of the component and execute: **java -jar mw-generator.jar project.json** (in this case it's called **valid.json** for both components)
* 3.) switch to the target directory (**cd target/**)
* 4.) execute compile.sh (**./compile.sh**)
* 5.) if the generator can't find carla_msgs message type: execute the following command and retry step 4
* export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:/path/to/rosbridge/catkin_ws/devel/share/carla_msgs/cmake
* usually the path is something like "~/carla-ros-bridge/catkin_ws/devel/share/carla_msgs/cmake"
* 6.) after successfull compiling the generated code switch to install/bin directory (**cd install/bin/**)
* 7.) execute Coordinator_<model-package>_<component-name> (here it's **./Coordinator_test_bumpBot** or **./Coordinator_test_collisionDetection**)
## Wie bringe ich das Auto zum Fahren und lese den Kollisionssensor aus?
Carla Starten
Unter PythonAPI/examples: `python manual_control.py --rolename=ego_vehicle`
Zum Starten des Containers in den Ordner des Projektes (hier ein ausgechecktes Verzeichnis BumbBot_test) gehen:
`docker/run.sh`
Dann in einem neuen Terminal um das Auto fahren zu lassen:
`docker/compile_exec.sh`
Um den Collision Sensor auszulesen in einem neuen Terminal:
`docker/open_shell.sh` und darin `rostopic echo /carla/ego_vehicle/collision`
\ No newline at end of file
docker exec -it emam2carla /bin/bash -c 'source /opt/ros/kinetic/setup.bash && cd /usr/src/emam2carla/EMAM2Carla/ && rm -rf target && java -jar ../mw-generator.jar valid.json && target/compile.sh && target/build/test_bumpBot/coordinator/Coordinator_test_bumpBot'
docker exec -it emam2carla /bin/bash -c 'source /opt/ros/kinetic/setup.bash && source opt/carla-ros-bridge/devel/setup.bash && /bin/bash'
docker run -it --name emam2carla --rm -v $(pwd):/usr/src/emam2carla registry.git.rwth-aachen.de/monticore/embeddedmontiarc/applications/carlacomponents/emam-carla-ros-bridge
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.monticore.lang.monticar.utilities</groupId>
<artifactId>Carlacomponents-bumper</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>Carla2EMAM</module>
<module>EMAM2Carla</module>
</modules>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!--
******************************************************************************
MontiCAR Modeling Family, www.se-rwth.de
Copyright (c) 2017, Software Engineering Group at RWTH Aachen,
All rights reserved.
This project is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this project. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************
-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups>
<pluginGroup>org.mortbay.jetty</pluginGroup>
<pluginGroup>de.topobyte</pluginGroup>
</pluginGroups>
<proxies>
</proxies>
<servers>
<server>
<id>se-nexus</id>
<username>cibuild</username>
<password>${env.cibuild}</password>
</server>
</servers>
<profiles>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- Optional URL to server. Default value is http://localhost:9000 -->
<sonar.host.url>
https://metric.se.rwth-aachen.de
</sonar.host.url>
<sonar.login>
jenkins
</sonar.login>
<sonar.password>
${env.sonar}
</sonar.password>
</properties>
</profile>
<profile>
<id>se-nexus</id>
<repositories>
<repository>
<id>se-nexus</id>
<url>https://nexus.se.rwth-aachen.de/content/groups/public</url>
<releases><enabled>true</enabled> </releases>
<snapshots><enabled>true</enabled> </snapshots>
</repository>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2/</url>
<releases><enabled /></releases>
<snapshots><enabled /></snapshots>
</repository>
<repository>
<id>icm</id>
<url>http://maven.icm.edu.pl/artifactory/repo/</url>
<releases><enabled /></releases>
<snapshots><enabled /></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2/</url>
<releases><enabled /></releases>
<snapshots><enabled /></snapshots>
</pluginRepository>
<pluginRepository>
<id>se-nexus</id>
<url>https://nexus.se.rwth-aachen.de/content/groups/public</url>
<releases><enabled>true</enabled> </releases>
<snapshots><enabled>true</enabled> </snapshots>
</pluginRepository>
<pluginRepository>
<id>icm</id>
<url>http://maven.icm.edu.pl/artifactory/repo/</url>
<releases><enabled>true</enabled> </releases>
<snapshots><enabled>true</enabled> </snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>se-nexus</activeProfile>
</activeProfiles>
</settings>
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