With the new updates from Microsoft on their Windows Subsystem Linu (WSL), we are not anymore forced to have Linux dual-boot. We will present the options for both of them.
We are less familiar with MacOS, and from what we know you must use parallel desktop for now since you need GPU rendering on your VM to display the telemetry properly.
We do recommand to have a clean and fresh installation of ubuntu which will be dedicated to SONIA installation
Here is a quick guide on how to create a dual boot using windows and ubuntu : Dual Boot Installation
We are currently using the ROS noetic distribution hence we need to install Ubuntu 20.04 LTS
Recommanded distribution follow recommandation as per ROS: ROS Distribution
Follow these instructions to install docker.
And don't forget the Manage Docker as a non-root user step after.
Special note: If you want to run dockerized SONIA repos on Windows10, you will need to follow those steps:
- Run the docker login command without the password first:
docker login --username fooin your PowerShell. Then enter your GitHub token when you are prompt for the password.- After you will be able to pull manually docker image your repo depends on like so:
docker pull ghcr.io/sonia-auv/sonia_common/sonia_common:x86-perception-latest.
Windows has improved a lot its WSL integration in the past years and they now provide a good support on how to work with it. They even provide a good tutorial to have a good start.
Since we use Ubuntu 20.04, we recommand using the command wsl --install -d Ubuntu-20.04 in your PowerShell or search for Ubuntu 20.04 in the Windows Store.
To use graphic UIs such as the telemetry or FlexBE, you'll need to install a Xserver.
You have to grant it access to your network by going in the control panel -> Windows Firewall -> Autorise -> Autorise all network access for VcXsrv. Every UI you'll want to use in WSL should work after doing the steps described in the Special bash files section.
Install Git with this tutorial.
Follow these instructions to install docker.
Even if they indicate it's optional to sign-up to Docker, we recommand you do it as you will probably need to pull packages from Docker.
Make sure to activate the WSL integration in Docker settings to be able to run containers.
Now that you have the base setup depending on your OS, we can move on the common tools we will use.
We recommand using VS Code as it has multiples advantages to develop locally with WSL and test on the submarine. Following the installation of WSL, this tutorial will help you configure it.
We recommend using the following list of extension in VSCode:
We use GitHub to store our repositories and our Docker packages, create an account if you don't have one and send a message on Teams to our Software Team Leader (currently Camille Sauvain) to have access.
Wait before having access to our github before doing this section
We have a Command Line Interface available to automate some actions.
To install it, run these commands in your terminal :
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g sonia-auv-cli
Then to create your SSH key for Github run this command :
sonia authenticate
Answer 'Yes' to create a SSH key and display it and go in your GitHub settings, in SSH and GPG keys section to add your key.
When asked to connect to Github Registry Package, you need to create a TOKEN for Docker in your Github account : see here how to do it !
For more informations on the commands available you can read the README.
Once the installation of Ubuntu done if you need to install ROS, a very good tutorial to install ROS Noetic is provided here.
Make sure the Dockerfile file's BASE_IMAGE is the correct docker image path when opening a new repo in a container in VS Code.
Create a folder in your home/user folder named ros_sonia_ws, and add a src folder in it.
Then you can start to clone GitHub repositories in the src folder.
The two most important ones you'll need first are sonia_common and sonia-deploy.
Then it will depend on what project you'll be working.
How to clone a repository (use SSH, otherwise you will not be able to push modifications).
In your home/user folder, enter the following commands in your console:
curl https://gist.githubusercontent.com/sonia-auv-master/3dbb2dab0c7c756e582304234202eb99/raw/19af2b0fe7e80f1b92e308e6311d2535d6fc1c69/.bash_sonia > ~/.bash_sonia
This will import .bash_sonia and will configure environment variables and a few usefull aliases.
Then, open .bashrc, and add the following text at the end :
# SONIA Specific
if [ -f ~/.bash_sonia ]; then
source ~/.bash_sonia
else
echo 'bash_sonia is missing, required environment variables will be missing and aliases might not work'
fi
Save and reboot all your consoles to apply the changes or type source ~/.bashrc in your consoles.
To use our mission system, follow the tutorial provided here.
Clone build-simulation and use either the Windows or Linux build.
The rest of the information is provided here.
To build the messages in sonia_common and be able to debug with ROS locally, go in your ros_sonia_ws folder and enter catkin_make. Once it is finished, source your console with source devel/setup.bash and you should be able to debug ROS messages and services.
Alternatively, if you have done the operations in Special bash files section, you can access your
ros_sonia_wsfrom anywhere by typingsonia-cdin your console and you can source by typingresource.
For more debugging tips, you can check the TroubleShooting Guide and even complete it if you find anything interesting.