Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
9e4dce9
Initial commit
jdavidberger Dec 23, 2021
95a57bc
Initial refactor
jdavidberger Dec 22, 2021
e0c4273
Initial commit
jdavidberger Dec 25, 2021
a43903b
Code dump; no renaming done yet
jdavidberger Dec 28, 2021
33ebfd8
Enable eigen with renames
jdavidberger Dec 28, 2021
fb7782f
Refactoring
jdavidberger Dec 28, 2021
742dc21
Fix for windows
jdavidberger Dec 28, 2021
1bad760
Fixed stray newline
jdavidberger Dec 28, 2021
eeaf004
Cmake tests are confusing
jdavidberger Dec 28, 2021
94705f8
Added sym sqroot to blas
jdavidberger Dec 28, 2021
dd7b714
Windows cant handle blas anymore
jdavidberger Dec 28, 2021
a4ed15d
Eigen off in both places
jdavidberger Dec 28, 2021
12dfe31
Fill in build matrix gaps
jdavidberger Dec 28, 2021
fe5f2f7
Renamed all the old survive stuff
jdavidberger Dec 28, 2021
72826fa
MSVC nees malloc for alloca
jdavidberger Dec 28, 2021
8e9a3cd
Fixed recursive typo
jdavidberger Dec 28, 2021
ac39f02
MSVC typo
jdavidberger Dec 28, 2021
85d45fe
Refactor F into transition callback
jdavidberger Dec 28, 2021
7798ae2
Fixed tests
jdavidberger Dec 28, 2021
f93ced9
Fixed prefix issues; static
jdavidberger Dec 28, 2021
679fd17
Added cleanup code for temps
jdavidberger Dec 28, 2021
aafed01
Added test
jdavidberger Dec 28, 2021
1dd0115
Added workflow
jdavidberger Dec 28, 2021
fd4b474
Recursive submodules in action
jdavidberger Dec 28, 2021
15e3ef5
Remove boost dependency
jdavidberger Dec 28, 2021
9032b8d
Sciplot dep in ci
jdavidberger Dec 28, 2021
c20b3c6
Made sciplot optional
jdavidberger Dec 28, 2021
efe2146
Fixed name in workflow
jdavidberger Dec 28, 2021
32d1a69
Use pip3 for workflow
jdavidberger Dec 28, 2021
738c0b5
include stdio for windows
jdavidberger Dec 28, 2021
2f11546
Export class declaration
jdavidberger Dec 28, 2021
8687169
M_PI macro for windows
jdavidberger Dec 28, 2021
4109def
Added install steps
jdavidberger Dec 28, 2021
36c842e
Adjust tolerance for comparison test
jdavidberger Dec 28, 2021
533b831
Added minimal example, more readme
jdavidberger Dec 28, 2021
e4622f9
Fixed covariance matrix; see https://github.com/rlabbe/Kalman-and-Bay…
jdavidberger Dec 28, 2021
774ddd4
Fixed formatting in code section
jdavidberger Dec 28, 2021
1ed27e3
Fix gitmodules path for public access
jdavidberger Dec 29, 2021
35df918
Update cnmatrix
jdavidberger Dec 29, 2021
4bf057f
Fixed single precision issues
jdavidberger Dec 29, 2021
df9ba72
Fixed single precision issues
jdavidberger Dec 29, 2021
b4172d0
only build tests in toplevel
jdavidberger Dec 30, 2021
4d05df7
Android: Add makefile
Dec 30, 2021
edb6810
Android: Add makefile
Dec 30, 2021
22cad6f
Added codegen capabilities
jdavidberger Dec 30, 2021
21f5b92
Added readme section on code generation
jdavidberger Dec 30, 2021
d205965
Made filterpy use the same code as cnkalman
jdavidberger Dec 30, 2021
3f1ed88
Added symengine to ci
jdavidberger Dec 30, 2021
a0380a4
Updated find eigen logic
jdavidberger Dec 30, 2021
e9c5601
Update cnmatrix
jdavidberger Dec 30, 2021
42aebd4
Added IEKF vs not test
jdavidberger Jan 2, 2022
4dbb6de
Fix when sciplot isn't there
jdavidberger Jan 2, 2022
3d57987
Added optional c++ mechanics
jdavidberger Jan 3, 2022
e950c51
Added TDOA impl
jdavidberger Jan 3, 2022
6f8c1ab
Fix for old g++
jdavidberger Jan 3, 2022
1328549
Needed sstream
jdavidberger Jan 3, 2022
4129639
Added robust svd test
jdavidberger Jan 4, 2022
e1702f1
Broke up eigen into multiple files for compile time
jdavidberger Jan 4, 2022
5b6bb5b
Fix dbl/flt issues
jdavidberger Jan 4, 2022
41fc003
Add backend string api call
jdavidberger Jan 4, 2022
7ee87ef
Add backend string api call
jdavidberger Jan 4, 2022
0fd7108
Android: track source file split
Jan 5, 2022
857cbd0
Added 'add_diag' functions
jdavidberger Jan 8, 2022
4cc491a
Added simpler way to include noise model
jdavidberger Jan 8, 2022
0993004
Fixed openblas multithread issue
jdavidberger Jan 8, 2022
ebd548f
Fix for windows
jdavidberger Jan 8, 2022
398f407
Bug fixs in cnmatrix
jdavidberger Jan 8, 2022
443b439
Enable joseph form
jdavidberger Jan 8, 2022
46be9df
Removed unused functions
jdavidberger Jan 9, 2022
220748f
Code cleanup
jdavidberger Jan 9, 2022
cd25f43
Improve compile times
jdavidberger Jan 14, 2022
d48f434
Begin support for error state
jdavidberger Jan 14, 2022
f159abf
Additional matrix ops
jdavidberger Jan 15, 2022
a866c4c
Codegen support for more operations and types
jdavidberger Jan 15, 2022
6875914
More error state changes; works for IEKF now
jdavidberger Jan 15, 2022
f9021dd
Important change to simple noise model
jdavidberger Jan 16, 2022
b093c5f
Symm check; cnMatView
jdavidberger Jan 17, 2022
93584a9
Allow meas model to be in error space for speed
jdavidberger Jan 17, 2022
48a73eb
Expand codegen
jdavidberger Jan 19, 2022
5a3f5c9
Allow step size specification
jdavidberger Jan 19, 2022
e4dcb47
Refactor to have general extrapolate function
jdavidberger Jan 20, 2022
ffdc063
correctly map step instead of cols
jdavidberger Jan 21, 2022
804c56b
Added support for measurement models with multiple state models
jdavidberger Jan 21, 2022
0a25a86
Fix uninit variable warning
jdavidberger Jan 21, 2022
4987fd6
Support aliased gemm
jdavidberger Jan 21, 2022
614fbdd
Fix address warnings
jdavidberger Jan 21, 2022
e324655
Fix error state / state cnt issues
jdavidberger Jan 21, 2022
4180787
Fixed numeric diff; some issues in iekf
jdavidberger Jan 22, 2022
9733c60
Removed bad qualifier
jdavidberger Jan 23, 2022
b495b00
Various IEKF improvements
jdavidberger Jan 23, 2022
eb3a9f2
Support for multimodel linear jacobians
jdavidberger Jan 24, 2022
04259fe
Allow 0 row ops
jdavidberger Jan 25, 2022
ab87c3a
Support for 0 count error states
jdavidberger Jan 25, 2022
ce07c59
Fix more step/col issues
jdavidberger Jan 27, 2022
125fb47
Fix transpose vec issue
jdavidberger Jan 27, 2022
57b4dbd
Needs this include to make windows happy
jdavidberger Jan 31, 2022
630e034
Fixed clang format decl; WrapMember repr
jdavidberger Feb 1, 2022
5ebeb46
Check args to multrans
jdavidberger Feb 3, 2022
18b7edc
Nicer warning message
jdavidberger Feb 8, 2022
a5504cf
generated_header: add missing stddef include
bl4ckb0ne Feb 2, 2022
5936c62
Verbose options
jdavidberger Feb 15, 2022
6b35031
Update cnmatrix
jdavidberger Feb 15, 2022
b8bdeaa
PYX generator
jdavidberger Mar 16, 2022
6b2be10
Build wheels
jdavidberger Jun 17, 2022
6015925
Packaging init
jdavidberger Jun 17, 2022
59038ab
Code generation robust to issues in inspect
jdavidberger Jul 27, 2022
5d4e833
Generate pxd file too
jdavidberger Sep 14, 2022
bfdebee
QoL improvements
jdavidberger Sep 22, 2022
459373c
Rev version
jdavidberger Sep 26, 2022
45804df
Don't break on compiled code
jdavidberger Sep 26, 2022
6ff7c2f
Swapped out how math operators are exposed
jdavidberger Oct 11, 2022
d75677a
Support generating vectorized output
jdavidberger Oct 30, 2022
2d45e25
Added python bindings
jdavidberger Oct 31, 2022
e4da388
cibuildwheel integration
jdavidberger Oct 31, 2022
0f44760
window fixs
jdavidberger Oct 31, 2022
0395d88
cibuildwheel seems to dirty up the git repo; ignore that for whls
jdavidberger Oct 31, 2022
e0e7b06
Constify read only buffers
jdavidberger Mar 15, 2023
f0c11f7
Update deps
jdavidberger Mar 15, 2023
a880191
fix NAN constant initialization
bl4ckb0ne Mar 11, 2025
8b37e77
ci: update to actions/upload-artifact@v4
bl4ckb0ne Mar 11, 2025
18407cb
ci: overwrite asset upload
bl4ckb0ne Mar 11, 2025
a3aa1ce
cnmatrix: update submodule
bl4ckb0ne Mar 11, 2025
f686f09
merge cnkalman subtree
bl4ckb0ne Mar 17, 2025
b283686
merge cnmatrix subtree
bl4ckb0ne Mar 17, 2025
3e6edf1
submodule cleanup
bl4ckb0ne Mar 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "libs/cnkalman"]
path = libs/cnkalman
url = ../cnkalman.git
[submodule "libs/cnkalman/libs/pybind11"]
path = libs/cnkalman/libs/pybind11
url = [email protected]:pybind/pybind11.git
7 changes: 1 addition & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,7 @@ SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libs/cnkalman/CMakeLists.txt")
find_program(GIT git)
message("Submodule seems empty; populating...")
execute_process(COMMAND ${GIT} submodule update --init --recursive WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()

add_subdirectory(libs/cnmatrix)
add_subdirectory(libs/cnkalman)

add_subdirectory(redist)
Expand Down
1 change: 0 additions & 1 deletion libs/cnkalman
Submodule cnkalman deleted from a3aa1c
1 change: 1 addition & 0 deletions libs/cnkalman/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmake-build-*
52 changes: 52 additions & 0 deletions libs/cnkalman/.github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This is a basic workflow to help you get started with Actions

name: Build Wheels

on:
push:
create:
tags: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'

- name: Get Dependencies
run: pip install twine build

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: "*-win32 *-manylinux_i686 cp36-*"

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

- name: Upload with twine
run: |
python -m pip install twine
python -m twine upload wheelhouse/*.whl --skip-existing
continue-on-error: true
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }}
112 changes: 112 additions & 0 deletions libs/cnkalman/.github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Build and Test

on:
pull_request:
push:
release:
types:
- created

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build_type: [Release]
os: [ubuntu-18.04, windows-latest]
include:
- os: ubuntu-18.04
build_type: Debug
- os: windows-latest
build_type: Debug
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- if: contains(matrix.os, 'ubuntu')
name: Get Dependencies
run: |
sudo apt-get update
sudo apt-get install p7zip-full build-essential zlib1g-dev liblapacke-dev libopenblas-dev libatlas-base-dev python3 python3-pip apt-transport-https python-virtualenv ninja-build libeigen3-dev googletest ${{ matrix.deps }} python3-setuptools
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Get python Dependencies
run: pip3 install filterpy numpy sympy symengine
- name: Setup windows flags
if: contains(matrix.os, 'windows') && matrix.build_type == 'Release'
id: flags
run: echo "::set-output name=SETUP_PY_FLAGS::-G 'Visual Studio 16 2019'"
- name: Get mac dependencies
if: contains(matrix.os, 'macos')
run: |
brew install freeglut lapack openblas
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DUSE_EIGEN=On -DDOWNLOAD_EIGEN=On -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_TESTS=ON -DCMAKE_INSTALL_PREFIX=install_root ${{matrix.config_flags}}

- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE -v

- name: Install
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE --target install

- name: Set bundle name
id: bundle
run: echo "::set-output name=BUNDLE_FILE_NAME::cnkalman-$(git describe --tags)-${{ matrix.os }}.zip"

- name: Bundle
if: matrix.build_type == 'Release'
working-directory: ${{runner.workspace}}/cnkalman
run: 7z a ${{runner.workspace}}/build/${{ steps.bundle.outputs.BUNDLE_FILE_NAME }} ${{runner.workspace}}/build/install_root/*

- uses: actions/upload-artifact@v2
name: Upload
if: matrix.build_type == 'Release'
with:
name: cnkalman-${{ matrix.os }}-${{ matrix.build_type }}
path: |
${{runner.workspace}}/build/${{steps.bundle.outputs.BUNDLE_FILE_NAME}}
- name: Get release
id: get_release
if: github.event_name == 'release'
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Release Asset
id: upload-release-asset
continue-on-error: true
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{runner.workspace}}/build/${{steps.bundle.outputs.BUNDLE_FILE_NAME}}
asset_name: ${{steps.bundle.outputs.BUNDLE_FILE_NAME}}
asset_content_type: application/zip

- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE --output-on-failure -j30
43 changes: 43 additions & 0 deletions libs/cnkalman/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Linux
.idea
*.o
*.so
lib
cmake-build-*
build*

# Temp files
*~
*/\#*\#
\#*\#


# Windows specific
*.dll
*.exe
obj/
bin/
x64/
packages
.vs/
Debug/
Release/
*.VC.db
*.user
*.ipch
*.tlog
*.d
build

.options
.zip
.avi

*/__pycache__
*.pyc

venv
.eggs/
dist/

**/*.egg-info/
13 changes: 13 additions & 0 deletions libs/cnkalman/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := libcnkalman
LOCAL_SRC_FILES := src/iekf.c src/kalman.c src/model.cc src/numerical_diff.c
LOCAL_CPP_EXTENSION := .cc
LOCAL_CFLAGS := -Wno-error=unused-parameter -Wno-error=unused-variable
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/src
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_STATIC_LIBRARIES := libcnmatrix
LOCAL_PROPRIETARY_MODULE := true
include $(BUILD_STATIC_LIBRARY)
69 changes: 69 additions & 0 deletions libs/cnkalman/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
cmake_minimum_required(VERSION 3.12)

project(cnkalman LANGUAGES C CXX)
include(CTest)

include(CheckIncludeFile)
include (CheckSymbolExists)

set(CMAKE_CXX_STANDARD 17)

option(USE_ASAN "Use address sanitizer" OFF)

if(NOT PYTHON_EXECUTABLE)
find_package (Python 3.8 COMPONENTS Interpreter Development REQUIRED)
endif()

if(UNIX)
add_compile_options(-fPIC -Wall -Wno-unused-variable -Wno-switch -Wno-parentheses -Wno-missing-braces -Werror=return-type -fvisibility=hidden -Werror=vla -fno-math-errno -Werror=pointer-arith)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SHARED_FLAGS} -std=gnu99 -Werror=incompatible-pointer-types -Werror=implicit-function-declaration -Werror=missing-field-initializers ")

if(USE_ASAN)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif()
endif()

find_package(sciplot)
if(sciplot_FOUND)
message("Using sciplot...")
add_compile_definitions(HAS_SCIPLOT)
else()
message("Can't use sciplot...")
endif()

add_subdirectory(libs/pybind11)

add_subdirectory(src)

set(cnkalman_root_source_dir ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "")
execute_process(COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${cnkalman_root_source_dir} python3 -c "import cnkalman.codegen as cg"
RESULT_VARIABLE INVALID_PYTHON3 ERROR_QUIET)
set(INVALID_PYTHON3 ${INVALID_PYTHON3} CACHE BOOL "Whether the version of python supports generation or not" FORCE)
function(cnkalman_generate_code FILE)
get_filename_component(DIR ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} DIRECTORY)
get_filename_component(NAME ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} NAME_WE)

if(NOT INVALID_PYTHON3)
add_custom_command(OUTPUT ${DIR}/${NAME}.gen.h COMMAND
${CMAKE_COMMAND} -E env PYTHONPATH=${cnkalman_root_source_dir} python3 ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} --cnkalman-generate-source
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${cnkalman_root_source_dir}/cnkalman/codegen.py
COMMENT "Generating ${DIR}/${NAME}.gen.h...")
else()
message("Using provided ${DIR}/${NAME}.gen.h")
endif()
endfunction()

if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
if(ENABLE_TESTS)
add_subdirectory(tests)
endif()
endif()


install(DIRECTORY include/cnkalman DESTINATION include)
include(GNUInstallDirs)
configure_file(cnkalman.pc.in cnkalman.pc @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cnkalman.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")


21 changes: 21 additions & 0 deletions libs/cnkalman/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016-2018 <>< Charles Lohr, J. David Berger, Michael W. Turvey

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

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 OR COPYRIGHT HOLDERS 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.
Loading
Loading