-
-
Notifications
You must be signed in to change notification settings - Fork 9
Setup (Local)
manx52 edited this page Aug 28, 2024
·
77 revisions
# Optional installation (to save setup time)
sudo snap install discord spotify chromium
# Code dependencies
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
- (If your computer has an Nvidia GPU, otherwise it is highly recommended to get a computer with an Nvidia GPU)
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
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/${OS}/$ARCHITECTURE/ /"
sudo apt-get update
sudo apt-get install -y nvidia-open
sudo apt-get -y install cuda libcudnn9-cuda-12 libcudnn9-dev-cuda-12 libnccl2 libnccl-dev
- References: DONT INSTALL THROUGH THIS
- CUDA Ref: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_network
- CUDNN Ref: https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#installlinux
3. Install ROS Noetic ( http://wiki.ros.org/noetic/Installation/Ubuntu )
- Part 1
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 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 ros-noetic-desktop-full -y
- Part 2
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential -y
sudo rosdep init
rosdep update
- Install catkin-tools
sudo sh \
-c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" \
> /etc/apt/sources.list.d/ros-latest.list'
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y python3-catkin-tools
- Reference: http://wiki.ros.org/noetic/Installation/Ubuntu
- Reference: https://catkin-tools.readthedocs.io/en/latest/installing.html
ssh-keygen # Then keep pressing the enter button, don't set a password
cd ~/.ssh && cat id_rsa.pub # Get contents of public key
# on github > Settings > SSH and GPG Keys > New SSH Key, paste the key
mkdir -p ~/catkin_ws/src && cd ~/catkin_ws
catkin init
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Debug # For Debug builds
cd src
git clone --recurse-submodules git@github.com:utra-robosoccer/soccerbot.git
6. To update and sync the submodules to the latest version of the branch, run this inside the soccerbot folder
git pull
git checkout <desired_branch>
git submodule sync
git submodule update --init --recursive
git-lfs pull
git submodule foreach git-lfs pull
# Pip dependencies and precommit
cd ~/catkin_ws/src/soccerbot/
pip3 install --upgrade pip
pip3 install -r requirements.txt -f https://download.pytorch.org/whl/torch/ -f https://download.pytorch.org/whl/torchvision/
pre-commit install # Will setup your pre-commit, will format and check all files on commit
# Rosdep dependencies
sudo rosdep init # Only need to do this once
rosdep update
cd ~/catkin_ws/src/soccerbot/
rosdep install --from-paths . --ignore-src -r -y
# Building webots
cd ~/catkin_ws/src/soccerbot/external/webots
git submodule sync
git submodule update --init --recursive
git-lfs pull
git submodule foreach git-lfs pull
sudo scripts/install/linux_compilation_dependencies.sh
git clean -xfd
make clean
export WEBOTS_HOME=$HOME/catkin_ws/src/soccerbot/external/webots
make -j$(nproc)
# try ./webots to test if the installation is done correctly
# Building the controllers
cd ~/catkin_ws/src/soccerbot/external/hlvs_webots
pip3 install -r controllers/referee/requirements.txt
sudo apt-get install protobuf-compiler libprotobuf-dev
export WEBOTS_HOME=$HOME/catkin_ws/src/soccerbot/external/webots
make
# Building GameController
sudo apt-get install ant
cd ~/catkin_ws/src/soccerbot/external/GameController
ant
Fixing ros logging in pytests
mkdir -p /home/$USER/.ros/config && cd /home/$USER/.ros/config
ln -s /opt/ros/noetic/etc/ros/python_logging.conf
# Running the build (can be done from anywhere in the workspace
catkin build soccerbot
Setting the correct environmental variables
echo "source /home/$USER/catkin_ws/devel/setup.bash" >> ~/.bashrc
Running the software locally (for docker see https://github.com/utra-robosoccer/soccerbot/wiki/Setup-(Docker))
source ~/.bashrc
roslaunch soccerbot soccerbot_multi.launch
- Sometimes you need to
source ~/.bashrc
in a terminal to get it to work - To exit gazebo quicker run
# For noetic
sudo gedit /opt/ros/noetic/lib/python3/dist-packages/roslaunch/nodeprocess.py
change these 2 lines
_TIMEOUT_SIGINT = 1.0 #seconds
_TIMEOUT_SIGTERM = 1.0 #seconds