Skip to content

Commit

Permalink
updated scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyZJiang committed Dec 1, 2023
1 parent 8e1c8af commit f66776e
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 22 deletions.
6 changes: 3 additions & 3 deletions autostart/autostart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if [[ $1 == "-h" ]]; then
echo " -r, --restart restart all processes launched by autostart"
exit 0
elif [[ $1 == "-l" || $1 == "--log" ]]; then
cat ${HOME}/Unitree_GPS_Integration/autostart/.log
cat ${HOME}/ice9_ugi/autostart/.log
exit 0
elif [[ $1 == "-ka" || $1 == "--killall" ]]; then
kill_all
Expand All @@ -58,14 +58,14 @@ elif [[ $1 == "-r" || $1 == "--restart" ]]; then
fi


log_file=${HOME}/Unitree_GPS_Integration/autostart/.log
log_file=${HOME}/ice9_ugi/autostart/.log
log() {
printf "[%-12.12s]: %s\n" "main" "$1" >> ${log_file}
echo $1
}

export SUDO_ASKPASS=${HOME}/Unitree/autostart/passwd.sh
ice9_scripts=${HOME}/Unitree_GPS_Integration/autostart
ice9_scripts=${HOME}/ice9_ugi/autostart

mv ${log_file} ${log_file}.backup
log "ICE9 autostart list started."
Expand Down
2 changes: 1 addition & 1 deletion autostart/scripts/config_4g.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

log() {
printf "[%-12.12s]: %s\n" "config_4g" "$1" >> ${HOME}/Unitree_GPS_Integration/autostart/.log
printf "[%-12.12s]: %s\n" "config_4g" "$1" >> ${HOME}/ice9_ugi/autostart/.log
echo $1
}

Expand Down
2 changes: 1 addition & 1 deletion autostart/scripts/launch/launch_auxiliary.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

log() {
printf "[%-12.12s]: %s\n" "lch_auxi" "$1" >> ${HOME}/Unitree_GPS_Integration/autostart/.log
printf "[%-12.12s]: %s\n" "lch_auxi" "$1" >> ${HOME}/ice9_ugi/autostart/.log
echo $1
}

Expand Down
2 changes: 1 addition & 1 deletion autostart/scripts/launch/launch_camera.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

log() {
printf "[%-12.12s]: %s\n" "lch_camera" "$1" >> ${HOME}/Unitree_GPS_Integration/autostart/.log
printf "[%-12.12s]: %s\n" "lch_camera" "$1" >> ${HOME}/ice9_ugi/autostart/.log
echo $1
}

Expand Down
2 changes: 1 addition & 1 deletion autostart/scripts/launch/launch_reach.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

log() {
printf "[%-12.12s]: %s\n" "lch_reach" "$1" >> ${HOME}/Unitree_GPS_Integration/autostart/.log
printf "[%-12.12s]: %s\n" "lch_reach" "$1" >> ${HOME}/ice9_ugi/autostart/.log
echo $1
}

Expand Down
2 changes: 1 addition & 1 deletion autostart/scripts/launch/launch_slam.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

log() {
printf "[%-12.12s]: %s\n" "lch_slam" "$1" >> ${HOME}/Unitree_GPS_Integration/autostart/.log
printf "[%-12.12s]: %s\n" "lch_slam" "$1" >> ${HOME}/ice9_ugi/autostart/.log
echo $1
}
log "Launching slam_planner_online..."
Expand Down
2 changes: 1 addition & 1 deletion autostart/scripts/launch/launch_unitree_base.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

log() {
printf "[%-12.12s]: %s\n" "lch_unibase" "$1" >> ${HOME}/Unitree_GPS_Integration/autostart/.log
printf "[%-12.12s]: %s\n" "lch_unibase" "$1" >> ${HOME}/ice9_ugi/autostart/.log
echo $1
}

Expand Down
4 changes: 2 additions & 2 deletions autostart/scripts/launch_roscore.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

log() {
printf "[%-12.12s]: %s\n" "lch_roscore" "$1" >> ${HOME}/Unitree_GPS_Integration/autostart/.log
printf "[%-12.12s]: %s\n" "lch_roscore" "$1" >> ${HOME}/ice9_ugi/autostart/.log
echo $1
}

Expand All @@ -16,7 +16,7 @@ if [ ${is_nano_15} ]; then
log "Husarnet ready, starting roscore..."
sleep 1

source ${HOME}/Unitree_GPS_Integration/autostart/scripts/ros_setup.bash
source ${HOME}/ice9_ugi/autostart/scripts/ros_setup.bash
while true; do
roscore
log "Error! roscore exited."
Expand Down
6 changes: 3 additions & 3 deletions autostart/scripts/launch_unitree.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/bash

log() {
printf "[%-12.12s]: %s\n" "lch_unitree" "$1" >> ${HOME}/Unitree_GPS_Integration/autostart/.log
printf "[%-12.12s]: %s\n" "lch_unitree" "$1" >> ${HOME}/ice9_ugi/autostart/.log
echo $1
}

log "Started..."

is_nano_15=`ifconfig -a|grep "eth0: " -A1|grep "inet 192.168.123.15"|awk '{print $2}'`
is_nano_13=`ifconfig -a|grep "eth0: " -A1|grep "inet 192.168.123.13"|awk '{print $2}'`
launch_scripts_path=${HOME}/Unitree_GPS_Integration/autostart/scripts/launch
ros_setup=${HOME}/Unitree_GPS_Integration/autostart/scripts/ros_setup.bash
launch_scripts_path=${HOME}/ice9_ugi/autostart/scripts/launch
ros_setup=${HOME}/ice9_ugi/autostart/scripts/ros_setup.bash

source ${ros_setup}
while [[ ! $(rostopic list) ]]; do
Expand Down
4 changes: 2 additions & 2 deletions autostart/scripts/ros_setup.bash
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

log_roscore() {
printf "[%-12.12s]: %s\n" "ros_setup" "$1" >> ${HOME}/Unitree_GPS_Integration/autostart/.log
printf "[%-12.12s]: %s\n" "ros_setup" "$1" >> ${HOME}/ice9_ugi/autostart/.log
echo $1
}

Expand All @@ -17,6 +17,6 @@ fi

export ROS_IPV6=on
export ROS_MASTER_URI=http://master:11311
source ${HOME}/Unitree_GPS_Integration/ice9_ws/devel/setup.bash
source ${HOME}/ice9_ugi/ice9_ws/devel/setup.bash

log_roscore "Done."
2 changes: 1 addition & 1 deletion install/files/ice9_autostart.sh.desktop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Desktop Entry]
Type=Application
Exec=/home/unitree/Unitree_GPS_Integration/autostart/autostart.sh
Exec=/home/unitree/ice9_ugi/autostart/autostart.sh
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Expand Down
4 changes: 3 additions & 1 deletion install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ export SUDO_ASKPASS=${HOME}/Unitree/autostart/passwd.sh
autostart_dir=${HOME}/.config/autostart
cp files/ice9_autostart.sh ${autostart_dir}/ice9_autostart.sh.desktop

mv ${autostart_dir}/update.sh.desktop ${autostart_dir}/update.sh.desktop.bak
if [ -f ${autostart_dir}/update.sh.desktop ]; then
mv ${autostart_dir}/update.sh.desktop ${autostart_dir}/update.sh.desktop.bak
fi
if [ -f ${autostart_dir}/slam_planner.sh.desktop ]; then
mv ${autostart_dir}/slam_planner.sh.desktop ${autostart_dir}/slam_planner.sh.desktop.bak
fi
Expand Down
8 changes: 4 additions & 4 deletions install/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ if [ -f ${autostart_dir}/start.sh.desktop.bak ]; then
mv ${autostart_dir}/start.sh.desktop.bak ${autostart_dir}/start.sh.desktop
fi

# Remove ros packages
rm -rf ../ice9_ws/build
rm -rf ../ice9_ws/devel

# Uninstall Husarnet
sudo -A apt remove husarnet -y
sudo -A rm -rf /var/lib/husarnet

# Remove ice9_ugi folder
cd
rm -rf ice9_ugi

# Complete
echo "Uninstallation complete."

0 comments on commit f66776e

Please sign in to comment.