From e34ff71478b2162d6f4e94592fdad32ba5621939 Mon Sep 17 00:00:00 2001 From: Stefano Dafarra Date: Mon, 6 Mar 2023 14:22:07 +0100 Subject: [PATCH] Initial skeleton (#1) * Updated README.md * Added initial skeleton. Inspired from https://github.com/ami-iit/rod * Changed name and addressed reviews. * Restore package action in CI/CD. * Removed unnecessary python versions in CI/CD file. * Renamed forgotten dir name. * Update setup.cfg after review Co-authored-by: Diego Ferigo * Added CITATIONS.bib file. --------- Co-authored-by: Diego Ferigo --- .github/workflows/ci_cd.yml | 81 +++++++++++++++++++++++++++++++++++++ .github/workflows/style.yml | 53 ++++++++++++++++++++++++ .gitignore | 3 ++ CITATIONS.bib | 9 +++++ README.md | 46 ++++++++++++++++++++- pyproject.toml | 17 ++++++++ setup.cfg | 62 ++++++++++++++++++++++++++++ setup.py | 3 ++ src/hippopt/__init__.py | 0 9 files changed, 272 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci_cd.yml create mode 100644 .github/workflows/style.yml create mode 100644 CITATIONS.bib create mode 100644 pyproject.toml create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 src/hippopt/__init__.py diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml new file mode 100644 index 00000000..a90fcd2c --- /dev/null +++ b/.github/workflows/ci_cd.yml @@ -0,0 +1,81 @@ +name: Python CI/CD + +on: + push: + pull_request: + release: + types: + - published + +jobs: + + package: + name: Package the project + runs-on: ubuntu-22.04 + + steps: + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install Python tools + run: pip install build twine + + - name: Create distributions + run: python -m build -o dist/ + + - name: Inspect dist folder + run: ls -lah dist/ + + - name: Check wheel's abi and platform tags + run: test $(find dist/ -name *-none-any.whl | wc -l) -gt 0 + + - name: Run twine check + run: twine check dist/* + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + path: dist/* + name: dist + + test: + name: 'Python${{ matrix.python }}@${{ matrix.os }}' + needs: package + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-22.04 + - macos-latest + - windows-latest + python: + - "3.10" + - "3.11" + + steps: + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + + - name: Download Python packages + uses: actions/download-artifact@v3 + with: + path: dist + name: dist + + - name: Install wheel + shell: bash + run: pip install dist/*.whl + + - name: Import the package + run: python -c "import hippopt" diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 00000000..730cf330 --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,53 @@ +name: Code Style + +on: + push: + branches: [ "**" ] + tags-ignore: [ "**" ] + pull_request: + workflow_dispatch: + +jobs: + + black: + + name: black + runs-on: ubuntu-latest + + steps: + + - name: "🔀 Checkout repository" + uses: actions/checkout@v2 + + - name: '🐍 Initialize Python' + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: "📝 Black Code Formatter" + uses: psf/black@stable + with: + options: --check --diff --color + + isort: + + name: isort + runs-on: ubuntu-latest + + steps: + + - name: "🔀 Checkout repository" + uses: actions/checkout@v2 + + - name: '🐍 Initialize Python' + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + # Workaround for https://github.com/isort/isort-action/issues/70 + - run: pip install colorama + + - name: "📝 isort" + uses: isort/isort-action@master + with: + configuration: --check --diff --color diff --git a/.gitignore b/.gitignore index b6e47617..ea7da93b 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,6 @@ dmypy.json # Pyre type checker .pyre/ + +# Pycharm files +.idea/ diff --git a/CITATIONS.bib b/CITATIONS.bib new file mode 100644 index 00000000..113b9f70 --- /dev/null +++ b/CITATIONS.bib @@ -0,0 +1,9 @@ +@ARTICLE{dafarra2022dcc, + author={Dafarra, Stefano and Romualdi, Giulio and Pucci, Daniele}, + journal={IEEE Transactions on Robotics}, + title={Dynamic Complementarity Conditions and Whole-Body Trajectory Optimization for Humanoid Robot Locomotion}, + year={2022}, + volume={38}, + number={6}, + pages={3414-3433}, + doi={10.1109/TRO.2022.3183785}} diff --git a/README.md b/README.md index f2008edd..5673f586 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,44 @@ -# StepWise -A Python-based Trajectory Optimization Framework +# hippopt +### HIghly Pythonized Planning and OPTimization framework + + +hippopt is an open-source framework for generating whole-body trajectories for legged robots, with a focus on direct transcription of optimal control problems solved with multiple-shooting methods. The framework takes as input the robot model and generates optimized trajectories that include both kinematic and dynamic quantities. + +## Features + +- [ ] Direct transcription of optimal control problems with multiple-shooting methods +- [ ] Support for floating-base robots, including humanoids and quadrupeds +- [ ] Integration with CasADi library for efficient numerical optimization +- [ ] Generation of optimized trajectories that include both kinematic and dynamic quantities +- [ ] Extensive documentation and examples to help you get started + +## Installation + +TODO + +## Citing this work + +If you find the work useful, please consider citing: + +```bib +@ARTICLE{dafarra2022dcc, + author={Dafarra, Stefano and Romualdi, Giulio and Pucci, Daniele}, + journal={IEEE Transactions on Robotics}, + title={Dynamic Complementarity Conditions and Whole-Body Trajectory Optimization for Humanoid Robot Locomotion}, + year={2022}, + volume={38}, + number={6}, + pages={3414-3433}, + doi={10.1109/TRO.2022.3183785}} +``` + + + +## Maintainer + +This repository is maintained by: + +| | | +| :----------------------------------------------------------: | :--------------------------------------------------: | +| [](https://github.com/S-Dafarra) | [@S-Dafarra](https://github.com/S-Dafarra) | + diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..884d3a71 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,17 @@ +[build-system] +requires = [ + "wheel", + "setuptools>=45", + "setuptools_scm[toml]>=6.2", +] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +local_scheme = "dirty-tag" + +[tool.black] +line-length = 88 + +[tool.isort] +profile = "black" +multi_line_output = 3 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..1e34fae3 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,62 @@ +[metadata] +name = hippopt +description = HIghly Pythonized Planning and OPTimization framework +long_description = file: README.md +long_description_content_type = text/markdown +author = Stefano Dafarra +author_email = stefano.dafarra@iit.it +license = BSD-2 +license_files = LICENSE +platforms = any +url = https://github.com/ami-iit/hippopt + +project_urls = + Changelog = https://github.com/ami-iit/hippopt/releases + Source = https://github.com/ami-iit/hippopt + Tracker = https://github.com/ami-iit/hippopt/issues + +keywords = + trajectory + optimization + robots + humanoids + quadrupeds + kinematics + dynamics + contacts + +classifiers = + Development Status :: 5 - Production/Stable + Framework :: Robot Framework + Intended Audience :: Science/Research + Intended Audience :: Developers + Intended Audience :: Education + License :: OSI Approved :: BSD License + Operating System :: OS Independent + Operating System :: POSIX :: Linux + Operating System :: MacOS + Operating System :: Microsoft :: Windows + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: Implementation :: CPython + Topic :: Games/Entertainment :: Simulation + +[options] +zip_safe = False +packages = find: +package_dir = + =src +python_requires = >=3.10 +install_requires = + +[options.extras_require] +style = + black + isort +all = + %(style)s + +[options.packages.find] +where = src diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..b908cbe5 --- /dev/null +++ b/setup.py @@ -0,0 +1,3 @@ +import setuptools + +setuptools.setup() diff --git a/src/hippopt/__init__.py b/src/hippopt/__init__.py new file mode 100644 index 00000000..e69de29b