Skip to content
Sylvain Guillet edited this page Apr 29, 2024 · 31 revisions

Astrodynamics

Welcome!

Astrodynamics toolkit can be seen as an extension and a C++ wrapper of cspice toolkit(N 67) developped by the JPL.

This project has been initiated to make life easier for people who don't know cspice or need an object-oriented approach.

The goal of this project is to :

  • Allow object oriented development and provide high level objects
  • Abstract file handling (kernels, frames, ...)
  • Evaluate constraints like occultations, body in instrument field of view, ...

This framework has been written in C++ to offer a good performance but if you need a more productive approach you can switch immediately to the .Net version of this project here and you will get the best of the both worlds :

C++ velocity + .Net productivity = ❤️

Caution

Strategy update!

Developing frameworks in astrodynamics takes a lot of time and unfortunately I don't have enough to maintain two frameworks (C++ / .Net), the Web API and the web application.

So I made the decision to mainly focus on the .Net version and remove duplicate features on next version (>= 2.*) of the C++ library.

The .Net version here offers more features, performance is very good and productivity is much better.

To be clear, this project will continue to exist but there will no longer be 1:1 maintenance of features.

If your application does not support .Net, you can use the Web API here

Sorry for the inconvenience

Sylvain

Quick start

Download Astrodynamics framework

Download the latest Linux or Windows release : Releases

At this stage we assume that you have mastered your development environment but if you need some advises for yours developments we suggest you this approach :

In this quick start you have 2 options to install the framework, one from binaries another from cmake.

Option 1 - Install from binaries

On Linux

  1. Create your C/C++ project folder, in this example we assume your output path will be called "build" but you can use the name of your choice.

  2. Extract Includes folder from archive IO-Toolkit-Linux-vx.x.xx-x to folder /usr/local/include/IO/.

  3. Copy libIO.Astrodynamics.so to /usr/local/lib/

  4. Extract Data folder from archive IO-Toolkit-Linux-vx.x.xx-x into your computer. This data folder contains main solar system kernels.

  5. You will need to load these data in your program with the following recursive function

IO::Astrodynamics::Kernels::KernelsLoader::Load("Data/SolarSystem");

On Windows

  1. Create your C/C++ project folder, in this example we assume your output path will be called "build" but you can use the name of your choice.

  2. From the dll package you just downloaded

    • Copy Includes folder at the root of the project
    • Copy IO.Astrodynamics.dll and IO.Astrodynamics.lib in the root folder(used to link libraries) and in the build folder(used at runtime).
    • Copy Data folder into your computer. This data folder contains main solar system kernels.
  3. You will need to load these data in your program with the following recursive function

IO::Astrodynamics::Kernels::KernelsLoader::Load("Data/SolarSystem");

You should have a folder tree like that :

YourProject
  | Includes
  | build         
     | IO.Astrodynamics.dll
     | IO.Astrodynamics.lib
  | IO.Astrodynamics.dll
  | IO.Astrodynamics.lib

Option 2 - Build and install from source code

#Clone project    
git clone https://github.com/IO-Aerospace-software-engineering/Astrodynamics.git

#Go into directory
cd Astrodynamics

#Create build directory    
mkdir build_release

#Go into build directory
cd build_release

#Configure Cmake project
cmake -DCMAKE_BUILD_TYPE=Release ..

#Build project
#-j 4 option is used to define how many threads could be used to compile project, is this example will use 4 threads
cmake --build . --config Release --target IO.Astrodynamics -j 4

#Install libraries and includes
#This command must be executed with admin rights
cmake --install IO.Astrodynamics

⚠️ Windows users ⚠️

Due to heterogeneous Windows development environments, once you've proceeded cmake install you must copy headers and libraries into your project.

Windows users should have a folder tree like that for their project :

 YourProject
   | Includes
   | build_release
      | IO.Astrodynamics.dll
      | IO.Astrodynamics.lib
   | IO.Astrodynamics.dll
   | IO.Astrodynamics.lib

Linux users should have a folder tree like that :

YourProject
   | build_release

Use the framework

Before use the framework, you must install it.

It can be installed from binaries or cmake, these procedures are described above.

  1. Ensure your CMake project contains at least these parameters :
    cmake_minimum_required(VERSION 3.18.0)
    project(MyApp VERSION 0.1.0)
    
    project (MyApp C CXX)
    
    set(CMAKE_C_STANDARD 99)
    set(CMAKE_CXX_STANDARD 17)
    set(CMAKE_POSITION_INDEPENDENT_CODE ON)
    set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
    
    add_executable(MyApp main.cpp)
    
    if (MSVC)
        include_directories(${CMAKE_SOURCE_DIR}/Includes)
        target_link_libraries(MyApp IO.Astrodynamics.dll)
    elseif(UNIX)
        include_directories(/usr/local/include/IO)
        find_library(IO_Astrodynamics_LIB NAMES libIO.Astrodynamics.so)
        target_link_libraries(IOAstrodynamicsTEST ${IO_Astrodynamics_LIB})
    endif ()

Remark : If unspecified, all values are expressed in international system of units (meter, second, radian, m/s, ...)