forked from Assume-Zhan/Eurobot-Localization
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·55 lines (47 loc) · 1.45 KB
/
install.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Function for go back to workspace
function check_backto_ws(){
if [ $(ls | grep devel | wc -l) = 1 ]; then
echo "BACK TO WS"
return 0
else
cd ..
if [ $(pwd) = "/home" ] || [ $(pwd) = "/" ]; then
return -1
else
check_backto_ws
fi
fi
}
# Install basic package
sudo apt update -y
sudo apt install ros-noetic-costmap-converter \
ros-noetic-robot-localization \
ros-noetic-imu-tools \
libusb-1.0-0 libusb-1.0-0-dev -y
# Rename the workspace
PACKAGES_PATH="$( find ~ -name Eurobot-Localization | awk '{print $1}' | head -1)"
# Change visible of lidar sdk
# Build lidar sdk
mv $PACKAGES_PATH/.YDLidar-SDK $PACKAGES_PATH/YDLidar-SDK
cd $PACKAGES_PATH/YDLidar-SDK && mkdir build && cd build
cmake ..
make
sudo make install
# echo "Done make"
mv $PACKAGES_PATH/YDLidar-SDK $PACKAGES_PATH/.YDLidar-SDK
# Go back to Workspace
check_backto_ws
# CHECK missed package
if [ $(rospack find obstacle_detector) ]; then
echo "Has obstacle detector"
else
echo "Missing package : obstacle_detector"
echo "Directly insall obstacle_detector from github"
git clone https://github.com/tysik/obstacle_detector.git src/obstacle_detector
fi
catkin_make
# USB driver setup
cd $PACKAGES_PATH
cd $PACKAGES_PATH/local_filter/imu/phidgets_drivers/phidgets_api
sudo cp debian/udev /etc/udev/rules.d/99-phidgets.rules
sudo udevadm control --reload-rules