-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathros_launchscript.bash
More file actions
executable file
·63 lines (52 loc) · 1.64 KB
/
Copy pathros_launchscript.bash
File metadata and controls
executable file
·63 lines (52 loc) · 1.64 KB
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
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# Check if processes are running - we don't want to start duplicates
IS_RUNNING_ROSCORE=$(ps aux | grep "roscore" | grep -v grep | awk '{print $2}')
IS_RUNNING_LIDAR=$(ps aux | grep "roslaunch urg_node" | grep -v grep | awk '{print $2}')
IS_RUNNING_CAM=$(ps aux | grep "roslaunch usb_cam" | grep -v grep | awk '{print $2}')
IS_RUNNING_SERIAL=$(ps aux | grep "rosrun rosserial_python" | grep -v grep | awk '{print $2}')
IS_RUNNING_GPS=$(ps aux | grep "roslaunch ublox_gps" | grep -v grep | awk '{print $2}')
# Roscore bringup
if [ -z "$IS_RUNNING_ROSCORE" ]
then
echo "roscore already running, skipping..."
else
echo "starting roscore"
screen -S "roscore" -d -m "source $HOME/.bashrc; roscore"
fi
sleep 2
# LIDAR node bringup
if [ -z "$IS_RUNNING_LIDAR" ]
then
echo "LIDAR node already running, skipping..."
else
echo "starting LIDAR node"
screen -d -m roslaunch urg_node urg_lidar.launch
fi
sleep 1
# Camera node bringup
if [ -z "$IS_RUNNING_CAM" ]
then
echo "USB cam node already running, skipping..."
else
echo "starting USB cam node"
screen -d -m roslaunch usb_cam usb_cam-runtime.launch
fi
sleep 1
# GPS node bringup
if [ -z "$IS_RUNNING_GPS" ]
then
echo "GPS node already running, skipping..."
else
echo "starting GPS node"
screen -d -m roslaunch ublox_gps ublox_device.launch param_file_name:=NEO-M8U.yaml
fi
sleep 1
# Serial (Arduino comms) node bringup
if [ -z "$IS_RUNNING_SERIAL" ]
then
echo "Arduino serial link already running, skipping..."
else
echo "starting Arduino serial link"
screen -d -m rosrun rosserial_python serial_node.py _port:=/dev/arduino_nano _baud:=115200
fi
sleep 1