diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..05dbd71c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,55 @@ +name: Build and Test Fatropy + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Cache pip dependencies + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install virtualenv and activate + run: | + pip install virtualenv + virtualenv venv + source venv/bin/activate + + - name: Build and install Fatropy + run: | + git submodule update --init --recursive + sudo apt-get update && sudo apt-get install -y cmake + export CMAKE_ARGS="-DBLASFEO_TARGET=X64_AUTOMATIC -DENABLE_MULTITHREADING=OFF" + cd fatropy + pip install . + + - name: Install Rockit and Rockit-Fatrop plugin + run: | + git clone https://gitlab.kuleuven.be/meco-software/rockit.git + git clone https://gitlab.kuleuven.be/u0110259/rockit_fatrop_plugin.git ./rockit/rockit/external/fatrop + cd rockit + pip install . + + - name: Test Fatropy + run: | + git clone https://gitlab.kuleuven.be/robotgenskill/fatrop/fatrop_rockit_demo.git + python fatrop_rockit_demo/tutorial.py + python fatropy/tests/example.py diff --git a/CMakeLists.txt b/CMakeLists.txt index c89cb86a..3aac940c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ #[[ Fatrop - A fast trajectory optimization solver -Copyright (C) 2022, 2023 Lander Vanroye, KU Leuven. All rights reserved. + Copyright (C) 2022 - 2024 Lander Vanroye, KU Leuven. All rights reserved. This file is part of Fatrop. @@ -104,7 +104,7 @@ if(${WITH_SPECTOOL}) # check if casadi/core/function_internal.hpp is available in the casadi path (CASADI_INCLUDE_DIR is set by findCasadi.cmake, and can contain multiple paths) message (STATUS "CASADI_INCLUDE_DIR is ${CASADI_INCLUDE_DIR}") if(NOT EXISTS "${CASADI_INCLUDE_DIR}/casadi/core/function_internal.hpp") - message(SEND_ERROR "${CASADI_INCLUDE_DIR}/casadi/core/function_internal.hpp not found, please install casadi with cmake option -DINSTALL_INTERNAL_HEADERS=ON") + message(SEND_ERROR "${CASADI_INCLUDE_DIR}/casadi/core/function_internal.hpp not found, please install casadi with cmake option -DINSTALL_INTERNAL_HEADERS=ON") endif() set(INSTALL_TARGETS ${INSTALL_TARGETS} spectool) @@ -121,7 +121,16 @@ endif() # endif() set(WITH_PYTHON OFF CACHE BOOL "Build python bindings (fatropy)") -if(${WITH_PYTHON}) +if(WITH_PYTHON) + if(CMAKE_VERSION VERSION_LESS "3.18") + find_package(Python REQUIRED COMPONENTS Interpreter Development) + else() + find_package(Python REQUIRED COMPONENTS Interpreter Development.Module) + endif() + find_package(pybind11 CONFIG) + if(NOT pybind11_FOUND) + add_subdirectory(external/pybind11) + endif() add_subdirectory(fatropy) endif() @@ -136,4 +145,4 @@ INSTALL(TARGETS ${INSTALL_TARGETS} INCLUDES DESTINATION ${INCLUDE_INSTALL_DIR} RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR} ) -INSTALL(EXPORT fatropConfig NAMESPACE fatrop:: DESTINATION cmake) \ No newline at end of file +INSTALL(EXPORT fatropConfig NAMESPACE fatrop:: DESTINATION cmake) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..47b6a0bb --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,27 @@ +# Contributing to fatrop + +Thank you for your interest in contributing to fatrop! We welcome contributions from the community and appreciate your efforts to make this project better. Before you start contributing, please take note of the following guidelines: + +## License +This project is licensed under the LGPLv3 (Lesser General Public License version 3). By contributing to this project, you agree that your contributions will also be licensed under the LGPLv3. + + +## Contributing +To contribute, please follow these steps: +1. Fork the repository. +2. Create a new branch for your feature or bugfix. +3. Make your changes in the new branch. +4. Ensure your code adheres to the project's coding standards and passes all tests. +5. Submit a pull request to the `main` branch with a clear description of your changes and the problem they solve. + +## License Modifications +Please be aware that it is not possible to modify the license of this project. All contributions will be governed by the terms of the LGPLv3. + +## Copyright +By submitting a pull request, you implicitly hand over the copyright of your contribution to the original copyright holders of this project. The copyright holders are mentioned in the copyright statements of each file. + +## Additional Note +If you are introducing a significant feature or change, consider discussing it in an issue first to gather feedback and ensure alignment with the project's goals. + +## Feature Requests +Feature requests can be made by emailing lander.vanroye@kuleuven.be. We appreciate your ideas and feedback to help improve fatrop. \ No newline at end of file diff --git a/README.md b/README.md index f7588389..248b0a03 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@