forked from autowarefoundation/autoware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·52 lines (43 loc) · 1.6 KB
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# get where I am
MY_PATH=$(readlink -f $(dirname $0))
# what type of terminal
OPTION_WORKING_DIR='--working-directory'
OPTION_CORE_GEOMETRY='--geometry=50x10+0+0'
OPTION_RM_GEOMETRY='--geometry=50x10+500+0'
OPTION_COMMAND='--command'
MASTER_DISPLAY_OPTION="${OPTION_CORE_GEOMETRY} ${OPTION_TITLE}\=\"roscore\""
RUNMGR_DISPLAY_OPTION="${OPTION_RM_GEOMETRY} ${OPTION_TITLE}\=\"runtime_manager\""
if [ $(which gnome-terminal) ]; then
TERMINAL=gnome-terminal
GNOME_VERSION=$(gnome-terminal --version | cut -d '.' -f 2)
if [ ${GNOME_VERSION} -ge 14 ]; then
MASTER_DISPLAY_OPTION=''
RUNMGR_DISPLAY_OPTION=''
fi
elif [ $(which mate-terminal) ]; then
TERMINAL=mate-terminal
elif [ $(which xfce4-terminal) ]; then
TERMINAL=xfce4-terminal
elif [ $(which lxterminal) ]; then
TERMINAL=lxterminal
elif [ $(which konsole) ]; then
TERMINAL=konsole
OPTION_WORKING_DIR='--workdir'
OPTION_CORE_GEOMETRY=''
OPTION_RM_GEOMETRY=''
OPTION_PM_GEOMETRY=''
OPTION_COMMAND='-e'
OPTION_TITLE='-T'
fi
echo "Process Manager"
gksudo --message "Please input password for launching process manager" \
-- $MY_PATH/run_proc_manager &
ADDR=$($MY_PATH/src/.config/rviz/subnet_chk.py -)
if [ "$?" == "0" ]; then
export ROS_IP=$ADDR
fi
# boot ros-master
${TERMINAL} ${MASTER_DISPLAY_OPTION} ${OPTION_WORKING_DIR}=${MY_PATH} ${OPTION_COMMAND}="bash -c 'source ./devel/setup.bash; roscore'"&
# boot runtime_manager
${TERMINAL} ${RUNMGR_DISPLAY_OPTION} ${OPTION_WORKING_DIR}=${MY_PATH} ${OPTION_COMMAND}="bash -c 'source ./devel/setup.bash; rosrun runtime_manager runtime_manager_dialog.py'"