Skip to content

Commit 2b66f14

Browse files
committed
[feature] Add sensor modeling C++ tutorial
1 parent e4d0572 commit 2b66f14

File tree

10 files changed

+5680
-5791
lines changed

10 files changed

+5680
-5791
lines changed

bindings/python/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Library ▸ Astrodynamics ▸ Python Bindings
2-
=========================================
1+
Library ▸ Astrodynamics ▸ Bindings ▸ Python
2+
===========================================
33

44
Orbit, attitude, access.
55

tutorials/cpp/.gitkeep

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/
2+
*.exe*
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
################################################################################################################################################################
2+
3+
# @project Library/Astrodynamics
4+
# @file tutorials/cpp/sensor-modeling/CMakeLists.txt
5+
# @author Lucas Brémond <lucas@loftorbital.com>
6+
# @license TBD
7+
8+
################################################################################################################################################################
9+
10+
## Project Properties
11+
12+
SET (PROJECT_NAME "LibraryAstrodynamics")
13+
SET (PROJECT_DESCRIPTION "Sensor modeling tutorial.")
14+
SET (PROJECT_PATH "Library/Astrodynamics")
15+
SET (PROJECT_PACKAGE_NAME "sensor-modeling")
16+
SET (PROJECT_LICENSE "TBD")
17+
SET (PROJECT_VENDOR_ID "org.open-space-collective")
18+
SET (PROJECT_VENDOR_NAME "Open Space Collective")
19+
SET (PROJECT_VENDOR_CONTACT "contact@open-space-collective.org")
20+
SET (PROJECT_VENDOR_URL "open-space-collective.org")
21+
22+
################################################################################################################################################################
23+
24+
## Setup
25+
26+
### Compatibility Check
27+
28+
CMAKE_MINIMUM_REQUIRED (VERSION "2.8.12" FATAL_ERROR)
29+
30+
### Paths
31+
32+
SET (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake")
33+
34+
### Policies
35+
36+
CMAKE_POLICY (SET "CMP0048" NEW)
37+
38+
################################################################################################################################################################
39+
40+
## Project Configuration
41+
42+
PROJECT (${PROJECT_NAME} LANGUAGES "C" "CXX")
43+
44+
SET (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Limited Configs" FORCE)
45+
46+
IF (BUILD_CODE_COVERAGE)
47+
SET (CMAKE_BUILD_TYPE "Debug")
48+
ELSEIF (NOT CMAKE_BUILD_TYPE)
49+
SET (CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type [None|Debug|Release|RelWithDebInfo|MinSizeRel]." FORCE)
50+
ENDIF ()
51+
52+
################################################################################################################################################################
53+
54+
## Flags
55+
56+
### Warnings
57+
58+
IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
59+
60+
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
61+
62+
MESSAGE (FATAL_ERROR "GCC version must be at least 4.8")
63+
64+
ENDIF ()
65+
66+
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wshadow -Wno-deprecated -Wl,--no-undefined")
67+
68+
ENDIF ()
69+
70+
### C++ 14 support
71+
72+
SET (CMAKE_CXX_STANDARD 14)
73+
SET (CMAKE_CXX_STANDARD_REQUIRED ON)
74+
SET (CMAKE_CXX_EXTENSIONS OFF)
75+
76+
################################################################################################################################################################
77+
78+
## Debugging Options
79+
80+
SET (CMAKE_VERBOSE_MAKEFILE 0) # Use 1 for debugging, 0 for release
81+
82+
################################################################################################################################################################
83+
84+
## Dependencies
85+
86+
### Eigen [3]
87+
88+
FIND_PACKAGE ("Eigen3" REQUIRED)
89+
90+
IF (EIGEN3_FOUND)
91+
INCLUDE_DIRECTORIES (${EIGEN3_INCLUDE_DIR})
92+
ELSE ()
93+
MESSAGE (SEND_ERROR "[Eigen 3] not found.")
94+
ENDIF ()
95+
96+
### Library ▸ Core [master]
97+
98+
FIND_PACKAGE ("LibraryCore" "0.1" REQUIRED)
99+
100+
### Library ▸ Mathematics [master]
101+
102+
FIND_PACKAGE ("LibraryMathematics" "0.1" REQUIRED)
103+
104+
### Library ▸ Physics [master]
105+
106+
FIND_PACKAGE ("LibraryPhysics" "0.1" REQUIRED)
107+
108+
### Library ▸ Astrodynamics [master]
109+
110+
FIND_PACKAGE ("LibraryAstrodynamics" "0.1" REQUIRED)
111+
112+
################################################################################################################################################################
113+
114+
## Targets
115+
116+
SET (APPLICATION_NAME "${PROJECT_PACKAGE_NAME}")
117+
SET (APPLICATION_TARGET "${APPLICATION_NAME}.exe")
118+
119+
FILE (GLOB APPLICATION_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
120+
FILE (GLOB APPLICATION_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx")
121+
122+
ADD_EXECUTABLE (${APPLICATION_TARGET} ${APPLICATION_SRCS})
123+
124+
TARGET_LINK_LIBRARIES (${APPLICATION_TARGET} ${LibraryCore_LIBRARIES})
125+
TARGET_LINK_LIBRARIES (${APPLICATION_TARGET} ${LibraryMathematics_LIBRARIES})
126+
TARGET_LINK_LIBRARIES (${APPLICATION_TARGET} ${LibraryPhysics_LIBRARIES})
127+
TARGET_LINK_LIBRARIES (${APPLICATION_TARGET} ${LibraryAstrodynamics_LIBRARIES})
128+
129+
################################################################################################################################################################
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
################################################################################################################################################################
2+
3+
# @project Library/Astrodynamics
4+
# @file tutorials/cpp/sensor-modeling/Dockerfile
5+
# @author Lucas Brémond <lucas@loftorbital.com>
6+
# @license TBD
7+
8+
################################################################################################################################################################
9+
10+
FROM openspacecollective/library-base:0.1.4
11+
12+
LABEL maintainer="lucas@loftorbital.com"
13+
14+
# Arguments
15+
16+
ARG cpu_count=1
17+
18+
# Dependencies
19+
20+
## {fmt} [master]
21+
22+
RUN pushd /tmp > /dev/null \
23+
&& git clone https://github.com/fmtlib/fmt.git \
24+
&& cd fmt \
25+
&& mkdir build \
26+
&& cd build \
27+
&& cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE .. \
28+
&& make --silent -j ${cpu_count} \
29+
&& make install \
30+
&& rm -rf /tmp/fmt \
31+
&& popd > /dev/null
32+
33+
## Eigen [3.3.4]
34+
35+
RUN mkdir /tmp/eigen \
36+
&& cd /tmp/eigen \
37+
&& wget --quiet http://bitbucket.org/eigen/eigen/get/3.3.4.tar.gz \
38+
&& tar -xvf 3.3.4.tar.gz \
39+
&& cd eigen-eigen-5a0156e40feb \
40+
&& mkdir build \
41+
&& cd build \
42+
&& cmake .. \
43+
&& make install \
44+
&& rm -rf /tmp/eigen
45+
46+
## Library ▸ Core [0.1.16]
47+
48+
RUN mkdir -p /tmp/library-core \
49+
&& pushd /tmp/library-core > /dev/null \
50+
&& wget --quiet https://github.com/open-space-collective/library-core/releases/download/0.1.16/library-core-0.1.16-1.x86_64-runtime.rpm \
51+
&& wget --quiet https://github.com/open-space-collective/library-core/releases/download/0.1.16/library-core-0.1.16-1.x86_64-devel.rpm \
52+
&& dnf install -y ./*.rpm \
53+
&& rm -rf /tmp/library-core \
54+
&& popd > /dev/null
55+
56+
## Library ▸ Mathematics [0.1.12]
57+
58+
RUN mkdir -p /tmp/library-mathematics \
59+
&& pushd /tmp/library-mathematics > /dev/null \
60+
&& wget --quiet https://github.com/open-space-collective/library-mathematics/releases/download/0.1.12/library-mathematics-0.1.12-1.x86_64-runtime.rpm \
61+
&& wget --quiet https://github.com/open-space-collective/library-mathematics/releases/download/0.1.12/library-mathematics-0.1.12-1.x86_64-devel.rpm \
62+
&& dnf install -y ./*.rpm \
63+
&& rm -rf /tmp/library-mathematics \
64+
&& popd > /dev/null
65+
66+
## Library ▸ Physics [0.1.8]
67+
68+
RUN mkdir -p /tmp/library-physics \
69+
&& pushd /tmp/library-physics > /dev/null \
70+
&& wget --quiet https://github.com/open-space-collective/library-physics/releases/download/0.1.8/library-physics-0.1.8-1.x86_64-runtime.rpm \
71+
&& wget --quiet https://github.com/open-space-collective/library-physics/releases/download/0.1.8/library-physics-0.1.8-1.x86_64-devel.rpm \
72+
&& dnf install -y ./*.rpm \
73+
&& rm -rf /tmp/library-physics \
74+
&& popd > /dev/null
75+
76+
## Library ▸ Astrodynamics [0.1.3]
77+
78+
RUN mkdir -p /tmp/library-astrodynamics \
79+
&& pushd /tmp/library-astrodynamics > /dev/null \
80+
&& wget --quiet https://github.com/open-space-collective/library-astrodynamics/releases/download/0.1.3/library-astrodynamics-0.1.3-1.x86_64-runtime.rpm \
81+
&& wget --quiet https://github.com/open-space-collective/library-astrodynamics/releases/download/0.1.3/library-astrodynamics-0.1.3-1.x86_64-devel.rpm \
82+
&& dnf install -y ./*.rpm \
83+
&& rm -rf /tmp/library-astrodynamics \
84+
&& popd > /dev/null
85+
86+
# Labels
87+
88+
ARG version
89+
90+
ENV version ${version}
91+
92+
LABEL version="${version}"
93+
94+
# Execution
95+
96+
CMD ["/bin/bash"]
97+
98+
################################################################################################################################################################
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Library ▸ Astrodynamics ▸ Tutorials ▸ C++ ▸ Sensor Modeling
2+
===========================================================
3+
4+
```bash
5+
cmake ..
6+
```
7+
8+
```bash
9+
make
10+
```
11+
12+
```bash
13+
./sensor-modeling.exe
14+
```

0 commit comments

Comments
 (0)