ROS2_pubsub/non-ros-files/rpi_install.bash

74 lines
1.8 KiB
Bash
Raw Normal View History

2021-03-16 18:11:00 +01:00
#!/bin/bash
2021-01-13 15:28:01 +01:00
# Go through these bash commands one by one
# Prerequisite is a fresh Ubuntu 20.04 !! 64bit !! OS
# Only the password was changed after first boot
# Everything else is stock
# First Update
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y
# Install ROS2 Foxy Fitzroy Desktop
sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
sudo apt update && sudo apt install -y curl gnupg2 lsb-release
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
sudo apt update && sudo apt install -y ros-foxy-ros-base
source /opt/ros/foxy/setup.bash
# Check to see if installed correctly
echo "ROS_VERSION: "$ROS_VERSION
# Install rosdep
sudo apt install -y python3-rosdep2
rosdep update
# Install colcon
sudo apt install -y python3-colcon-common-extensions
# Install pip and argcomplete
sudo apt install -y python3-pip
pip3 install -U argcomplete
# in between
sudo apt update && sudo apt upgrade -y
# Create workspace
mkdir -p ~/colcon_ws/src
cd colcon_ws
colcon build
# Install network tools
sudo apt install -y wireless-tools
# Install Git
sudo apt install -y git
# Setup remote git from inside workspace
cd ~/colcon_ws
git init
2021-03-16 13:49:32 +01:00
# Change the URL to your Git repository
git remote add origin https://egit.irs.uni-stuttgart.de/RoverLehre/ROS2_pubsub.git
2021-01-13 15:28:01 +01:00
git fetch --all
git reset --hard origin/master
# Install your project specific python packages
# You can use pip3 as the install tool, eg:
2021-03-16 13:48:47 +01:00
pip3 install python-can
pip3 install canopen
2021-01-13 15:28:01 +01:00
# again
sudo apt update && sudo apt upgrade -y