-
Notifications
You must be signed in to change notification settings - Fork 0
/
installRealSenseROS.sh
executable file
·81 lines (71 loc) · 2.22 KB
/
installRealSenseROS.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
#!/bin/bash
# Install the Intel Realsense library librealsense on a Jetson TX2 Development Kit
# Copyright (c) 2017 Jetsonhacks
# MIT License
# Usage:
# ./installLibRealSense.sh <catkin workspace>
# If <catkin workspace> is omitted "catkin_ws" assumed
# ROS should already be installed, and a catkin workspace created
# Figure out where to install librealsense
# Save the directory we're installing from:
INSTALL_DIR=$PWD
# Now go get ready to install librealsense
source /opt/ros/kinetic/setup.bash
DEFAULTDIR=catkin_ws
CLDIR="$1"
if [ ! -z "$CLDIR" ]; then
DEFAULTDIR="$CLDIR"
fi
# Check to see if qualified path already
if [ -d "$DEFAULTDIR" ] ; then
echo "Fully qualified path"
else
# Have to add path qualification
DEFAULTDIR=$HOME/$DEFAULTDIR
fi
echo "DEFAULTDIR: $DEFAULTDIR"
if [ -e "$DEFAULTDIR" ] ; then
echo "$DEFAULTDIR exists"
CATKIN_WORKSPACEHIDDEN=$DEFAULTDIR/.catkin_workspace
if [ -e "$CATKIN_WORKSPACEHIDDEN" ] ; then
# This appears to be a Catkin_Workspace
echo "Found catkin workspace in directory: $DEFAULTDIR"
else
echo "$DEFAULTDIR does not appear to be a Catkin Workspace"
echo "The directory does not contain the hidden file .catkin_workspace"
echo "Terminating Installation"
exit 1
fi
else
echo "Catkin Workspace named $DEFAULTDIR does not exist"
echo "Please create a Catkin Workspace before installation"
echo "Terminating Installation"
exit 1
fi
if [ "${DEFAULTDIR: -1}" != "/" ] ; then
DEFAULTDIR=$DEFAULTDIR/
fi
INSTALLDIR="$DEFAULTDIR"src
if [ -e "$INSTALLDIR" ] ; then
echo "Installing librealsense in: $INSTALLDIR"
else
echo "$INSTALLDIR does not appear to be a source of a Catkin Workspace"
echo "The source directory src does not exist"
echo "Terminating Installation"
exit 1
fi
echo "Starting installation of librealsense"
cd $INSTALLDIR
# The current ROS version of librealsense
sudo apt-get install ros-kinetic-librealsense -y
cd $INSTALLDIR
echo "Starting installation of RealSense ROS package"
# Update the dependencies database
rosdep update
git clone https://github.com/intel-ros/realsense.git
cd realsense
git checkout 1.8.0
cd ../..
sudo rosdep -y install --from-paths src --ignore-src --rosdistro kinetic
catkin_make
echo "RealSense ROS Package installed"