Skip to content
Snippets Groups Projects
Commit 6e2d0e50 authored by René Schöne's avatar René Schöne
Browse files

continue setting up

- copy part of starter code to place-a
- disable place-b for now
- add missing relast jar
- upgrade to ragconnect 0.3.0 (subtrees)
- disable dumpAst (can not fetch package)
parent 737d08a0
No related branches found
No related tags found
No related merge requests found
Pipeline #9508 passed
Showing
with 175 additions and 12 deletions
......@@ -5,7 +5,7 @@ stages:
- build
build:
image: openjdk:8
image: openjdk:11
stage: build
script:
- ./gradlew assemble
......@@ -12,9 +12,9 @@ dependencies {
api group: 'net.sf.beaver', name: 'beaver-rt', version: '0.9.11'
grammar2umlClasspath group: 'de.tudresden.inf.st', name: 'grammar2uml', version: '0.1.1'
ragconnectClasspath group: 'de.tudresden.inf.st', name: 'ragconnect', version: '0.2.5'
ragconnectClasspath group: 'de.tudresden.inf.st', name: 'ragconnect', version: '0.3.0'
// ragconnectClasspath fileTree(include: ['ragconnect-0.2.5.jar'], dir: '../libs')
implementation 'de.tudresden.inf.st:dumpAstWithPlantuml:0.3.5'
// implementation group: 'de.tudresden.inf.st', name: 'dumpAstWithPlantuml', version: '0.3.5'
// implementation fileTree(include: ['dumpAstWithPlantuml-0.3.5.jar'], dir: '../libs')
}
#!/usr/bin/env bash
mosquitto_pub -t exit -m "1"
File added
#!/usr/bin/env bash
letter=$(echo $1 | tr a-z A-Z)
module="ros3rag.place${letter}"
shift
./gradlew :${module}:installDist && \
./${module}/build/install/${module}/bin/${module} $@
// cgv_connector.proto
// this file contains the messages that are exchanged between the cgv framework and the st ROS interface
syntax = "proto3";
message Object {
// Position is object-center related
message Position {
float x = 1; // in m
float y = 2; // in m
float z = 3; // height in m
}
// 3D description of the object
message Size {
float length = 1; // in m
float width = 2; // in m
float height = 3; // in m
}
message Orientation {
float x = 1; // normalized quaternion
float y = 2;
float z = 3;
float w = 4;
}
message Color {
float r = 1; // 0..1
float g = 2; // 0..1
float b = 3; // 0..1
}
enum Type {
UNKNOWN = 0;
BOX = 1;
BIN = 2;
ARM = 3;
}
string id = 1;
Type type = 2;
Position pos = 3;
Size size = 4;
Orientation orientation = 5;
Color color = 6;
}
// the scene is stored within the ROS side and sent to the CGV framework
message Scene {
repeated Object objects = 1;
}
// the selection is done by the CGV framework and sent to ROS
message Selection {
string id = 1; // the id corresponds to an id of an Object in a Scene
}
\ No newline at end of file
buildscript {
repositories.mavenLocal()
repositories.mavenCentral()
dependencies {
classpath group: 'org.jastadd', name: 'jastaddgradle', version: '1.13.3'
......@@ -13,6 +12,10 @@ plugins {
mainClassName = 'de.tudresden.inf.st.placeA.MainA'
dependencies {
implementation project(':ros3rag.common')
}
ext.sharedJastAddDir = 'src/main/jastadd/shared'
ext.ragConnectInputGrammar = 'src/main/jastadd/WorldModel.relast'
ext.ragConnectInputConnect = 'src/main/jastadd/WorldModel.connect'
......
WorldModel ::= RobotArm Bin* MovableObject* ;
WorldModel ::= RobotArm Scene ;
RobotArm ::= Link* EndEffector ;
Link ::= <Name:String> CurrentPosition:Coordinate ;
EndEffector : Link;
Bin ::= <Name:String> CurrentPosition:Coordinate ;
MovableObject ::= <Name:String> CurrentPosition:Coordinate ;
package de.tudresden.inf.st.placeA;
import de.tudresden.inf.st.placeA.ast.Coordinate;
import de.tudresden.inf.st.placeA.ast.MqttHandler;
import de.tudresden.inf.st.placeA.ast.WorldModel;
import de.tudresden.inf.st.ros3rag.common.DataConfiguration;
import de.tudresden.inf.st.ros3rag.common.Util;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
/**
* TODO: Add description.
......@@ -8,7 +19,54 @@ import de.tudresden.inf.st.placeA.ast.Coordinate;
* @author rschoene - Initial contribution
*/
public class MainA {
public static void main(String[] args) {
private static final Logger logger = LogManager.getLogger(MainA.class);
private MqttHandler mainHandler;
private WorldModel model;
private void run(String[] args) throws IOException, InterruptedException {
System.out.println("This is place A with " + Coordinate.of(1, 2, 3) + "!");
File configFile = new File(args.length == 0 ? "../ros3rag.common/config.yaml" : args[0]);
// --- No configuration below this line ---
DataConfiguration.ActualConfiguration config = Util.parseConfig(configFile);
model = new WorldModel();
logStatus("Start");
CountDownLatch exitCondition = new CountDownLatch(1);
logger.info("To print the current model states, send a message to the topic 'model'.");
logger.info("To exit the system cleanly, send a message to the topic 'exit', or use Ctrl+C.");
mainHandler = new MqttHandler("mainHandler").dontSendWelcomeMessage();
Util.setMqttHost(mainHandler::setHost, config);
mainHandler.waitUntilReady(2, TimeUnit.SECONDS);
mainHandler.newConnection("exit", bytes -> exitCondition.countDown());
mainHandler.newConnection("model", bytes -> logStatus(new String(bytes)));
// sendInitialDataConfig(mainHandler, config.topics.dataConfig);
Runtime.getRuntime().addShutdownHook(new Thread(this::close));
exitCondition.await();
this.close();
}
private void logStatus(String prefix) {
logger.info(prefix);
// more information to be added later
}
private void close() {
logger.info("Exiting ...");
mainHandler.close();
model.ragconnectCloseConnections();
}
public static void main(String[] args) throws IOException, InterruptedException {
new MainA().run(args);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{1.} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
WorldModel ::= RobotArm* MyScene:Scene OtherScene:Scene ;
Scene ::= Bin* MovableObject* ;
RobotArm ::= Link* EndEffector ;
Link ::= <Name:String> CurrentPosition:Coordinate ;
EndEffector : Link;
Bin ::= <Name:String> CurrentPosition:Coordinate ;
MovableObject ::= <Name:String> CurrentPosition:Coordinate ;
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{1.} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
rootProject.name = 'ros3rag'
include 'ros3rag.placeA'
include 'ros3rag.placeB'
//include 'ros3rag.placeB'
include 'ros3rag.common'
// include 'ros3rag.senderstub'
......
Coordinate ::= <X:int> <Y:int> <Z:int> ;
Scene ::= DropOffLocation* MovableObject* ;
DropOffLocation ::= <Name:String> CurrentPosition:Coordinate ;
MovableObject ::= <Name:String> CurrentPosition:Coordinate ;
......@@ -24,7 +24,7 @@ task ragConnect(type: JavaExec) {
project.ext.ragConnectInputConnect,
'--logReads',
'--logWrites',
'--verbose',
// '--verbose',
'--rootNode=' + project.ext.ragConnectRootNode,
'--incremental=param,debug',
"--tracing=cache,flush"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment