Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Final-Assignment-31388-Advanced-Autonomous-Robot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
manli
Final-Assignment-31388-Advanced-Autonomous-Robot
Commits
73e09e27
Commit
73e09e27
authored
5 years ago
by
manxilin
Browse files
Options
Downloads
Patches
Plain Diff
Create main.sh
parent
a9dd7eb7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.sh
+91
-0
91 additions, 0 deletions
main.sh
with
91 additions
and
0 deletions
main.sh
0 → 100644
+
91
−
0
View file @
73e09e27
#!usr/bin/bash
# config the environment
if
!
[
-x
"
$(
command
-v
pip
)
"
]
;
then
sudo
apt
install
python-pip
sleep
1
pip
install
numpy
pip
install
PyYAML
sleep
1
fi
if
!
[
-x
"
$(
command
-v
gnome-terminal
)
"
]
;
then
sudo
apt-get update
sudo
apt-get
install
gnome-terminal
sleep
1
fi
# make sure we run the scripts in /sim folder
if
!
[
${
PWD
##*/
}
=
"sim"
]
;
then
mkdir
../sim
cp
-r
.
../sim
cd
../sim
fi
# initialize log files
if
[
-f
detectResult.log
]
;
then
rm
-f
detectResult.log
fi
# add object
python spawnObjs.py
sleep
1
# terminal 1: laser server
gnome-terminal
-t
"laser server"
-x
bash
-c
"cd /home/smr/sim/bash_src/;
sh laser.sh;exec bash;"
sleep
1
# terminal 2: run the simulator
gnome-terminal
-t
"simulator"
-x
bash
-c
"cd /home/smr/sim/bash_src/;
sh sim.sh;exec bash;"
sleep
1
# terminal 3: run the client
gnome-terminal
-t
"client"
-x
bash
-c
"cd /home/smr/sim/bash_src/;
sh client.sh;exec bash;"
sleep
1
# terminal 4: run mrc scripts
gnome-terminal
-t
"mrc"
-x
bash
-c
"cd /home/smr/sim/bash_src/;
sh mov.sh;exec bash;"
sleep
1
# terminate
## show processes
echo
"processes"
ps
-ef
|
grep
"bash"
|
grep
-v
grep
|
awk
'{print $2}'
ps
while
true
;
do
echo
"Enter 'e' to exit"
read
flag
if
[
!
-n
"
$flag
"
]
then
echo
"Invalid input"
else
if
[
$flag
=
'e'
]
then
## clean logg files
rm
-r
*
.logg
## restore config files
if
[
-f
388project_temp
]
;
then
rm
-f
388project
mv
388project_temp 388project
fi
sleep
1
cd
mrc_src
if
[
-f
createWalls_temp
]
;
then
rm
-f
createWalls
mv
createWalls_temp createWalls
fi
cd
..
mv
/
*
.log /logs/.
## kill all terminal processes
gnome-terminal
-t
"close client"
-x
killall
-9
qclient
gnome-terminal
-t
"clear all"
-x
killall
-9
bash
break
fi
fi
done
exit
0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment