Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions .github/_nixshell
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
let pkgs = import (builtins.fetchTarball
"https://github.com/goromal/anixpkgs/archive/refs/tags/v6.22.0.tar.gz") {};
in with pkgs; mkShell {
nativeBuildInputs = [
cmake
lcov
];
buildInputs = [
boost
eigen
manif-geom-cpp
];
}
56 changes: 55 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,58 @@ jobs:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: >
git config --global url."https://github.com/".insteadOf ssh://git@github.com/
- run: export NIXPKGS_ALLOW_UNFREE=1 && nix-build -E 'with (import (fetchTarball "https://github.com/goromal/anixpkgs/archive/refs/tags/v0.5.0.tar.gz") {}); signals-cpp.override { pkg-src = lib.cleanSource ./.; }'
- run: export NIXPKGS_ALLOW_UNFREE=1 && nix-build -E 'with (import (fetchTarball "https://github.com/goromal/anixpkgs/archive/refs/heads/master.tar.gz") {}); signals-cpp.override { pkg-src = lib.cleanSource ./.; }'
code-cov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
with:
name: github-public
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build, test, and generate coverage HTML report
run: |
mkdir build && cd build
nix-shell ../.github/_nixshell --run "cmake .. -DCMAKE_BUILD_TYPE=Debug && make unit-tests"
nix-shell ../.github/_nixshell --run "lcov --capture --directory . --output-file coverage.info && \
lcov --remove coverage.info '/usr/*' '*/test/*' --output-file coverage.info.cleaned && \
genhtml --branch-coverage --ignore-errors source --output-directory coverage_report coverage.info.cleaned"
- name: Upload coverage report artifact
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: build/coverage_report
- name: Post PR comment with coverage artifact (optional)
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const artifactUrl = `https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}`;
const comment = `
### 🧪 Code Coverage Report
The code coverage report has been generated for this PR.

➡️ [View coverage artifact](${artifactUrl})
`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
- name: Copy coverage report into docs/
run: |
mkdir -p docs/coverage
cp -r build/coverage_report/* docs/coverage/
- name: Commit coverage report to docs/
if: github.ref == 'refs/heads/master'
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
git add docs/coverage
git commit -m "Update coverage report [skip ci]" || echo "No changes to commit"
git push
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs/doxygen-awesome-css"]
path = docs/doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ cmake_minimum_required (VERSION 3.16)
set(PROJ_NAME signals-cpp)
project(${PROJ_NAME})

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
endif()

set(CMAKE_CXX_STANDARD 17)

option(BUILD_TESTS "Build Tests" ON)

if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -O0 -g")
endif()

find_package(Eigen3 REQUIRED NO_MODULE)
find_package(manif-geom-cpp REQUIRED)

Expand Down
31 changes: 31 additions & 0 deletions Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Project-related information
PROJECT_NAME = "signals-cpp"
OUTPUT_DIRECTORY = "docs" # Directory where the docs are generated
RECURSIVE = YES # Recursively scan all subdirectories
EXTRACT_ALL = YES # Extract all code comments

# HTML output settings
GENERATE_HTML = YES # Enable HTML documentation
GENERATE_LATEX = NO # Disable LaTeX documentation
HTML_OUTPUT = . # Specify HTML output directory

# Awesome style settings
GENERATE_TREEVIEW = YES # optional. Also works without treeview
DISABLE_INDEX = NO
FULL_SIDEBAR = NO
HTML_EXTRA_STYLESHEET = docs/doxygen-awesome-css/doxygen-awesome.css
HTML_COLORSTYLE = LIGHT # required with Doxygen >= 1.9.5

# MathJax integration (for math rendering)
USE_MATHJAX = YES # Enable MathJax support for math rendering

# Input settings (multiple directories)
INPUT = include # Include both C++ and Python directories for parsing

# File patterns
FILE_PATTERNS = *.cpp *.h *.py # Specify the file types to be parsed

# Additional settings for LaTeX-style math
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = NO
43 changes: 23 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,26 @@

Header-only templated C++ library implementing rigid-body dynamics, derivatives, integrals, and interpolation.

**Under construction**
View the library documentation [HERE](https://andrewtorgesen.com/signals-cpp).

## Implemented Types
## Installation

### Signal Types
This code is meant to be built as a static library with CMake. It should be compatible with the latest versions of
Eigen and Boost (unit test framework only).
The library [manif-geom-cpp](https://github.com/goromal/manif-geom-cpp) must also be installed.

Scalar signal type:
Install with

```cpp
ScalarSignal<T> x;
```bash
mkdir build
cd build
cmake ..
make # or make install
```

Vector signal types:
By default, building will also build and run the unit tests, but this can be turned off with the CMake option `BUILD_TESTS`.

```cpp
Vector1Signal<T> x;
Vector2Signal<T> x;
Vector3Signal<T> x;
Vector4Signal<T> x;
Vector5Signal<T> x;
Vector6Signal<T> x;
Vector7Signal<T> x;
Vector8Signal<T> x;
Vector9Signal<T> x;
Vector10Signal<T> x;
```
### Signals

Manifold signal types:

Expand All @@ -56,7 +50,7 @@ f(SignalType &xInt, TangentSignalType x, double t, bool insertHistory = false);
f(SignalType &xInt, TangentSignalType x, double t, double dt, bool insertHistory = false);
```

### Models
### System Models

*Pending implementations:*

Expand All @@ -74,3 +68,12 @@ f(SignalType &xInt, TangentSignalType x, double t, double dt, bool insertHistory
- Rigid body system confined to a plane (unicycle model).
- `RigidBodyDynamics6DOF<T>`
- Rigid body system in 3D space.

## Docs Generation

Generate updated docs in the `docs/` directory with

```bash
doxygen Doxyfile
```

Loading
Loading