-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_hardware_moduls.sh
More file actions
executable file
·61 lines (54 loc) · 2.12 KB
/
install_hardware_moduls.sh
File metadata and controls
executable file
·61 lines (54 loc) · 2.12 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
#!/bin/bash
if [ $(id -u) -ne 0 ]
then
echo "This script must be run as root";
exit 1;
fi
if modinfo uvcvideo | grep -q "version:"; then
if modinfo uvcvideo | grep -q "realsense"; then
echo "The required RealSenseSDK modules are already installed"
else
# based on https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md#installing-the-packages
sudo mkdir -p /etc/apt/keyrings
curl -sSf https://librealsense.intel.com/Debian/librealsense.pgp | \
sudo tee /etc/apt/keyrings/librealsense.pgp > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.intel.com/Debian/apt-repo `lsb_release -cs` main" | \
sudo tee /etc/apt/sources.list.d/librealsense.list
sudo apt-get update && sudo apt-get install -y \
librealsense2-dkms \
librealsense2-utils \
librealsense2-dev \
librealsense2-dbg
fi
else
echo "Could not get information about installed RealSenseSDK modules"
fi
# YDLidarSDK
SDK_config_file="/usr/local/lib/cmake/ydlidar_sdk/ydlidar_sdkConfig.cmake"
if [ -f "$SDK_config_file" ]; then
echo "The YDLidar SDK is already installed"
else
# based on https://www.ydlidar.com/Public/upload/files/2022-06-21/YDLIDAR%20X2%20Lidar%20User%20Manual%20V1.3(211228).pdf
git clone https://github.com/YDLIDAR/YDLidar-SDK.git
mkdir -p YDLidar-SDK/build
cd YDLidar-SDK/build
curl -o initenv.sh https://raw.githubusercontent.com/YDLIDAR/ydlidar_ros_driver/master/startup/initenv.sh && \
chmod +x initenv.sh && \
sh initenv.sh
cmake ..
make
sudo make install
cd ../..
rm -rf YDLidar-SDK
fi
# YAHBOOM IMU device
rules_file="/etc/udev/rules.d/imu_usb.rules"
if [ -f "$rules_file" ]; then
echo "The YAHBOOM IMU device is already installed"
else
# based on https://github.com/YahboomTechnology/10-axis_IMU_Module
echo 'KERNEL=="ttyUSB*", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE:="0777", SYMLINK+="imu_usb"' >/etc/udev/rules.d/imu_usb.rules
service udev reload
sleep 2
service udev restart
fi