diff --git a/.circleci/config.yml b/.circleci/config.yml index 195b2b32..1c5a70a4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,76 +3,59 @@ version: 2.1 jobs: build: docker: - - image: circleci/mariadb:bionic + - image: cimg/base:stable + environment: + PYTHONPATH=./lib steps: - checkout - run: - name: "Update Image" + name: "Install required packages from distro" command: | - apt-get update && apt-get install -y git + sudo apt-get update + sudo apt-get install -y --no-install-recommends git build-essential g++ cmake python3-distutils python3-dev python3-numpy - run: name: "Pull Submodules" command: | - git submodule update --init --recursive + git submodule update --init --recursive - run: - name: "Install packages" + name: "Configure and build native mrob library with Python bindings" command: | - apt-get install -y build-essential cmake python3-distutils python3-dev - apt-get install -y virtualenv - - run: - name: "Build mrob library" - command: | - mkdir build && cd build - cmake .. && make -j - cd .. - - run: - name: "Setup virtualenv" - command: | - virtualenv -p python3 venv - source venv/bin/activate - pip install numpy + mkdir -p build && pushd build + cmake $(dirs -l +1) && make -j 4 + popd - run: name: "Run FGraph_2d" command: | - export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate python3 mrobpy/tests/FGraph_2d.py when: always - run: name: "Run FGraph_M3500" command: | - export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate - cd mrobpy/tests/ - python3 FGraph_M3500.py + python3 mrobpy/tests/FGraph_M3500.py when: always - run: name: "Run FGraph_sphere" command: | - export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate - cd mrobpy/tests/ - python3 FGraph_sphere.py + python3 mrobpy/tests/FGraph_sphere.py when: always - run: name: "Run SE3_examples" command: | - export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate python3 mrobpy/tests/SE3_examples.py when: always - run: name: "Run FGraph_landmark_3d_example" command: | - export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate python3 mrobpy/tests/FGraph_landmark_3d_example.py when: always - run: name: "Run FGraph_landmark_2d_example" command: | - export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate python3 mrobpy/tests/FGraph_landmark_2d_example.py when: always - run: name: "Run PC_align" command: | - export PYTHONPATH=${PYTHONPATH}:$(pwd)/lib && source venv/bin/activate python3 mrobpy/tests/PC_align.py when: always build-wheel: @@ -119,16 +102,18 @@ jobs: ${VERSION} ~/project/build/wheelhouse/*.whl publish-pypi: docker: - - image: circleci/python:3.8 + - image: cimg/python:3.9 steps: - attach_workspace: at: ~/ - run: name: Upload to PyPI command: | - echo -e "[pypi]" >> ~/.pypirc - echo -e "username = __token__" >> ~/.pypirc - echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc + cat >> ~/.pypirc \<< EOD + [pypi] + username = __token__ + password = $PYPI_PASSWORD + EOD python3 -m pip install --user --upgrade twine twine upload ~/project/build/wheelhouse/*.whl diff --git a/.gitignore b/.gitignore index 678bffd4..3c463593 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,6 @@ bin/ *.pdf *.pkl -mrob/ +mrob dist/ mrob.egg-info/ diff --git a/__init__.py b/__init__.py index a73e6856..0f8fa30b 100644 --- a/__init__.py +++ b/__init__.py @@ -21,7 +21,16 @@ # from mrob import mrob -fgraph = mrob.fgraph + +FGraph = mrob.FGraph +GN = mrob.GN +LEVENBERG_MARQUARDT_ELLIP = mrob.LEVENBERG_MARQUARDT_ELLIP +LEVENBERG_MARQUARDT_SPHER = mrob.LEVENBERG_MARQUARDT_SPHER +LM = mrob.LM +NEWTON_RAPHSON = mrob.NEWTON_RAPHSON geometry = mrob.geometry +optimMethod = mrob.optimMethod +ostream_redirect = mrob.ostream_redirect registration = mrob.registration + del(mrob) diff --git a/mrobpy/tests/FGraph_M3500.py b/mrobpy/tests/FGraph_M3500.py index 181af95a..c1bc4613 100644 --- a/mrobpy/tests/FGraph_M3500.py +++ b/mrobpy/tests/FGraph_M3500.py @@ -1,10 +1,10 @@ # import mrob import numpy as np +from os import path import time - # Initialize data structures vertex_ini = {} factors = {} @@ -12,7 +12,7 @@ N = 3500 # load file -with open('../../benchmarks/M3500.txt', 'r') as file: +with open(path.join(path.dirname(__file__), '../../benchmarks/M3500.txt'), 'r') as file: for line in file: d = line.split() # read edges and vertex, in TORO format diff --git a/mrobpy/tests/FGraph_sphere.py b/mrobpy/tests/FGraph_sphere.py index b4379937..5c609b65 100644 --- a/mrobpy/tests/FGraph_sphere.py +++ b/mrobpy/tests/FGraph_sphere.py @@ -1,6 +1,7 @@ # import mrob import numpy as np +from os import path import time # Initialize data structures @@ -14,7 +15,7 @@ # load file, .g2o format from https://github.com/RainerKuemmerle/g2o/wiki/File-Format #file_path = '../../benchmarks/sphere_gt.g2o' file_path = '../../benchmarks/sphere.g2o' -with open(file_path, 'r') as file: +with open(path.join(path.dirname(__file__), file_path), 'r') as file: for line in file: d = line.split() # read edges and vertex