-
-
Notifications
You must be signed in to change notification settings - Fork 9
Setup (Local)
Jason Wang edited this page Feb 11, 2023
·
77 revisions
- Install useful development tools
# 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
sudo snap install pre-commit --classic
- Install CUDA, CUDNN (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 -y install cuda libcudnn8 libcudnn8-dev libnccl2 libnccl-dev
- Install ROS Noetic ( http://wiki.ros.org/noetic/Installation/Ubuntu )
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
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 https://catkin-tools.readthedocs.io/en/latest/installing.html
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
Setup your ssh-keys
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
Create a catkin workspace, download the meta repo and its submodules:
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
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
Installing dependencies
# Pip dependencies
cd ~/catkin_ws/src/soccerbot/
pip3 install --upgrade pip
pip3 install -r requirements.txt -f https://download.pytorch.org/whl/torch_stable.html
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 and Game Controller
# 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 -jX # Where X is the number of cores (etc -j12), don't use all cores, use htop to determine number of cores
# 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 python logging in tests
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
Creating and configuring your build
# 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