-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[compatibility] mp-units support test
- Loading branch information
1 parent
dcec735
commit e9aabc0
Showing
13 changed files
with
950 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#[[ __ _ __ __ _ _ | ||
| |/ / /\ | | | \/ | /\ | \ | | | ||
| ' / / \ | | | \ / | / \ | \| | | ||
| < / /\ \ | | | |\/| | / /\ \ | . ` | | ||
| . \ / ____ \| |____| | | |/ ____ \| |\ | | ||
|_|\_\/_/ \_\______|_| |_/_/ \_\_| \_| | ||
Kalman Filter | ||
Version 0.4.0 | ||
https://github.com/FrancoisCarouge/Kalman | ||
SPDX-License-Identifier: Unlicense | ||
This is free and unencumbered software released into the public domain. | ||
Anyone is free to copy, modify, publish, use, compile, sell, or | ||
distribute this software, either in source code form or as a compiled | ||
binary, for any purpose, commercial or non-commercial, and by any | ||
means. | ||
In jurisdictions that recognize copyright laws, the author or authors | ||
of this software dedicate any and all copyright interest in the | ||
software to the public domain. We make this dedication for the benefit | ||
of the public at large and to the detriment of our heirs and | ||
successors. We intend this dedication to be an overt act of | ||
relinquishment in perpetuity of all present and future rights to this | ||
software under copyright law. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
For more information, please refer to <https://unlicense.org> ]] | ||
|
||
include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
fmt | ||
GIT_REPOSITORY "https://github.com/fmtlib/fmt" | ||
GIT_SHALLOW TRUE | ||
FIND_PACKAGE_ARGS NAMES fmt) | ||
FetchContent_MakeAvailable(fmt) | ||
|
||
FetchContent_Declare( | ||
gsl-lite | ||
GIT_REPOSITORY "https://github.com/gsl-lite/gsl-lite" | ||
GIT_SHALLOW TRUE | ||
FIND_PACKAGE_ARGS NAMES gsl-lite) | ||
FetchContent_MakeAvailable(gsl-lite) | ||
|
||
FetchContent_Declare( | ||
mp-units | ||
GIT_REPOSITORY "https://github.com/mpusz/mp-units" | ||
GIT_SHALLOW TRUE | ||
SOURCE_SUBDIR "src" FIND_PACKAGE_ARGS NAMES mp-units) | ||
FetchContent_MakeAvailable(mp-units) | ||
|
||
target_compile_options(mp-units INTERFACE $<IF:$<CXX_COMPILER_ID:MSVC>, , | ||
-Wno-double-promotion>) | ||
target_compile_options(mp-units INTERFACE $<IF:$<CXX_COMPILER_ID:MSVC>, , | ||
-Wno-undef>) | ||
|
||
add_library(kalman_unit_mp_units INTERFACE) | ||
target_sources( | ||
kalman_unit_mp_units INTERFACE FILE_SET "unit_headers" TYPE "HEADERS" FILES | ||
"fcarouge/unit.hpp") | ||
target_link_libraries(kalman_unit_mp_units INTERFACE mp-units::mp-units) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* __ _ __ __ _ _ | ||
| |/ / /\ | | | \/ | /\ | \ | | | ||
| ' / / \ | | | \ / | / \ | \| | | ||
| < / /\ \ | | | |\/| | / /\ \ | . ` | | ||
| . \ / ____ \| |____| | | |/ ____ \| |\ | | ||
|_|\_\/_/ \_\______|_| |_/_/ \_\_| \_| | ||
Kalman Filter | ||
Version 0.4.0 | ||
https://github.com/FrancoisCarouge/Kalman | ||
SPDX-License-Identifier: Unlicense | ||
This is free and unencumbered software released into the public domain. | ||
Anyone is free to copy, modify, publish, use, compile, sell, or | ||
distribute this software, either in source code form or as a compiled | ||
binary, for any purpose, commercial or non-commercial, and by any | ||
means. | ||
In jurisdictions that recognize copyright laws, the author or authors | ||
of this software dedicate any and all copyright interest in the | ||
software to the public domain. We make this dedication for the benefit | ||
of the public at large and to the detriment of our heirs and | ||
successors. We intend this dedication to be an overt act of | ||
relinquishment in perpetuity of all present and future rights to this | ||
software under copyright law. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
For more information, please refer to <https://unlicense.org> */ | ||
|
||
#ifndef FCAROUGE_UNIT_HPP | ||
#define FCAROUGE_UNIT_HPP | ||
|
||
#include <mp-units/format.h> | ||
#include <mp-units/framework/quantity.h> | ||
#include <mp-units/math.h> | ||
#include <mp-units/systems/si.h> | ||
|
||
namespace fcarouge { | ||
//! @brief The physical unit quantity. | ||
template <auto Reference, typename Representation> | ||
using quantity = mp_units::quantity<Reference, Representation>; | ||
|
||
template <mp_units::Quantity Type> | ||
inline constexpr auto identity_v<Type>{Type::one()}; | ||
|
||
template <mp_units::Quantity Type> | ||
[[nodiscard]] inline constexpr auto transpose(const Type &value) { | ||
return value; | ||
} | ||
} // namespace fcarouge | ||
|
||
using mp_units::si::metre; | ||
using mp_units::si::second; | ||
using mp_units::si::unit_symbols::m; | ||
using mp_units::si::unit_symbols::m2; | ||
using mp_units::si::unit_symbols::s; | ||
using mp_units::si::unit_symbols::s2; | ||
using mp_units::si::unit_symbols::s3; | ||
inline constexpr auto s4 = pow<4>(second); | ||
|
||
template <typename Scalar> using distance_t = mp_units::quantity<m, Scalar>; | ||
|
||
template <typename Scalar> using velocity_t = mp_units::quantity<m / s, Scalar>; | ||
|
||
template <typename Scalar> | ||
using acceleration_t = mp_units::quantity<m / s2, Scalar>; | ||
|
||
#endif // FCAROUGE_UNIT_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#[[ __ _ __ __ _ _ | ||
| |/ / /\ | | | \/ | /\ | \ | | | ||
| ' / / \ | | | \ / | / \ | \| | | ||
| < / /\ \ | | | |\/| | / /\ \ | . ` | | ||
| . \ / ____ \| |____| | | |/ ____ \| |\ | | ||
|_|\_\/_/ \_\______|_| |_/_/ \_\_| \_| | ||
Kalman Filter | ||
Version 0.4.0 | ||
https://github.com/FrancoisCarouge/Kalman | ||
SPDX-License-Identifier: Unlicense | ||
This is free and unencumbered software released into the public domain. | ||
Anyone is free to copy, modify, publish, use, compile, sell, or | ||
distribute this software, either in source code form or as a compiled | ||
binary, for any purpose, commercial or non-commercial, and by any | ||
means. | ||
In jurisdictions that recognize copyright laws, the author or authors | ||
of this software dedicate any and all copyright interest in the | ||
software to the public domain. We make this dedication for the benefit | ||
of the public at large and to the detriment of our heirs and | ||
successors. We intend this dedication to be an overt act of | ||
relinquishment in perpetuity of all present and future rights to this | ||
software under copyright law. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
For more information, please refer to <https://unlicense.org> ]] | ||
|
||
add_library(kalman_physical_linalg_mp_units_eigen INTERFACE) | ||
target_sources( | ||
kalman_physical_linalg_mp_units_eigen | ||
INTERFACE FILE_SET "unit_headers" TYPE "HEADERS" FILES | ||
"fcarouge/physical_linalg.hpp") | ||
target_link_libraries(kalman_physical_linalg_mp_units_eigen | ||
INTERFACE kalman kalman_unit_mp_units kalman_linalg_eigen) |
Oops, something went wrong.