-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathROS2-Setup.sh
More file actions
executable file
·92 lines (69 loc) · 3.12 KB
/
ROS2-Setup.sh
File metadata and controls
executable file
·92 lines (69 loc) · 3.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/sh
sudo apt-get update -y
sudo apt-get upgrade -y
# Essentials
cp .startup_shell_text.sh ~/
cp .font.txt ~/
sudo chmod +x ~/.startup_shell_text.sh
sudo apt install net-tools -y
#sudo add-apt-repository ppa:gnome-terminator
sudo apt-get install terminator -y
sudo snap install --classic code -y
sudo apt-get install hardinfo -y
locale # check for UTF-8
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
export LANG=en_US.UTF-8
locale # verify settings
sudo apt install software-properties-common
sudo add-apt-repository universe
sudo apt update && sudo apt install curl -y
export ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F\" '{print $4}')
curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo $VERSION_CODENAME)_all.deb" # If using Ubuntu derivates use $UBUNTU_CODENAME
sudo dpkg -i /tmp/ros2-apt-source.deb
sudo apt update
# sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update && sudo apt install -y \
python3-flake8-blind-except \
python3-flake8-class-newline \
python3-flake8-deprecated \
python3-mypy \
python3-pip \
python3-pytest \
python3-pytest-cov \
python3-pytest-mock \
python3-pytest-repeat \
python3-pytest-rerunfailures \
python3-pytest-runner \
python3-pytest-timeout \
ros-dev-tools
# Create a virtual environment because new policy (adopted since Ubuntu 23.10) protects the base system and forces users to keep their own packages isolated.
sudo apt install python3-venv
python3 -m venv ~/venvs/myenv
echo 'source ~/venvs/myenv/bin/activate' >> ~/.bashrc
sudo apt-get install ros-jazzy-desktop -y
sudo apt upgrade -y
echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc
echo "export ROS_DISTRO=jazzy" >> ~/.bashrc
echo "export ROS_PYTHON_VERSION=3" >> ~/.bashrc
sudo apt install ros-jazzy-gz-ros2-control -y
sudo apt install ros-jazzy-ros2-control -y
sudo apt install ros-jazzy-ros2-controllers -y
sudo apt install ros-jazzy-moveit-py -y
sudo apt install ros-jazzy-srdfdom -y
echo 'source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash' >> ~/.bashrc
echo 'source /usr/share/colcon_cd/function/colcon_cd.sh' >> ~/.bashrc
mkdir -p ~/ros2_jazzy/src
cd ~/ros2_jazzy/src
git clone https://github.com/match-ROS/match_mobile_robotics_jazzy.git
cd match_mobile_robotics_jazzy
git submodule update --init --recursive
cd ~/ros2_jazzy
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src -y
colcon build --symlink-install
echo "source ~/ros2_jazzy/install/setup.bash" >> ~/.bashrc
echo "~/.startup_shell_text.sh" >> ~/.bashrc