Skip to content

Commit b6bdd29

Browse files
author
Luis Gustavo Nardin
committed
Merge branch 'AuraRobotics-viewer-event-logger' into master
2 parents 23ed025 + 90a5d51 commit b6bdd29

24 files changed

+3007
-2072
lines changed

.gitignore

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ hs_err_pid*
1010
build
1111
bin
1212

13-
# IntelliJ
13+
# IntelliJ project
1414
*.iml
1515
*.ipr
1616
*.iws
@@ -21,13 +21,21 @@ bin
2121
.project
2222
.classpath
2323

24+
# Gradle
25+
.gradle
26+
2427
# Visual Studio Code
2528
.vscode
2629

30+
# Theia IDE
31+
.theia
32+
2733
# General MacOS
2834
.DS_Store
2935
.AppleDouble
3036
.LSOverride
3137

3238
# Project
33-
jars
39+
boot/logs
40+
boot/records
41+
jars

boot/functions.sh

100644100755
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ function printUsage {
6767
# Process command-line arguments
6868
function processArgs {
6969
LOGDIR="logs"
70+
RECORDSDIR="records"
7071
MAP="$BASEDIR/maps/gml/test/map"
7172
CONFIGDIR="$BASEDIR/maps/gml/test/config"
7273
TEAM=""
@@ -94,6 +95,10 @@ function processArgs {
9495
LOGDIR="$2"
9596
shift 2
9697
;;
98+
-r | --records)
99+
RECORDSDIR="$2"
100+
shift 2
101+
;;
97102
-t | --team)
98103
TEAM="$2"
99104
shift 2
@@ -153,6 +158,7 @@ function processArgs {
153158
LOGDIR=`readlink -f $LOGDIR`
154159
fi
155160
mkdir -p $LOGDIR
161+
mkdir -p $RECORDSDIR
156162
}
157163

158164
function execute {
@@ -236,3 +242,21 @@ function startViewer {
236242
echo "waiting for viewer to connect..."
237243
waitFor $LOGDIR/viewer-out.log "success"
238244
}
245+
246+
247+
# Start the viewer event logger
248+
function startViewerEventLogger {
249+
if [[ $NOGUI == "yes" ]]; then
250+
return 0
251+
fi
252+
253+
makeClasspath $BASEDIR/lib
254+
255+
TEAM_NAME_ARG=""
256+
if [ ! -z "$TEAM" ]; then
257+
TEAM_NAME_ARG="\"--viewer.team-name=$TEAM\""
258+
fi
259+
260+
# Execute the viewer
261+
execute viewer "java -Xmx512m -cp $CP:$BASEDIR/jars/rescuecore2.jar:$BASEDIR/jars/standard.jar:$BASEDIR/jars/sample.jar -Dlog4j.log.dir=$LOGDIR rescuecore2.LaunchComponents sample.SampleViewerEventLogger -c $CONFIGDIR/viewer.cfg --records.dir=$RECORDSDIR $TEAM_NAME_ARG $*"
262+
}

boot/records/test__1598630733534_viewer_event_log.jlog

Lines changed: 17 additions & 0 deletions
Large diffs are not rendered by default.

boot/start.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ sh kill.sh
1212
startKernel --nomenu
1313
startSims
1414
startViewer
15+
startViewerEventLogger
1516

1617
echo "Start your agents"
1718
waitFor $LOGDIR/kernel.log "Kernel has shut down" 30

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ version = '1.3'
99
dependencies {
1010
runtimeOnly fileTree( dir: new File( rootDir, 'jars' ), include: '*.jar' )
1111
implementation fileTree( dir: new File( rootDir, 'lib' ), include: '*.jar' )
12+
compile group: 'org.json', name: 'json', version: '20200518'
1213

1314
testImplementation 'junit:junit:4.12'
1415
}

lib/json-20200518.jar

64.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)