-
Notifications
You must be signed in to change notification settings - Fork 0
coding_environment
This tutorial aims to aid in teaching the developer how to use multiple tools established for this project, as well as creating the base environment for the project and understanding the project's structure.
If you already use git and github, you can skip this step. If you use windows, make sure to be inside your wsl for this.
sudo apt install git
Configure according to github account. For global configuration:
git config --global user.name "username"
git config --global user.email "useremail"
To configure independently per project:
git config user.name "username"
git config user.email "useremail"
-
Generate ssh key pair:
ssh-keygen -t ed25519 -C "[email protected]"
You can leave the default file. Setup password if you wish.
-
Start the ssh-agent in the background:
eval "$(ssh-agent -s)"
-
Add the ssh key to the agent:
ssh-add ~/.ssh/id_ed25519
-
Copy the SSH public key to your clipboard:
cat ~/.ssh/id_ed25519.pub # Then select and copy the contents of the id_ed25519.pub file # displayed in the terminal to your clipboard
Tip: Alternatively, you can locate the hidden .ssh folder, open the file in your favorite text editor, and copy it to your clipboard.
-
In the upper-right corner of any page, click your profile photo, then click Settings.
Screenshot of GitHub's account menu showing options for users to view and edit their profile, content, and settings. The menu item "Settings" is outlined in dark orange. In the "Access" section of the sidebar, click SSH and GPG keys.
-
Click New SSH key or Add SSH key.
-
In the "Title" field, add a descriptive label for the new key. For example, if you're using a personal laptop, you might call this key "Personal laptop".
-
Select the type of key, either authentication or signing. For more information about commit signing, see "About commit signature verification."
-
In the "Key" field, paste your public key.
-
Click Add SSH key.
-
If prompted, confirm access to your account on GitHub. For more information, see "Sudo mode."
For more details on that, checkout the Github tutorials: Generating a new SSH key and Adding a new SSH key to your GitHub account.
Before anything else, you need to clone the project into your laptop using git. Simply hit clone in the home page of the project, select ssh, copy the command and run git clone, or:
git clone [email protected]:fsfeup-driverless/driverless.git
This project is divided into multiple folders inside src folder. Each of these folders contain a ROS2 package. Essentially, the project is composed of multiple ROS2 packages whose nodes interact with each other in runtime. More details on the system's architecture can be found in here.
- Each module is divided into three folders:
- src: executables *.cpp files
- include: libraries and headers *.hpp files
- test: test files
- CMakeLists.txt is used as a build system (ROS2 default): it is a tool used to generate makefiles for c++. Everytime you creat e a new .cpp file, it must be added to the list of executable files in this CMakeLists.txt
In order to properly contribute to this project, a code editor or IDE is suggested. In this tutorial, some suggestions for an environment will be presented.
Visual Studio Code is a general purpose IDE very widely used. VSCode is our choice due to the great quantity of extensions available, namely:
- extensions for ROS environment and ROS2 syntax
- extensions for C++ and Python syntax check
- overall simplicity and great array of tools
Steps:
- Install VSCode
- (Optional but suggested) Install VSCode Extensions
- C++ extension pack (highly suggested)
- ROS extension (suggested)
- Remote Development (mandatory for docker environment)
To get VSCode inside wsl, simply run code
inside WSL and it will install the dependencies necessary and connect to the existing installation of vscode on the Windows system.
The rest of the tutorial should be followed using the WSL environment through the terminal. Only perform one of the alternatives.