Skip to content

Commit

Permalink
feature(#183): Stochastic flocking
Browse files Browse the repository at this point in the history
- Initial implementation

- Requires injection of global swarm state each timestep, which is kind of
  icky, but the quickest/most computationally efficient way to do it.
  • Loading branch information
jharwell committed Mar 24, 2023
1 parent 10142a4 commit 58d5096
Show file tree
Hide file tree
Showing 918 changed files with 9,839 additions and 4,825 deletions.
59 changes: 48 additions & 11 deletions .dir-locals.el
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,51 @@
(add-to-list 'flycheck-clang-args "-fPIC")
(add-to-list 'flycheck-clang-args "-std=c++17")
(add-to-list 'flycheck-clang-args "-Wno-pragma-once-outside-header")
(add-to-list 'flycheck-clang-definitions "COSM_ENABLE_PAL_TARGET_ROS")
(add-to-list 'flycheck-clang-definitions
"COSM_ENABLE_PAL_TARGET_ARGOS")
;; (add-to-list 'flycheck-clang-definitions
;; "COSM_HAL_TARGET=COSM_HAL_TARGET_ARGOS_FOOTBOT")
(add-to-list 'flycheck-clang-definitions
"COSM_HAL_TARGET=COSM_HAL_TARGET_ARGOS_DRONE")
(add-to-list 'flycheck-clang-definitions
"COSM_HAL_TARGET_HAS_QUADROTOR")
(add-to-list 'flycheck-clang-definitions
"COSM_HAL_TARGET_HAS_2D_BINDINGS")
(add-to-list 'flycheck-clang-definitions
"COSM_HAL_TARGET_HAS_3D_BINDINGS")

(add-to-list 'flycheck-clang-definitions "LIBRA_ER=LIBRA_ER_ALL")
(add-to-list 'flycheck-clang-definitions "RCPPSW_ER_SYSTEM_LOG4CXX")
(add-to-list 'flycheck-clang-args (concat "-isystem" (substitute-in-file-name
"$localroot/system/include")))
(add-to-list 'flycheck-clang-definitions
"LIBRA_ER=LIBRA_ER_ALL")
(add-to-list 'flycheck-clang-definitions
"RCPPSW_ER_SYSTEM_LOG4CXX")
(add-to-list 'flycheck-clang-args
(concat "-isystem" (substitute-in-file-name
"$localroot/system/include")))


(setq flycheck-gcc-include-path includes-list)
(add-to-list 'flycheck-gcc-args "-fPIC")
(add-to-list 'flycheck-gcc-args "-std=c++17")
(add-to-list 'flycheck-gcc-definitions "COSM_ENABLE_PAL_TARGET_ROS")
(add-to-list 'flycheck-gcc-definitions "RCPPSW_ER_SYSTEM_LOG4CXX")
(add-to-list 'flycheck-gcc-definitions "LIBRA_ER=LIBRA_ER_ALL")
(add-to-list 'flycheck-gcc-definitions
"COSM_ENABLE_PAL_TARGET_ARGOS")
(add-to-list 'flycheck-gcc-definitions
"COSM_HAL_TARGET=COSM_HAL_TARGET_ARGOS_DRONE")
(add-to-list 'flycheck-gcc-definitions
"COSM_HAL_TARGET_HAS_QUADROTOR")
(add-to-list 'flycheck-gcc-definitions
"COSM_HAL_TARGET_HAS_2D_BINDINGS")
(add-to-list 'flycheck-gcc-definitions
"COSM_HAL_TARGET_HAS_3D_BINDINGS")
;; (add-to-list 'flycheck-gcc-definitions
;; "COSM_HAL_TARGET=COSM_HAL_TARGET_ARGOS_FOOTBOT")
(add-to-list 'flycheck-gcc-definitions
"RCPPSW_ER_SYSTEM_LOG4CXX")
(add-to-list 'flycheck-gcc-definitions
"LIBRA_ER=LIBRA_ER_ALL")

(add-to-list 'flycheck-gcc-args (concat "-isystem" (substitute-in-file-name
"$localroot/system/include")))
(add-to-list 'flycheck-gcc-args
(concat "-isystem" (substitute-in-file-name
"$localroot/system/include")))

(let ((cc-search-dirs (list (concat (projectile-project-root) "include/cosm/*/*")
(concat (projectile-project-root) "src/*/*")
Expand All @@ -61,6 +89,15 @@
)
)
))
))
)
(nil . ((eval .
(progn
(add-to-list 'projectile-globally-ignored-directories
"docs/doxyoutput")
)
))
)

)

;;; end of .dir-locals.el
35 changes: 35 additions & 0 deletions .github/actions/rcppsw-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Setup RCPPSW'
description: 'Setup RCPPSW for CI and testing'
# inputs:
# who-to-greet: # id of input
# description: 'Who to greet'
# required: true
# default: 'World'
# outputs:
# time: # id of output
# description: 'The time we greeted you'
runs:
using: 'composite'
steps:
- name: Install RCPPSW
shell: bash
run: |
mkdir -p build && cd build
git clone https://github.com/jharwell/rcppsw.git
cd rcppsw
git config --global --add safe.directory $PWD
git checkout devel
git submodule update --init --remote --recursive
mkdir build && cd build
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DLIBRA_DEPS_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=DEV \
-DLIBRA_ER=ALL \
..
JOBS=$(grep -c ^processor /proc/cpuinfo)
make ticpp
make -j${JOBS} install
33 changes: 33 additions & 0 deletions .github/actions/rcsw-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'Setup RCSW'
description: 'Setup RCSW for CI and testing'
# inputs:
# who-to-greet: # id of input
# description: 'Who to greet'
# required: true
# default: 'World'
# outputs:
# time: # id of output
# description: 'The time we greeted you'
runs:
using: 'composite'
steps:
- name: Install RCSW
shell: bash
run: |
mkdir -p build && cd build
git clone https://github.com/jharwell/rcsw.git
cd rcsw
git config --global --add safe.directory $PWD
git checkout devel
git submodule update --init --remote --recursive
mkdir build && cd build
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DLIBRA_DEPS_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=DEV \
..
JOBS=$(grep -c ^processor /proc/cpuinfo)
make -j${JOBS} install
89 changes: 89 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build and test

on:
push:
branches:
- master
- devel

concurrency:
group: "build-and-test"
cancel-in-progress: true

jobs:
build-and-test:
runs-on: ubuntu-latest
container:
image: jharwell/ubuntu22.04:2023-03-23
strategy:
matrix:
CMAKE_BUILD_TYPE:
- OPT
- DEV
COSM_BUILD_FOR:
- ARGOS_FOOTBOT
- ARGOS_DRONE


steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/rcsw-setup
- uses: ./.github/actions/rcppsw-setup
- name: Build=${{ matrix.CMAKE_BUILD_TYPE }} HAL_TARGET=${{ matrix.COSM_BULID_FOR }}
shell: bash
run: |
git config --global --add safe.directory $PWD
git submodule update --init --remote --recursive
mkdir -p build && cd build
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DLIBRA_DEPS_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} \
-DLIBRA_ER=ALL \
-DCOSM_BUILD_FOR=${{ matrix.COSM_BUILD_FOR }} \
..
make -j$(nproc)
docs:
uses: ./.github/workflows/pages.yml
needs:
- build-and-test
secrets: inherit

tag-release:
runs-on: ubuntu-latest
needs:
- build-and-test
container:
image: jharwell/ubuntu22.04:2023-03-23
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3

- name: Push tag
shell: bash
run: |
git config --global --add safe.directory $PWD
git config --global user.email "${{ github.event.pusher.email }}"
git config --global user.name "${{ github.event.pusher.name }}"
git submodule update --init --remote --recursive
VERSION_MAJOR=$(sed -nE 's/.*PROJECT_VERSION_MAJOR ([0-9]+).*/\1/p' cmake/project-local.cmake)
VERSION_MINOR=$(sed -nE 's/.*PROJECT_VERSION_MINOR ([0-9]+).*/\1/p' cmake/project-local.cmake)
VERSION_PATCH=$(sed -nE 's/.*PROJECT_VERSION_PATCH ([0-9]+).*/\1/p' cmake/project-local.cmake)
PACKAGE_VERSION=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH
if [ "${{ github.ref }}" = "refs/heads/devel" ]; then
TAG_VERSION=${PACKAGE_VERSION}.beta
TAG_MESSAGE="Development release ${TAG_VERSION}"
else
TAG_VERSION=${PACKAGE_VERSION}
TAG_MESSAGE="Release ${TAG_VERSION}"
fi
git tag ${TAG_VERSION} -m "${TAG_MESSAGE}"
git push -o ci.skip origin ${TAG_VERSION}
70 changes: 70 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Simple workflow for deploying static content to GitHub Pages
name: docs

on:
workflow_call:
# Runs on pushes targeting the default branch
# push:
# branches:
# - master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
container:
image: jharwell/ubuntu22.04:2023-03-23
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/rcsw-setup
- uses: ./.github/actions/rcppsw-setup
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3

- shell: bash
run: |
git config --global --add safe.directory $PWD
git submodule update --init --remote --recursive
mkdir -p build && cd build
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=DEV \
-DCOSM_BUILD_FOR=ARGOS_FOOTBOT \
..
make apidoc
cd ..
cd docs && make html
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./docs/_build/html

deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ node_modules

# Sphinx
docs/_build/
docs/api
docs/_api
docs/_ext/__pycache__
Loading

0 comments on commit 58d5096

Please sign in to comment.