-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ ask_question() { | |
setup_cuda(){ | ||
if (( has_sudo )); then | ||
export OS=ubuntu2004 | ||
export ARCHITECTURE=x86_64 # sbsa for ARM | ||
wget https://developer.download.nvidia.com/compute/cuda/repos/$OS/$ARCHITECTURE/cuda-$OS.pin | ||
sudo mv cuda-$OS.pin /etc/apt/preferences.d/cuda-repository-pin-600 | ||
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/${OS}/$ARCHITECTURE/3bf863cc.pub | ||
|
@@ -41,12 +40,14 @@ setup_ros(){ | |
sudo apt-get install -y python3-pip vim git git-lfs python-is-python3 | ||
pip3 install pre-commit | ||
echo "export PATH=/home/$USER/.local/bin:$PATH" >> ~/.bashrc && source ~/.bashrc | ||
export PATH=/home/$USER/.local/bin:$PATH | ||
|
||
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' | ||
sudo apt install -y curl # if you haven't already installed curl | ||
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - | ||
sudo apt update && sudo apt install -y ros-noetic-desktop-full | ||
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc && source ~/.bashrc | ||
source /opt/ros/noetic/setup.bash | ||
sudo apt install -y python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential | ||
sudo rosdep init | ||
rosdep update | ||
|
@@ -72,6 +73,7 @@ setup_repo(){ | |
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Debug # For Debug builds | ||
cd src | ||
git clone --recurse-submodules [email protected]:utra-robosoccer/soccerbot.git | ||
cd soccerbot | ||
git pull | ||
git submodule sync | ||
git submodule update --init --recursive | ||
|
@@ -80,24 +82,26 @@ setup_repo(){ | |
|
||
cd ~/catkin_ws/src/soccerbot/ | ||
sudo apt-get install -y $(cat tools/setup/rosdep.txt) | ||
pip install --upgrade pip | ||
pip install -U setuptools[core] | ||
pip install -r /tools/setup/requirements.txt | ||
pip3 install --upgrade pip | ||
pip3 install -U setuptools[core] | ||
pip3 install -r tools/setup/requirements.txt | ||
if (( wants_cuda )) ; then | ||
pip install -r /tools/setup/requirements-gpu.txt | ||
pip3 install -r tools/setup/requirements-gpu.txt | ||
fi | ||
pre-commit install | ||
rosdep update && rosdep install --from-paths . --ignore-src -r -y | ||
|
||
# Building the webots controllers | ||
cd ~/catkin_ws/src/soccerbot/external/hlvs_webots | ||
pip install -r controllers/referee/requirements.txt | ||
sudo apt-get install protobuf-compiler libprotobuf-dev ant | ||
make | ||
if (( wants_webots )) ; then | ||
# Building the webots controllers | ||
cd ~/catkin_ws/src/soccerbot/external/hlvs_webots | ||
pip install -r controllers/referee/requirements.txt | ||
sudo apt-get install protobuf-compiler libprotobuf-dev ant | ||
make | ||
|
||
# Building GameController | ||
cd ~/catkin_ws/src/soccerbot/external/GameController | ||
ant | ||
# Building GameController # TODO add to /usr/local/webots/lib/controller/python38 (added by user) pycharm | ||
cd ~/catkin_ws/src/soccerbot/external/GameController | ||
ant | ||
fi | ||
|
||
mkdir -p /home/$USER/.ros/config && cd /home/$USER/.ros/config | ||
ln -s /opt/ros/noetic/etc/ros/python_logging.conf | ||
|
@@ -116,22 +120,46 @@ setup_repo(){ | |
|
||
has_sudo=0 | ||
wants_cuda=0 | ||
wants_webots=0 | ||
if ask_question "Do you have sudo rights?"; then | ||
has_sudo=1 | ||
sudo apt update | ||
fi | ||
if ask_question "Do you have a nvidia graphics card and want to install cuda"; then | ||
if ask_question "Do you have a nvidia graphics card and want to install cuda?"; then | ||
wants_cuda=1 | ||
fi | ||
if ask_question "Do you to install webots? Warning requires heavy specs."; then | ||
wants_webots=1 | ||
fi | ||
|
||
if (( ! has_sudo )); then | ||
echo "Because, you don't have sudo rights, ensure all necessary ROS packages are installed." | ||
if ask_question "Do you have arm architecture?"; then | ||
export ARCHITECTURE=sbsa # sbsa for ARM | ||
else | ||
export ARCHITECTURE=x86_64 | ||
fi | ||
|
||
|
||
check_internet_connection | ||
|
||
if (( wants_cuda )) ; then | ||
setup_cuda | ||
fi | ||
|
||
setup_ros | ||
setup_repo | ||
|
||
if (( wants_webots )) ; then | ||
sudo apt install -y curl | ||
curl -fsSL https://raw.githubusercontent.com/utra-robosoccer/soccerbot/refs/heads/master/tools/setup/setup_webots.sh > /tmp/setup_webots.sh | ||
bash /tmp/setup_webots.sh | ||
fi | ||
|
||
if ask_question "Install ROS?"; then | ||
setup_ros | ||
fi | ||
|
||
if ask_question "Setup Repo?"; then | ||
if ask_question "Is ssh key setup correctly?"; then # TODO Maybe do a check | ||
setup_repo | ||
else | ||
echo "Please install Repo manually!" | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters