Getting Started - Razorbotz/RMC-Code-20-21 GitHub Wiki
Welcome to the Razorbotz NASA Robotic Mining Competition Project!
This page intends to provide a starting point and overview of the project, as well as a roadmap for how to get involved with the project even if you aren't familiar with the code or technology stack. Please note that these links may not be up to date and any links should be followed at your own risk. If you find any links that no longer work or changes that need to be made, please contact me at [email protected].
Overview
- Prerequisites
- Understanding the Codebase
- How to contribute
Prerequisites - Windows
To begin the project, install VirtualBox or another virtualization software to your computer. If you are using Linux, disregard the VirtualBox installation.
Installing VirtualBox
To install VirtualBox, download the software here. After downloading and installing VirtualBox, download an image of Ubuntu 20.04 and install Ubuntu. A tutorial on how to do so is located here. To get the virtual machine to be able to be full screen, enter the following commands in the terminal:
sudo apt update
sudo apt install virtualbox-guest-dkms virtualbox-guest-x11 virtualbox-guest-utils
After executing the commands, click on the Devices drop down menu at the top of the virtual machine. Click on Insert Guest Additions Image, then click Run and enter the password when prompted. For any issues, please consult this installation guide.
Installing ROS2
The project uses the Foxy distribution of ROS2. The installation guide is located here. ROS2 can be built from source or from binary files. After installing the files, follow the tutorials to better understand the distribution.
Installing glib
Install the glibmm, gtkmm, and gdkmm libraries to build the control panel for the robot.
sudo apt-get update -y
sudo apt-get install -y libglibmm-2.4-1c2a
sudo apt-get install libgtk2.0-dev
sudo apt-get install libsdl2-dev
sudo apt-get install libgtkmm-3.0-dev
Building Control Panel
To build the control panel, many CMake files will need to be changed in the robotcontroller/build folder. Note that this is not necessary to developing code for the robot and should only be completed if modifying the control panel code.
Understanding the Codebase
First things first: Don't be discouraged by the overall size of this project's package, most of the files/data are auto-generated build/CMake/log files. The code that we're concerned with is under the following directories:
- Root/C++ //Mainly for the Robot Controller Client. This code was written to interface between the robot and the computer controlling it. It runs pure C++ code instead of spinning a ROS2 node. This code was written to run on the client machine instead of on the robot, which is why the code is not in the ROS directory.
- ROS2/skinny/src //The majority of the code for the robot.
The ROS2/skinny directory contains folders for each of the packages that contain the ROS2 nodes for the project.
Structure of the packages
ROS2 packages all contain the following:
- src folder //contains the source code / node files
- CMakeLists.txt //auto-generated file necessary for C++ ROS2 packages
- package.xml //auto-generated file necessary for C++ ROS2 packages
The src folder within a package contains the .cpp files that define nodes and supporting files for classes/objects/functions relevant to that package.