Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement libpointmatcher turnkey install scripts for user who have cloned the repo #547

Merged
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
2 changes: 1 addition & 1 deletion .env.libpointmatcher
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PROJECT_SRC_NAME="$( basename ${PROJECT_PATH} )"
# Note: Those with "PROJECT_" prefix will get eventualy overiden in the case where N2ST is used
# as a library. Using generic testing logic require that environment variables with
# "PROJECT_" prefix be available.
LPM_PROMPT_NAME="${PROJECT_PROMPT_NAME"
LPM_PROMPT_NAME="${PROJECT_PROMPT_NAME}"
LPM_GIT_REMOTE_URL="${PROJECT_GIT_REMOTE_URL}"
LPM_GIT_NAME="${PROJECT_GIT_NAME}"
LPM_PATH="${PROJECT_PATH}"
Expand Down
12 changes: 10 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,26 @@
# These owners will be the default owners for everything in the repo.
#* @pomerlef

# ....Core directories and files...................................................................

# ....High level files.............................................................................
/README.md @pomerlef
/LICENSE @pomerlef

# ....Core directories and files...................................................................
/doc @boxanm @simonpierredeschenes @aguenette @pomerlef
/pointmatcher @boxanm @simonpierredeschenes @aguenette
/python @boxanm @simonpierredeschenes @aguenette
/utest @boxanm @simonpierredeschenes @aguenette
/examples @boxanm @simonpierredeschenes @aguenette

# ....User install tools...........................................................................
/.env.libpointmatcher @RedLeader962
/libpointmatcher_installer.bash @RedLeader962
/libpointmatcher_dependencies_installer.bash @RedLeader962

# ....DevOps related...............................................................................
/.github/ @RedLeader962
/build_system/ @RedLeader962
/build_system/utilities @RedLeader962
/.gitmodules @RedLeader962
/.gitignore @RedLeader962
/.dockerignore @RedLeader962
Expand Down
43 changes: 34 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,39 @@
[![Mentioned in Awesome LIDAR](https://awesome.re/mentioned-badge.svg)](https://github.com/szenergy/awesome-lidar#basic-matching-algorithms) Awesome LIDAR; [![Mentioned in Awesome Robotics Libraries](https://awesome.re/mentioned-badge.svg)](http://jslee02.github.io/awesome-robotics-libraries/#3d-mapping) Awesome Robotics Libraries; [![Mentioned in Awesome Robotics](https://awesome.re/mentioned-badge.svg)](https://github.com/ahundt/awesome-robotics#point-clouds) Awesome Robotics
<div align="center">

![banner](doc/images/banner_light.jpeg)

[//]: # (====Awesome badges=======================================================================)

---
[![Mentioned in Awesome LIDAR](https://awesome.re/mentioned-badge.svg)](https://github.com/szenergy/awesome-lidar#basic-matching-algorithms)
&nbsp; &nbsp; &nbsp;
[![Mentioned in Awesome Robotics Libraries](https://awesome.re/mentioned-badge.svg)](http://jslee02.github.io/awesome-robotics-libraries/#3d-mapping)
&nbsp; &nbsp; &nbsp;
[![Mentioned in Awesome Robotics](https://awesome.re/mentioned-badge.svg)](https://github.com/ahundt/awesome-robotics#point-clouds)
<br>
<sup>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<a href="https://github.com/szenergy/awesome-lidar#basic-matching-algorithms">LIDAR</a>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<a href="https://github.com/ahundt/awesome-robotics#point-clouds">Robotics</a>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<a href="http://jslee02.github.io/awesome-robotics-libraries/#3d-mapping">Robotics Libraries</a>
</sup>


[//]: # (====GitHub badges========================================================================)

<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/norlab-ulaval/libpointmatcher">
<img alt="GitHub forks" src="https://img.shields.io/github/forks/norlab-ulaval/libpointmatcher">
<img alt="GitHub License" src="https://img.shields.io/github/license/norlab-ulaval/libpointmatcher">
<img alt="GitHub release (with filter)" src="https://img.shields.io/github/v/release/norlab-ulaval/libpointmatcher">
<img src="https://img.shields.io/static/v1?label=JetBrains TeamCity&message=CI/CD&color=green?style=plastic&logo=teamcity" />
<br>
<br>
</div>


[//]: # (====Supported OS and aarch===============================================================)

`libpointmatcher` is tested on our build system under the following architecture and OS:
- x86 and arm64/v8
- Ubuntu bionic (18.04) and focal (20.04)
Expand All @@ -13,14 +42,10 @@ Note:
- support for Ubuntu jammy (22.04) comming soon
- `libpointmatcher` reportedly works on MacOs OsX (latest) and Windows (latest)

<div align="center">
<img src="https://img.shields.io/static/v1?label=powered by JetBrains TeamCity&message=CI/CD&color=green?style=plastic&logo=teamcity" />
</div>

<br>
<br>
---

<div style="padding: 20px;padding-top: 5px;padding-bottom: 5px; margin-top:20px;margin-bottom:20px; border: 2px solid LightGray; border-radius:10px;">
[//]: # (====Release note=========================================================================)

### ★ Version `1.4.0` release note (important)
This release of _libpointmatcher_ introduces the integration of [norlab-build-system (NBS)](https://github.com/norlab-ulaval/norlab-build-system) as a _git submodule_ for codebase development and testing.
Expand All @@ -33,8 +58,8 @@ If _libpointmatcher_ was previously cloned, execute the following to fetch its n
```shell
git submodule update --remote --recursive --init
```
</div>

[//]: # (====Body=================================================================================)
# Documentation and Tutorials

libpointmatcher is a modular library implementing the Iterative Closest Point (ICP) algorithm for aligning point clouds. It has applications in robotics and computer vision.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="(HELP) bash libpointmatcher_installer.bash › --help menu" type="ShConfigurationType" folderName="[LPM] D | help menu">
<option name="SCRIPT_TEXT" value="bash libpointmatcher_installer.bash --help" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs>
<env name="BUILDX_BUILDER" value="local-builder-multiarch-virtual" />
</envs>
<method v="2" />
</configuration>
</component>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="(HELP) bash lpm_crawl.* › --help menu" type="ShConfigurationType" folderName="[LPM] B | dry-run">
<configuration default="false" name="(HELP) bash lpm_crawl.* › --help menu" type="ShConfigurationType" folderName="[LPM] D | help menu">
<option name="SCRIPT_TEXT" value="bash lpm_crawl_libpointmatcher_build_matrix.bash --help" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="(HELP) bash lpm_install_libpointmatcher_ubuntu.bash › --help menu" type="ShConfigurationType" folderName="[LPM] D | help menu">
<option name="SCRIPT_TEXT" value="bash lpm_install_libpointmatcher_ubuntu.bash --help" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$/build_system/ubuntu" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs>
<env name="BUILDX_BUILDER" value="local-builder-multiarch-virtual" />
</envs>
<method v="2" />
</configuration>
</component>
8 changes: 4 additions & 4 deletions build_system/lpm_crawl_dependencies_build_matrix.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ NBS_PATH="${LPM_BUILD_SYSTEM_PATH}/utilities/norlab-build-system"
N2ST_PATH="${LPM_BUILD_SYSTEM_PATH}/utilities/norlab-shell-script-tools"

# ....Load environment variables from file.........................................................
cd "${LPM_BUILD_SYSTEM_PATH}" || exit
cd "${LPM_BUILD_SYSTEM_PATH}" || exit 1
set -o allexport && source .env && set +o allexport

# ....Source NBS dependencies......................................................................
cd "${NBS_PATH}" || exit
cd "${NBS_PATH}" || exit 1
source import_norlab_build_system_lib.bash

# ====begin========================================================================================
cd "${NBS_PATH}/src/utility_scripts" || exit
cd "${NBS_PATH}/src/utility_scripts" || exit 1

DOTENV_BUILD_MATRIX_REALPATH=${LPM_BUILD_SYSTEM_PATH}/.env.build_matrix.dependencies

# Note: do not double cote PARAMS or threat it as a array otherwise it will cause error
# Note: do not double quote PARAMS or threat it as a array otherwise it will cause error
# shellcheck disable=SC2086
source nbs_execute_compose_over_build_matrix.bash "${DOTENV_BUILD_MATRIX_REALPATH}" $PARAMS
8 changes: 4 additions & 4 deletions build_system/lpm_crawl_libpointmatcher_build_matrix.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ NBS_PATH="${LPM_BUILD_SYSTEM_PATH}/utilities/norlab-build-system"
N2ST_PATH="${LPM_BUILD_SYSTEM_PATH}/utilities/norlab-shell-script-tools"

# ....Load environment variables from file.........................................................
cd "${LPM_BUILD_SYSTEM_PATH}" || exit
cd "${LPM_BUILD_SYSTEM_PATH}" || exit 1
set -o allexport && source .env && set +o allexport

# ....Source NBS dependencies......................................................................
cd "${NBS_PATH}" || exit
cd "${NBS_PATH}" || exit 1
source import_norlab_build_system_lib.bash

# ====begin========================================================================================
cd "${NBS_PATH}/src/utility_scripts" || exit
cd "${NBS_PATH}/src/utility_scripts" || exit 1

DOTENV_BUILD_MATRIX_REALPATH=${LPM_BUILD_SYSTEM_PATH}/.env.build_matrix.libpointmatcher

# Note: do not double cote PARAMS or threat it as a array otherwise it will cause error
# Note: do not double quote PARAMS or threat it as a array otherwise it will cause error
# shellcheck disable=SC2086
source nbs_execute_compose_over_build_matrix.bash "${DOTENV_BUILD_MATRIX_REALPATH}" $PARAMS

Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ NBS_PATH="${LPM_BUILD_SYSTEM_PATH}/utilities/norlab-build-system"
N2ST_PATH="${LPM_BUILD_SYSTEM_PATH}/utilities/norlab-shell-script-tools"

# ....Load environment variables from file.........................................................
cd "${LPM_BUILD_SYSTEM_PATH}" || exit
cd "${LPM_BUILD_SYSTEM_PATH}" || exit 1
set -o allexport && source .env && set +o allexport

# ....Source NBS dependencies......................................................................
cd "${NBS_PATH}" || exit
cd "${NBS_PATH}" || exit 1
source import_norlab_build_system_lib.bash

# ====begin========================================================================================
cd "${NBS_PATH}/src/utility_scripts" || exit
cd "${NBS_PATH}/src/utility_scripts" || exit 1

DOTENV_BUILD_MATRIX_REALPATH=${LPM_BUILD_SYSTEM_PATH}/.env.build_matrix.libpointmatcher.bleeding

# Note: do not double cote PARAMS or threat it as a array otherwise it will cause error
# Note: do not double quote PARAMS or threat it as a array otherwise it will cause error
# shellcheck disable=SC2086
source nbs_execute_compose_over_build_matrix.bash "${DOTENV_BUILD_MATRIX_REALPATH}" $PARAMS
2 changes: 1 addition & 1 deletion build_system/lpm_utility_script/lpm_bashrc_config.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function lpm::configure_bashrc() {
LPM_PATH=$(git rev-parse --show-toplevel)

# ....Load environment variables from file.......................................................
cd "${LPM_PATH}/build_system" || exit
cd "${LPM_PATH}/build_system" || exit 1
set -o allexport
source .env
set +o allexport
Expand Down
107 changes: 107 additions & 0 deletions build_system/tests/tests_bats/test_dotenv_libpointmatcher.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/usr/bin/env bats
#
# Usage in docker container
# $ REPO_ROOT=$(pwd) && RUN_TESTS_IN_DIR='tests'
# $ docker run -it --rm -v "$REPO_ROOT:/code" bats/bats:latest "$RUN_TESTS_IN_DIR"
#
# Note: "/code" is the working directory in the bats official image
#
# bats-core ref:
# - https://bats-core.readthedocs.io/en/stable/tutorial.html
# - https://bats-core.readthedocs.io/en/stable/writing-tests.html
# - https://opensource.com/article/19/2/testing-bash-bats
# ↳ https://github.com/dmlond/how_to_bats/blob/master/test/build.bats
#
# Helper library:
# - https://github.com/bats-core/bats-assert
# - https://github.com/bats-core/bats-support
# - https://github.com/bats-core/bats-file
#

BATS_HELPER_PATH=/usr/lib/bats
if [[ -d ${BATS_HELPER_PATH} ]]; then
load "${BATS_HELPER_PATH}/bats-support/load"
load "${BATS_HELPER_PATH}/bats-assert/load"
load "${BATS_HELPER_PATH}/bats-file/load"
load "${SRC_CODE_PATH}/${N2ST_BATS_TESTING_TOOLS_RELATIVE_PATH}/bats_helper_functions"
#load "${BATS_HELPER_PATH}/bats-detik/load" # << Kubernetes support
else
echo -e "\n[\033[1;31mERROR\033[0m] $0 path to bats-core helper library unreachable at \"${BATS_HELPER_PATH}\"!" 1>&2
echo '(press any key to exit)'
read -r -n 1
exit 1
fi

# ====Setup========================================================================================

DOTENV_FILE=".env.libpointmatcher"
TESTED_FILE_PATH="."

# executed once before starting the first test (valide for all test in that file)
setup_file() {
BATS_DOCKER_WORKDIR=$(pwd) && export BATS_DOCKER_WORKDIR

## Uncomment the following for debug, the ">&3" is for printing bats msg to stdin
# pwd >&3 && tree -L 1 -a -hug >&3
# printenv >&3
}

# executed before each test
setup() {
cd "$TESTED_FILE_PATH" || exit 1
}

# ====Teardown=====================================================================================

# executed after each test
teardown() {
bats_print_run_env_variable_on_error
}

## executed once after finishing the last test (valide for all test in that file)
#teardown_file() {
#}

# ====Test casses==================================================================================
@test "${DOTENV_FILE} › Env variables set ok" {
# ....Pre-condition..............................................................................
assert_empty "${PROJECT_PROMPT_NAME}"
assert_empty "${PROJECT_GIT_REMOTE_URL}"
assert_empty "${PROJECT_GIT_NAME}"
assert_empty "${PROJECT_SRC_NAME}"
assert_empty "${PROJECT_PATH}"

assert_empty "${LPM_PROMPT_NAME}"
assert_empty "${LPM_GIT_REMOTE_URL}"
assert_empty "${LPM_GIT_NAME}"
assert_empty "${LPM_PATH}"
assert_empty "${LPM_SRC_NAME}"

assert_empty "${LPM_BUILD_SYSTEM_PATH}"
assert_empty "${N2ST_PATH}"
assert_empty "${NBS_PATH}"

# ....Source .env.project........................................................................
set -o allexport
source "${BATS_DOCKER_WORKDIR:?err}/${DOTENV_FILE}"
set +o allexport

# printenv | grep -e 'CONTAINER_PROJECT_' -e 'PROJECT_' >&3

# ....Tests......................................................................................
assert_equal "${PROJECT_PROMPT_NAME}" "LPM"
assert_regex "${PROJECT_GIT_REMOTE_URL}" "https://github.com/norlab-ulaval/libpointmatcher"'(".git")?'
assert_equal "${PROJECT_GIT_NAME}" "libpointmatcher"
assert_equal "${PROJECT_SRC_NAME}" "libpointmatcher"
assert_equal "${PROJECT_PATH}" "/code/libpointmatcher"

assert_equal "${LPM_PROMPT_NAME}" "LPM"
assert_regex "${LPM_GIT_REMOTE_URL}" "https://github.com/norlab-ulaval/libpointmatcher"'(".git")?'
assert_equal "${LPM_GIT_NAME}" "libpointmatcher"
assert_equal "${LPM_SRC_NAME}" "libpointmatcher"
assert_equal "${LPM_PATH}" "/code/libpointmatcher"

assert_equal "${LPM_BUILD_SYSTEM_PATH}" "/code/libpointmatcher/build_system"
assert_equal "${N2ST_PATH}" "/code/libpointmatcher/build_system/utilities/norlab-shell-script-tools"
assert_equal "${NBS_PATH}" "/code/libpointmatcher/build_system/utilities/norlab-build-system"
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [[ -d ${BATS_HELPER_PATH} ]]; then
load "${SRC_CODE_PATH}/build_system/tests/tests_bats/bats_helper_functions"
#load "${BATS_HELPER_PATH}/bats-detik/load" # << Kubernetes support
else
echo -e "\n[\033[1;31mERROR\033[0m] $0 path to bats-core helper library unreachable at \"${BATS_HELPER_PATH}\"!"
echo -e "\n[\033[1;31mERROR\033[0m] $0 path to bats-core helper library unreachable at \"${BATS_HELPER_PATH}\"!" 1>&2
echo '(press any key to exit)'
read -r -n 1
exit 1
Expand All @@ -52,7 +52,7 @@ setup_file() {

# executed before each test
setup() {
cd "$TESTED_FILE_PATH" || exit
cd "$TESTED_FILE_PATH" || exit 1
}

# ====Teardown=====================================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [[ -d ${BATS_HELPER_PATH} ]]; then
load "${SRC_CODE_PATH}/build_system/tests/tests_bats/bats_helper_functions"
#load "${BATS_HELPER_PATH}/bats-detik/load" # << Kubernetes support
else
echo -e "\n[\033[1;31mERROR\033[0m] $0 path to bats-core helper library unreachable at \"${BATS_HELPER_PATH}\"!"
echo -e "\n[\033[1;31mERROR\033[0m] $0 path to bats-core helper library unreachable at \"${BATS_HELPER_PATH}\"!" 1>&2
echo '(press any key to exit)'
read -r -n 1
exit 1
Expand All @@ -52,7 +52,7 @@ setup_file() {

# executed before each test
setup() {
cd "$TESTED_FILE_PATH" || exit
cd "$TESTED_FILE_PATH" || exit 1
}

# ====Teardown=====================================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [[ -d ${BATS_HELPER_PATH} ]]; then
load "${SRC_CODE_PATH}/build_system/tests/tests_bats/bats_helper_functions"
#load "${BATS_HELPER_PATH}/bats-detik/load" # << Kubernetes support
else
echo -e "\n[\033[1;31mERROR\033[0m] $0 path to bats-core helper library unreachable at \"${BATS_HELPER_PATH}\"!"
echo -e "\n[\033[1;31mERROR\033[0m] $0 path to bats-core helper library unreachable at \"${BATS_HELPER_PATH}\"!" 1>&2
echo '(press any key to exit)'
read -r -n 1
exit 1
Expand All @@ -52,7 +52,7 @@ setup_file() {

# executed before each test
setup() {
cd "$TESTED_FILE_PATH" || exit
cd "$TESTED_FILE_PATH" || exit 1
}

# ====Teardown=====================================================================================
Expand Down
Loading