-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirst.sh
executable file
·41 lines (33 loc) · 1001 Bytes
/
first.sh
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
#!/usr/bin/env bash
myip=$(hostname -I)
path=$(pwd)
echo "MY IP IS : $myip"
jetsonIP=$(python3 $path/gui.py $myip)
checkupdate=0000
if [ $jetsonIP == $checkupdate ]; then
echo "update Script called"
bash update.sh
exit
fi
echo "Attempt to start GUI"
export ROS_MASTER_URI=http://$jetsonIP:11311
echo ROS_MASTER_URI=http://$jetsonIP:11311
export ROS_IP=$myip
echo ROS_IP=$myip
echo "Exports done"
echo "If taking time please check the network u r connected to...."
echo "Searching for master..."
source /opt/ros/melodic/setup.bash
source ~/catkin_ws/devel/setup.bash
line=$(/opt/ros/melodic/bin/rostopic list /rosout)
#line=$(rostopic list /rosout)
if [ -z $line ] ; then
echo "master not running!!! "
else
echo "master running"
echo "Starting the GUI"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This load$
cd $path && yarn start
fi