SC-ODIN ADCS Algorithm

Pre-requisites

In order to run the project, the following software is required:

  • CLion
  • Python 3.8.8 (64-bit)
  • vcpkg

CLion

CLion is a C++ IDE distributed by JetBrains. You may get a free student license if you connect your JetBrains account to a GitHub account with the GitHub Student Pack. I strongly recommend using CLion for the project as it provides a ton of useful features and facilitates the development job. Its code completion and warnings seem to be much more robust than Visual Studio and it provides CMake support out of the box. You may download CLion from here.

Python 3.8.8 (64-bit)

Python is an interpreted, high-level and general-purpose programming language. Download the appropriate Python distribution for your operating system from here. In order to run this on Windows, be sure to grab the 64-bit version of Python. Make sure to install Tk/Tlc support as well as to add Python to the PATH on Windows when prompted. Once installed, you will need to use pip (python's package manager) to install the following two packages:

pip install numpy
pip install matplotlib
pip install open3d

If the pip command is not recognized by your system, please follow the instructions on this page to install pip.

vcpkg

vcpkg is a multi-platform package manager for C and C++ projects. You may clone the tool from the official repository here. Once cloned, execute the appropriate bootstrap-vcpkg script for your platform. You may also add the cloned folder to your PATH variable on Windows in order to facilitate the tool's usage. Once setup, you will need to install the following packages using the vcpkg install command:

vcpkg install glm --triplet x64-windows
vcpkg install matplotlib-cpp --triplet x64-windows

Configuration

Once all the pre-requisites are installed, you may clone this repository and open it as a CLion project. Before running the project, you will need to setup a CMake profile with the correct settings. To do so, follow these steps:

  1. In CLion, open the File => Settings menu from the toolbar.

  2. On the left-hand side, navigate to Build, Execution, Deployment => CMake.

  3. Create a new CMake profile using the + icon.

  4. Set the Build Type to Release (always use Release on Windows as Debug changes DLL symbols).

  5. Add the following CMake options, where <PATH TO VCPKG> should point to the directory where vcpkg was cloned:

    -DCMAKE_TOOLCHAIN_FILE=<PATH TO VCPKG>/scripts/buildsystems/vcpkg.cmake
    
  6. Delete the cmake-build-* directories and reload the CMake project.

  7. Run the project through the CMake profile created earlier.

Note: You must have configured your toolchain before being able to compile the project in CLion. I used a Visual Studio toolchain on Windows. If you do the same, make sure to check that your Visual Studio is up-to-date through the Visual Studio Installer. Be sure to set the toolchain's platform to the appropriate 64-bit architecture for your system (ex: amd64).

Troubleshooting

If you are met with compilation errors in the matplotlibcpp.h file, you may need to remove the 4 lines (lines 339-342) causing the errors in the header, as well as to include the <string> module from the standard library at the top of the file.