-
Notifications
You must be signed in to change notification settings - Fork 6
/
realsense_install.sh
executable file
·85 lines (73 loc) · 2.98 KB
/
realsense_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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
set -e
sudo apt-get -qq update && sudo apt-get -qq upgrade && sudo apt-get -qq dist-upgrade
sudo apt-get -qq install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
sudo apt-get -qq install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev at
if(($(cat /etc/os-release | grep VERSION_ID|grep -o '".*"' | sed 's/"//g' | cut -c1-2 )==16));then
ROS_VERSION="kinetic"
OS_VERSION="xenial"
LIB_REALSENSE_VERSION=2.48.0
REALSENSE_ROS_VERSION=2.3.1
else
if(($(cat /etc/os-release | grep VERSION_ID|grep -o '".*"' | sed 's/"//g' | cut -c1-2 )==18)); then
ROS_VERSION="melodic"
OS_VERSION="bionic"
LIB_REALSENSE_VERSION=2.48.0
REALSENSE_ROS_VERSION=2.3.1
else
if(($(cat /etc/os-release | grep VERSION_ID|grep -o '".*"' | sed 's/"//g' | cut -c1-2 )==20)); then
ROS_VERSION="noetic"
OS_VERSION="focal"
LIB_REALSENSE_VERSION=2.54.1
REALSENSE_ROS_VERSION=2.3.1
fi
fi
fi
sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
echo "installing for ros version: ${ROS_VERSION} and os version: ${OS_VERSIOIN}"
## Realsense
sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo ${OS_VERSION} main" -u
#You need to figure out the versions you want from https://github.com/IntelRealSense/realsense-ros/releases
sudo apt-mark unhold \
librealsense2 \
librealsense2-udev-rules \
librealsense2-utils \
librealsense2-gl \
librealsense2-net \
librealsense2-dev
sudo apt-get install -y --allow-downgrades librealsense2-dkms \
librealsense2=${LIB_REALSENSE_VERSION}\* \
librealsense2-udev-rules=${LIB_REALSENSE_VERSION}\* \
librealsense2-gl=${LIB_REALSENSE_VERSION}\* \
librealsense2-net=${LIB_REALSENSE_VERSION}\* \
librealsense2-utils=${LIB_REALSENSE_VERSION}\* \
librealsense2-dev=${LIB_REALSENSE_VERSION}\* \
librealsense2-dbg=${LIB_REALSENSE_VERSION}\*
sudo apt-get install -y ros-${ROS_VERSION}-cv-bridge
sudo apt-get install -y ros-${ROS_VERSION}-image-transport
sudo apt-get install -y ros-${ROS_VERSION}-tf
sudo apt-get install -y ros-${ROS_VERSION}-tf2-web-republisher
sudo apt-get install -y ros-${ROS_VERSION}-web-video-server
sudo apt-get install -y ros-${ROS_VERSION}-diagnostic-updater
sudo apt-get install -y ros-${ROS_VERSION}-ddynamic-reconfigure
sudo apt-mark hold \
librealsense2 \
librealsense2-udev-rules \
librealsense2-utils \
librealsense2-gl \
librealsense2-net \
librealsense2-dev
prior=$(pwd)
cd ~/catkin_ws/src
# [ ! -d "realsense-ros" ] && git clone https://github.com/IntelRealSense/realsense-ros.git
# cd realsense-ros/
# git fetch
# git checkout ${REALSENSE_ROS_VERSION}
[ ! -d "realsense-ros" ] && git clone https://github.com/anht-nguyen/realsense-ros.git
cd realsense-ros/
git fetch
git checkout '2.3.1b'
cd ~/catkin_ws
catkin_make --only-pkg-with-deps realsense2_camera realsense2_description
catkin_make install
cd $prior