Skip to content

Commit

Permalink
Merge pull request #1 from open-space-collective/dev@lucas
Browse files Browse the repository at this point in the history
Dev@lucas
  • Loading branch information
lucas-bremond authored Sep 5, 2018
2 parents 3f7a48f + 2077b38 commit 2c611ff
Show file tree
Hide file tree
Showing 159 changed files with 105,805 additions and 380 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,7 @@ docs/latex/
## Misc.

tmp/
__pycache__
.ipynb_checkpoints

################################################################################################################################################################
12 changes: 4 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ jobs:

script:

# Pull Docker image from repository
# Login to the Docker registry

- echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
- docker pull openspacecollective/library-astrodynamics:latest || true

# Run tests

Expand All @@ -61,10 +60,9 @@ jobs:

script:

# Pull Docker image from repository
# Login to the Docker registry

- echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
- docker pull openspacecollective/library-astrodynamics:latest || true

# Run coverage

Expand All @@ -74,10 +72,9 @@ jobs:

script:

# Pull Docker image from repository
# Login to the Docker registry

- echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
- docker pull openspacecollective/library-astrodynamics:latest || true

# Generate and deploy documentation

Expand All @@ -97,8 +94,7 @@ jobs:
api_key: ${GITHUB_API_KEY}
file_glob: true
file:
- ./bin/*
- ./lib/*
- ./package/*
skip_cleanup: true
on:
branch: master
Expand Down
35 changes: 29 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ OPTION (BUILD_SHARED_LIBRARY "Build shared library." ON)
OPTION (BUILD_STATIC_LIBRARY "Build static library." OFF)
OPTION (BUILD_UTILITY "Build utility." OFF)
OPTION (BUILD_UNIT_TESTS "Build tests" ON)
OPTION (BUILD_PYTHON_BINDINGS "Build Python bindings." OFF)
OPTION (BUILD_PYTHON_BINDINGS "Build Python bindings." ON)
OPTION (BUILD_CODE_COVERAGE "Build code coverage" OFF)
OPTION (BUILD_DOCUMENTATION "Build documentation" OFF)
OPTION (INSTALL_DATA "Install data" ON)
Expand All @@ -54,7 +54,7 @@ CMAKE_POLICY (SET "CMP0048" NEW)

INCLUDE ("GetGitRevisionDescription" OPTIONAL)

IF (EXISTS "${PROJECT_SOURCE_DIR}/.git/packed-refs" AND COMMAND "GET_GIT_HEAD_REVISION" AND COMMAND "GIT_DESCRIBE")
IF (COMMAND "GET_GIT_HEAD_REVISION" AND COMMAND "GIT_DESCRIBE")

# Versioning using current git branch tag

Expand Down Expand Up @@ -242,17 +242,38 @@ FIND_PACKAGE ("Boost" "1.66" COMPONENTS "regex" "log" REQUIRED)
INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS})
LINK_DIRECTORIES (${Boost_LIBRARY_DIRS})

### Eigen [3]

FIND_PACKAGE ("Eigen3" REQUIRED)

IF (EIGEN3_FOUND)
INCLUDE_DIRECTORIES (${EIGEN3_INCLUDE_DIR})
ELSE ()
MESSAGE (SEND_ERROR "[Eigen 3] not found.")
ENDIF ()

### SGP4

FIND_PACKAGE ("SGP4" REQUIRED)

IF (SGP4_FOUND)
INCLUDE_DIRECTORIES (${SGP4_INCLUDE_DIRS})
LINK_DIRECTORIES (${SGP4_LIBRARY_DIRS})
ELSE ()
MESSAGE (SEND_ERROR "[SGP4] not found.")
ENDIF ()

### Library :: Core [master]

FIND_PACKAGE ("LibraryCore" "2018.6.14" REQUIRED)
FIND_PACKAGE ("LibraryCore" "0.1" REQUIRED)

### Library :: Mathematics [master]

FIND_PACKAGE ("LibraryMathematics" "2018.6.14" REQUIRED)
FIND_PACKAGE ("LibraryMathematics" "0.1" REQUIRED)

### Library :: Physics [master]

FIND_PACKAGE ("LibraryPhysics" "2018.6.14" REQUIRED)
FIND_PACKAGE ("LibraryPhysics" "0.1" REQUIRED)

#####################################################################################3###########################################################################

Expand Down Expand Up @@ -289,6 +310,7 @@ IF (BUILD_SHARED_LIBRARY)

TARGET_LINK_LIBRARIES (${SHARED_LIBRARY_TARGET} "pthread")
TARGET_LINK_LIBRARIES (${SHARED_LIBRARY_TARGET} ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES (${SHARED_LIBRARY_TARGET} ${SGP4_LIBRARIES})
TARGET_LINK_LIBRARIES (${SHARED_LIBRARY_TARGET} ${LibraryCore_LIBRARIES})
TARGET_LINK_LIBRARIES (${SHARED_LIBRARY_TARGET} ${LibraryMathematics_LIBRARIES})
TARGET_LINK_LIBRARIES (${SHARED_LIBRARY_TARGET} ${LibraryPhysics_LIBRARIES})
Expand Down Expand Up @@ -318,6 +340,7 @@ IF (BUILD_STATIC_LIBRARY)

TARGET_LINK_LIBRARIES (${STATIC_LIBRARY_TARGET} "pthread")
TARGET_LINK_LIBRARIES (${STATIC_LIBRARY_TARGET} ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES (${SHARED_LIBRARY_TARGET} ${SGP4_LIBRARIES})
TARGET_LINK_LIBRARIES (${STATIC_LIBRARY_TARGET} ${LibraryCore_LIBRARIES})
TARGET_LINK_LIBRARIES (${STATIC_LIBRARY_TARGET} ${LibraryMathematics_LIBRARIES})
TARGET_LINK_LIBRARIES (${STATIC_LIBRARY_TARGET} ${LibraryPhysics_LIBRARIES})
Expand Down Expand Up @@ -499,7 +522,7 @@ SET (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${C
SET (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
SET (CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")

SET (CPACK_COMPONENTS_ALL "applications" "headers" "libraries" "documentation" "tests" "data")
SET (CPACK_COMPONENTS_ALL "applications" "headers" "libraries" "documentation" "tests" "data" "python")

SET (CPACK_COMPONENT_APPLICATIONS_DISPLAY_NAME "Applications")
SET (CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Headers")
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Orbit, attitude, access.

[![Build Status](https://travis-ci.com/open-space-collective/library-astrodynamics.svg?branch=master)](https://travis-ci.com/open-space-collective/library-astrodynamics)
[![Code Coverage](https://codecov.io/gh/open-space-collective/library-astrodynamics/branch/master/graph/badge.svg)](https://codecov.io/gh/open-space-collective/library-astrodynamics)
[![Documentation](https://readthedocs.org/projects/docs/badge/?version=latest)](https://open-space-collective.github.io/library-astrodynamics)
[![Documentation](https://img.shields.io/readthedocs/pip/stable.svg)](https://open-space-collective.github.io/library-astrodynamics)

## Warning

Expand Down Expand Up @@ -101,6 +101,7 @@ The **Astrodynamics** library internally uses the following dependencies:
|-------------|---------|------------------------|----------------------------------------------------------------------------------------------------------------------|
| Boost | 1.67.0 | Boost Software License | [boost.org](https://www.boost.org) |
| Eigen | 3.3.4 | MPL2 | [eigen.tuxfamily.org](http://eigen.tuxfamily.org/index.php) |
| SGP4 | master | Apache-2.0 | [github.com/dnwrnr/sgp4](https://github.com/dnwrnr/sgp4) |
| Core | master | TBD | [github.com/open-space-collective/library-core](https://github.com/open-space-collective/library-core) |
| Mathematics | master | TBD | [github.com/open-space-collective/library-mathematics](https://github.com/open-space-collective/library-mathematics) |
| Physics | master | TBD | [github.com/open-space-collective/library-physic](https://github.com/open-space-collective/library-physic) |
Expand Down
64 changes: 59 additions & 5 deletions include/Library/Astrodynamics/Access.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef __Library_Mathematics_Access__
#define __Library_Mathematics_Access__
#ifndef __Library_Astrodynamics_Access__
#define __Library_Astrodynamics_Access__

#include <Library/Physics/Time/Interval.hpp>
#include <Library/Physics/Time/Duration.hpp>
#include <Library/Physics/Time/Instant.hpp>

#include <Library/Core/Containers/Array.hpp>
#include <Library/Core/Types/String.hpp>
#include <Library/Core/Types/Real.hpp>

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Expand All @@ -23,19 +27,69 @@ namespace astro
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

using library::core::types::String ;
using library::core::ctnr::Array ;

using library::physics::time::Instant ;
using library::physics::time::Duration ;
using library::physics::time::Interval ;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// @brief Object-to-object visibility

class Access
{

public:

Access ( ) ;
enum class Type
{

Undefined,
Complete,
Partial

} ;

Access ( const Access::Type& aType,
const Instant& anAcquisitionOfSignal,
const Instant& aTimeOfClosestApproach,
const Instant& aLossOfSignal ) ;

bool operator == ( const Access& anAccess ) const ;

bool operator != ( const Access& anAccess ) const ;

friend std::ostream& operator << ( std::ostream& anOutputStream,
const Access& anAccess ) ;

bool isDefined ( ) const ;

bool isComplete ( ) const ;

Access::Type getType ( ) const ;

Instant getAcquisitionOfSignal ( ) const ;

Instant getTimeOfClosestApproach ( ) const ;

Instant getLossOfSignal ( ) const ;

Interval getInterval ( ) const ;

Duration getDuration ( ) const ;

static Access Undefined ( ) ;

static String StringFromType ( const Access::Type& aType ) ;

private:

String toBeRemoved_ ;
Access::Type type_ ;

Instant acquisitionOfSignal_ ;
Instant timeOfClosestApproach_ ;
Instant lossOfSignal_ ;

} ;

Expand Down
100 changes: 100 additions & 0 deletions include/Library/Astrodynamics/Access/Generator.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// @project Library/Astrodynamics
/// @file Library/Astrodynamics/Access/Generator.hpp
/// @author Lucas Brémond <lucas@loftorbital.com>
/// @license TBD

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef __Library_Astrodynamics_Access_Generator__
#define __Library_Astrodynamics_Access_Generator__

#include <Library/Astrodynamics/Access.hpp>
#include <Library/Astrodynamics/Trajectory.hpp>

#include <Library/Physics/Environment.hpp>
#include <Library/Physics/Coordinate/Spherical/AER.hpp>
#include <Library/Physics/Time/Interval.hpp>
#include <Library/Physics/Time/Instant.hpp>
#include <Library/Physics/Units/Derived/Angle.hpp>
#include <Library/Physics/Units/Length.hpp>

#include <Library/Mathematics/Objects/Interval.hpp>

#include <Library/Core/Containers/Array.hpp>

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace library
{
namespace astro
{
namespace access
{

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

using library::core::ctnr::Array ;

using library::math::obj::Interval ;

using library::physics::units::Length ;
using library::physics::units::Angle ;
using library::physics::time::Instant ;
using library::physics::coord::spherical::AER ;
using library::physics::Environment ;

using library::astro::Trajectory ;
using library::astro::Access ;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

class Generator
{

public:

Generator ( const Environment& anEnvironment ) ;

Generator ( const Environment& anEnvironment,
const std::function<bool (const AER&)>& anAerFilter,
const std::function<bool (const Access&)>& anAccessFilter ) ;

bool isDefined ( ) const ;

Array<Access> computeAccesses ( const physics::time::Interval& anInterval,
const Trajectory& aFromTrajectory,
const Trajectory& aToTrajectory ) const ;

void setAerFilter ( const std::function<bool (const AER&)>& anAerFilter ) ;

void setAccessFilter ( const std::function<bool (const Access&)>& anAccessFilter ) ;

static Generator Undefined ( ) ;

static Generator AerRanges ( const Interval<Angle>& anAzimuthRange,
const Interval<Angle>& anElevationRange,
const Interval<Length>& aRangeRange,
const Environment& anEnvironment ) ;

private:

Environment environment_ ;

std::function<bool (const AER&)> aerFilter_ ;
std::function<bool (const Access&)> accessFilter_ ;

} ;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

}
}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#endif

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Loading

0 comments on commit 2c611ff

Please sign in to comment.