Skip to content

Commit

Permalink
Merge pull request #149 from usdot-fhwa-stol/release/lavida
Browse files Browse the repository at this point in the history
Merge release/lavida (4.5.0) branch into master
  • Loading branch information
paulbourelly999 authored Apr 10, 2024
2 parents 6ddf3d1 + 04e50df commit 3edfe71
Show file tree
Hide file tree
Showing 112 changed files with 8,031 additions and 1,235 deletions.
79 changes: 17 additions & 62 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,67 +1,22 @@
---
# Reference: https://github.com/PickNikRobotics/roscpp_code_format/blob/master/.clang-format
# ROS 2 C++ style guidelines
# Reference: https://github.com/ament/ament_lint/blob/rolling/ament_clang_format/ament_clang_format/configuration/.clang-format

Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 2
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true
BinPackParameters: true
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: false
PointerBindsToType: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 60
PenaltyBreakString: 1
PenaltyBreakFirstLessLess: 1000
PenaltyExcessCharacter: 1000
PenaltyReturnTypeOnItsOwnLine: 90
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: false
Standard: Auto
IndentWidth: 2
TabWidth: 2
UseTab: Never
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
SortIncludes: false
SpaceAfterCStyleCast: false

# Configure each individual brace in BraceWrapping
AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
BraceWrapping:
AfterClass: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterEnum: true
BreakBeforeBraces: Custom

# Control of individual brace wrapping cases
BraceWrapping: {
AfterClass: 'true'
AfterControlStatement: 'true'
AfterEnum : 'true'
AfterFunction : 'true'
AfterNamespace : 'true'
AfterStruct : 'true'
AfterUnion : 'true'
BeforeCatch : 'true'
BeforeElse : 'true'
IndentBraces : 'false'
}
...
ColumnLimit: 100
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 2
DerivePointerAlignment: false
PointerAlignment: Middle
ReflowComments: false
35 changes: 3 additions & 32 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,3 @@
FROM mcr.microsoft.com/devcontainers/base:ubuntu-20.04

RUN apt update \
&& DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
clang-format \
clang-tidy \
cmake \
g++ \
gcc \
gdb \
libboost-container-dev \
libgtest-dev \
make \
&& rm -rf /var/lib/apt/lists/*

# Install units library
RUN git clone --depth 1 --branch v2.3.3 https://github.com/nholthaus/units.git /tmp/units \
&& cd /tmp/units \
&& cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_DOCS=OFF \
&& cmake --build build \
&& cmake --install build \
&& cd / \
&& rm -rf /tmp/units

# Install Eigen3
RUN git clone --depth 1 --branch 3.4.0 https://gitlab.com/libeigen/eigen.git /tmp/eigen \
&& cd /tmp/eigen \
&& cmake -B build -DCMAKE_BUILD_TYPE=Release -DEIGEN_BUILD_TESTING=OFF -DEIGEN_BUILD_DOC=OFF \
&& cmake --build build \
&& cmake --install build \
&& cd / \
&& rm -rf /tmp/eigen
FROM ghcr.io/usdot-fhwa-stol/carma-builds-x64:carma-system-4.5.0-focal
COPY . /home/multiple_object_tracking/
RUN /home/multiple_object_tracking/scripts/install_dependencies.sh
13 changes: 10 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"name": "Ubuntu",
"build": {
"dockerfile": "Dockerfile"
"dockerfile": "Dockerfile",
"context": "../"
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"streetsidesoftware.code-spell-checker"
"streetsidesoftware.code-spell-checker",
"ms-vscode-remote.remote-containers"
]
}
},
Expand All @@ -18,5 +20,10 @@
"workspaceMount": "type=bind,source=${localWorkspaceFolder},target=/workspace",
// Uncomment for hosts that use SELinux (e.g., RHEL and Fedora)
// "workspaceMount": "type=bind,source=${localWorkspaceFolder},target=/workspace,Z",
"workspaceFolder": "/workspace"
"workspaceFolder": "/workspace",
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
]
}
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/ISSUE_TEMPLATE/issue.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/pull_request_template.md

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI
on:
push:
branches: [develop, master]
pull_request:
types: [opened, synchronize, reopened]
jobs:
build: # Define a job named 'build'
defaults: # Set default values for the job
run:
shell: bash
working-directory: "/opt/carma/"
runs-on: ubuntu-latest # Run on the latest version of Ubuntu

container: # Use a Docker container as the execution environment
image: ghcr.io/usdot-fhwa-stol/carma-builds-x64:carma-system-4.5.0-focal # Docker image to use
env: # Define environment variables for the container
BUILD_WRAPPER_OUT_DIR: "/opt/carma/src/multiple_object_tracking/build/bw-output"
TERM: xterm
options: "--user root" # Additional Docker container options to set permissions

steps: # Define a series of steps to execute in the job
- name: Checkout ${{ github.event.repository.name }} # Checkout the repository
uses: actions/checkout@v3.3.0
with:
fetch-depth: 0 # Disable shallow clones for better analysis relevance
path: src/${{ github.event.repository.name }} # Specify the destination path
- name: Move source code # Move the source code to the desired location
run: mv $GITHUB_WORKSPACE/src/ /opt/carma/
- name: Install Dependencies # Install Dependencies
run: |
/opt/carma/src/multiple_object_tracking/scripts/install_dependencies.sh
- name: Install Gcovr 5.0 # Install Gcovr 5.0
run: |
apt update
DEBIAN_FRONTEND=noninteractive apt install -y curl unzip python3 python3-pip
python3 -m pip install gcovr==5.0
- name: Set up JDK 17
uses: actions/setup-java@v3 # The setup-java action provides the functionality for GitHub Actions runners for Downloading and setting up a requested version of Java
with:
java-version: 17
distribution: "temurin"

- name: Install sonar-scanner and build-wrapper # Install SonarScanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2

- name: Build & Run Tests # Build and run tests for multiple_object_tracking package and run gcovr before sonar scan.
run: |
chmod 755 -R /opt/carma/src
cd /opt/carma/src/multiple_object_tracking/
mkdir build
COVERAGE_FLAGS="-g --coverage -fprofile-arcs -ftest-coverage"
cmake -S . -B build -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug"
build-wrapper-linux-x86-64 --out-dir /opt/carma/src/multiple_object_tracking/build/bw-output cmake --build build/ --config Release
cd build
ctest --output-on-failure
cd ..
gcovr --sonarqube build/coverage.xml -k -s -r .
- name: Find coverage.xml # Find the coverage.xml file
shell: bash
run: |
find "/opt/carma/src/multiple_object_tracking/build/" -name "coverage.xml"
- name: Run SonarScanner # Run SonarScanner for code analysis
uses: usdot-fhwa-stol/actions/sonar-scanner@main
with:
sonar-token: ${{ secrets.SONAR_TOKEN }}
working-dir: "/opt/carma/src/${{ github.event.repository.name }}"
32 changes: 32 additions & 0 deletions .sonarqube/sonar-scanner.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (C) 2018-2024 LEIDOS.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.

# Configuration file for Sonar Scanner used for CI
sonar.projectKey=usdot-fhwa-stol_multiple-object-tracking
sonar.organization=usdot-fhwa-stol
sonar.host.url=https://sonarcloud.io
sonar.sources=/opt/carma/src/multiple_object_tracking/src/, /opt/carma/src/multiple_object_tracking/include/
sonar.tests=/opt/carma/src/multiple_object_tracking/test/
sonar.cfamily.gcov.reportsPath=/opt/carma/src/multiple_object_tracking/build/
sonar.coverageReportPaths=/opt/carma/src/multiple_object_tracking/build/coverage.xml
sonar.sonar.projectBaseDir=/opt/carma/src/multiple_object_tracking/
sonar.cfamily.build-wrapper-output=/opt/carma/src/multiple_object_tracking/build/bw-output
sonar.cpp.file.suffixes=.cpp,.hpp,.tpp
sonar.c.file.suffixes=-
sonar.sourceEncoding=UTF-8

# Set Git as SCM sensor
sonar.scm.disabled=false
sonar.scm.enabled=true
sonar.scm.provider=git
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"cSpell.words": [
"cpptools",
"Ctrv"
"Ctra",
"Ctrv",
"Eigen",
"tparam"
],
"editor.formatOnSave": true,
"files.insertFinalNewline": true,
Expand Down
Loading

0 comments on commit 3edfe71

Please sign in to comment.