Skip to content
Snippets Groups Projects
Commit cd91dedc authored by beuchatp's avatar beuchatp
Browse files

Updated installation script to work for both Ubuntu 18 and 20. Added camera...

Updated installation script to work for both Ubuntu 18 and 20. Added camera installation steps to the installation script.
parent bafdd5ac
Branches master
No related tags found
No related merge requests found
......@@ -21,6 +21,16 @@ SHOULD_INSTALL_AND_SETUP_GPIO="true"
# ROS INSTALLATION:
SHOULD_INSTALL_ROS="true"
ROS_CONFIGURATION="desktop-full"
# > Options for config:
# "desktop-full" (Recommended for a GUI-based operating system on a "normal" machine)
# "desktop" (Recommended for a GUI-based operating system on a "low-power" machine))
# "ros-base" (Recommended for a "headless" operating system, i.e., when running ubuntu server, also referred to as "ROS-Base: (Bare Bones)")
# ASCLINIC SYSTEM SETUP:
SHOULD_SETUP_ASCLINIC_SYSTEM_LOCALLY="true"
PATH_FOR_ASCLINIC_SYSTEM_LOCALLY="/home/$(whoami)/"
......@@ -30,13 +40,15 @@ PATH_FOR_ASCLINIC_SYSTEM_LOCALLY="/home/$(whoami)/"
# ROS INSTALLATION:
SHOULD_INSTALL_ROS="true"
ROS_CONFIGURATION="desktop-full"
# > Options for config:
# "desktop-full" (Recommended for a GUI-based operating system on a "normal" machine)
# "desktop" (Recommended for a GUI-based operating system on a "low-power" machine))
# "ros-base" (Recommended for a "headless" operating system, i.e., when running ubuntu server, also referred to as "ROS-Base: (Bare Bones)")
# CAMERA UTILITIES
SHOULD_INSTALL_VIDEO_FOR_LINUX_UTILITIES="true"
# OPEN CV CONTRIBUTED MODULES IN PYTHON
SHOULD_INSTALL_OPENCV_CONTRIB_PYTHON="true"
# END OF: USER SPECIFICATIONS
# ============================================ #
......@@ -156,18 +168,6 @@ then
echo ">> The \"/etc/sysctl.conf\" will be adjusted so that this computer responds to broadcast pings"
fi
if [[ ${SHOULD_SETUP_ASCLINIC_SYSTEM_LOCALLY} = "true" ]]
then
echo ">> The \"asclinic-system\" will be setup locally at the path:"
echo " ${PATH_FOR_ASCLINIC_SYSTEM_LOCALLY}"
fi
if [[ ${SHOULD_SETUP_ASCLINIC_WEB_INTERFACE} = "true" ]]
then
echo ">> The asclinic web interface will be setup locally at the path:"
echo " /home/shared/asclinic/"
fi
if [[ ${SHOULD_INSTALL_AND_SETUP_I2C} = "true" ]]
then
echo ">> I2C will be installed and configured"
......@@ -184,6 +184,28 @@ then
echo " ${ROS_CONFIGURATION}"
fi
if [[ ${SHOULD_SETUP_ASCLINIC_SYSTEM_LOCALLY} = "true" ]]
then
echo ">> The \"asclinic-system\" will be setup locally at the path:"
echo " ${PATH_FOR_ASCLINIC_SYSTEM_LOCALLY}"
fi
if [[ ${SHOULD_INSTALL_VIDEO_FOR_LINUX_UTILITIES} = "true" ]]
then
echo ">> The video for linux (v4l) camera utilities will be installed."
fi
if [[ ${SHOULD_INSTALL_OPENCV_CONTRIB_PYTHON} = "true" ]]
then
echo ">> The OpenCV contributed modules for Python will be installed."
fi
if [[ ${SHOULD_SETUP_ASCLINIC_WEB_INTERFACE} = "true" ]]
then
echo ">> The asclinic web interface will be setup locally at the path:"
echo " /home/shared/asclinic/"
fi
if [[ ${SHOULD_INSTALL_QT} = "true" ]]
then
echo ">> The necessary QT packages will be installed"
......@@ -455,53 +477,6 @@ fi
# ============================================ #
# SETUP THE asclinic-system LOCALLY
if [[ ${SHOULD_SETUP_ASCLINIC_SYSTEM_LOCALLY} = "true" ]]
then
# Inform the user
echo ""
echo ""
echo "NOW SETTING UP THE \"asclinic-system\" LOCALLY"
# Make the "dfall" directory under the users root
# > Note: the -p option means: no error if existing, make parent directories as needed
echo ""
echo ">> Now creating, if necessary, the directory: ${PATH_FOR_ASCLINIC_SYSTEM_LOCALLY}"
mkdir -p ${PATH_FOR_ASCLINIC_SYSTEM_LOCALLY}
# Change directory to this folder
cd ${PATH_FOR_ASCLINIC_SYSTEM_LOCALLY}
# Install git
echo ""
echo ">> Now installing \"git\" package:"
echo ""
sudo apt -y install git
# Clone the asclinic-system git repository
echo ""
echo ">> Now cloning the \"asclinic-system\" repository"
echo ""
git clone https://gitlab.unimelb.edu.au/asclinic/asclinic-system.git
# Add the ROS packge devel setup to the .bashrc
# > Note: added together with a description in comments
echo ""
echo ">> Now adding the sourcing of the asclinic ROS package"
echo " environment variables to the ~/.bashrc file"
echo "# SOURCE THE asclinic ROS PACKAGE DEVEL setup.bash FILE" >> ~/.bashrc
echo "# (Note: this was added as part of the asclinic-system installation)" >> ~/.bashrc
echo "source ${PATH_FOR_ASCLINIC_SYSTEM_LOCALLY}/asclinic-system/catkin_ws/devel/setup.bash" >> ~/.bashrc
fi
# END OF: SETUP THE asclinic-system LOCALLY
# ============================================ #
# ============================================ #
# INSTALL I2C
......@@ -683,13 +658,14 @@ then
echo ">> Now adding packages.ros.org to the software sources list"
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# Setup the keys
echo ""
echo ">> Now setting up the keys"
#sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
#sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
#sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt -y install curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
# Update the package index, i.e., the list of programs
echo ""
......@@ -716,13 +692,27 @@ then
# Source the file also for the current shell
source /opt/ros/${ROS_VERSION_CODENAME}/setup.bash
# Install rosdep and various other tool and dependencies for building ROS packages
# > Note: need to install python3 pacakges for Ubuntu 20 and later
if [[ ${UBUNTU_VERSION_MAJOR} -le "19" ]]
then
sudo apt -y install python-rosdep
sudo apt -y install python-rosinstall python-rosinstall-generator python-wstool build-essential
# Install a few extra things to allow running python3 nodes in ROS
sudo apt -y install python3-pip python3-yaml
pip3 install rospkg catkin_pkg --user
else
sudo apt -y install python3-rosdep
sudo apt -y install python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
sudo apt -y python3-yaml
fi
# Install, initialise and update rosdep
# > Note: rosdep enables you to easily install system
# dependencies for source you want to compile and is
# required to run some core components in ROS
echo ""
echo ">> Now installing, initialising, and updating rosdep"
sudo apt -y install python-rosdep
sudo rosdep init
rosdep update
fi
......@@ -730,4 +720,132 @@ fi
# END OF: INSTALL ROS
# ============================================ #
#if dpkg-query -s gazebo9 1>/dev/null 2>&1; then echo "temp"; fi
\ No newline at end of file
# ============================================ #
# SETUP THE asclinic-system LOCALLY
if [[ ${SHOULD_SETUP_ASCLINIC_SYSTEM_LOCALLY} = "true" ]]
then
# Inform the user
echo ""
echo ""
echo "NOW SETTING UP THE \"asclinic-system\" LOCALLY"
# Make the "dfall" directory under the users root
# > Note: the -p option means: no error if existing, make parent directories as needed
echo ""
echo ">> Now creating, if necessary, the directory: ${PATH_FOR_ASCLINIC_SYSTEM_LOCALLY}"
mkdir -p ${PATH_FOR_ASCLINIC_SYSTEM_LOCALLY}
# Change directory to this folder
cd ${PATH_FOR_ASCLINIC_SYSTEM_LOCALLY}
# Install git
echo ""
echo ">> Now installing \"git\" package:"
echo ""
sudo apt -y install git
# Clone the asclinic-system git repository
echo ""
echo ">> Now cloning the \"asclinic-system\" repository"
echo ""
git clone https://gitlab.unimelb.edu.au/asclinic/asclinic-system.git
# Add the ROS packge devel setup to the .bashrc
# > Note: added together with a description in comments
echo ""
echo ">> Now adding the sourcing of the asclinic ROS package"
echo " environment variables to the ~/.bashrc file"
echo "# SOURCE THE asclinic ROS PACKAGE DEVEL setup.bash FILE" >> ~/.bashrc
echo "# (Note: this was added as part of the asclinic-system installation)" >> ~/.bashrc
echo "source ${PATH_FOR_ASCLINIC_SYSTEM_LOCALLY}asclinic-system/catkin_ws/devel/setup.bash" >> ~/.bashrc
fi
# END OF: SETUP THE asclinic-system LOCALLY
# ============================================ #
# ============================================ #
# INSTALL CAMERA UTILITIES
if [[ ${SHOULD_INSTALL_VIDEO_FOR_LINUX_UTILITIES} = "true" ]]
then
# Inform the user
echo ""
echo ""
echo "NOW INSTALLING THE VIDEO FOR LINUX (V4L) UTILITIES"
# Install the "v4l-utils" pacakge
echo ""
echo ">> Now installing \"v4l-utils\" package:"
echo ""
sudo apt -y install v4l-utils
# Inform the user, and check that the installation worked
echo ""
echo ">> Nothing further to configure for v4l-utils."
#echo ">> Now checking the installation was successful by running the command:"
#echo ">> v4l2-ctl --list-devices"
echo ""
#v4l2-ctl --list-devices
fi
# END OF: INSTALL CAMERA UTILITIES
# ============================================ #
# ============================================ #
# INSTALL OPEN CV CONTRINUTED MODULES FOR PYTHON
if [[ ${SHOULD_INSTALL_OPENCV_CONTRIB_PYTHON} = "true" ]]
then
# Inform the user
echo ""
echo ""
echo "NOW INSTALLING THE OPEN CV CONTRIBUTED MODULES FOR PYTHON"
# Install the "python3-pip" pacakge
echo ""
echo ">> Now installing \"python3-pip\" package:"
echo ""
sudo apt -y install python3-pip
# Install the "scikit-build" pacakge
echo ""
echo ">> Now installing \"scikit-build\" package using pip3:"
echo ""
pip3 install scikit-build
# Install the "Cython" pacakge
echo ""
echo ">> Now installing \"Cython\" package using pip3:"
echo ""
pip3 install Cython
# Install the "numpy" pacakge
echo ""
echo ">> Now installing \"numpy\" package using pip3:"
echo ""
pip3 install numpy
# Install the "opencv-contrib-python" pacakge
echo ""
echo ">> Now installing \"opencv-contrib-python\" package using pip3:"
echo ""
pip3 install opencv-contrib-python
fi
# END OF: INSTALL OPEN CV CONTRINUTED MODULES FOR PYTHON
# ============================================ #
# Command to check if a pacakge is already installed:
#if dpkg-query -s package-name 1>/dev/null 2>&1; then echo "temp"; fi
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment