Skip to content

Commit

Permalink
Jiminy release 1.8.9 (#843)
Browse files Browse the repository at this point in the history
* [core] Fix symbol visibility issues for some classes on windows. (#836)
* [core] Fix bindings and serialization of convex geometry meshes. (#836)
* [core] Fix 'array_copyto' helper. (#841)
* [python/viewer] Fix 'add_camera'. (#831)
* [python/viewer] Use firefox instead of chromium for offscreen rendering with meshcat to fix rendering on MacOS VM. (#832)
* [python/viewer] Fix support of '-' in robot name. (#834)
* [python/viewer] Fix conversion of 'hppfcl.Convex' to Panda3D. (#836)
* [python/dynamics] Take into account stride offset when trajectory time is wrapping. (#838)
* [python|gym_jiminy] More natural figure layout to improve readability. (#837)
* [gym_jiminy/common] Do not permanently alter original simulation options with enabling debug and/or evaluation modes. (#832)
* [gym_jiminy/common] Disallow switch between evaluation and training mode when a simulation is running. (#832)
* [gym_jiminy/common] Rewrite binary log file automatically when calling 'BaseJiminyEnv.stop' in debug or evaluation mode. (#832)
* [gym_jiminy/common] Fix replay if no simulation is running. (#832)
* [gym_jiminy/common] Add previous action as input argument for evaluation policy callback. (#832)
* [gym_jiminy/common] Automatic environment pipeline update. (#832)
* [gym_jiminy/common] Fix composed reward computation. (#832)
* [gym_jiminy/common] Use metaclass instead of inheritence for abstract classes. (#832)
* [gym_jiminy/common] Enable typing of the obs and action spaces for 'gym.Env'. (#832)
* [gym_jiminy/common] Fix nested gym space helpers. (#832)
* [gym_jiminy/common] Update documentation. (#832)
* [gym_jiminy/common] Fix missing final state when writing eval/debug log. (#834)
* [gym_jiminy/common] Improve numerical stability and speed of 'swing_from_vector'. (#834)
* [gym_jiminy/common] Fix 'quat_multiply' to support in-place operation. (#834)
* [gym_jiminy/common] Fix mahony filter leaky integration for very small time constant. (#834)
* [gym_jiminy/common] Add twist estimate in internal mahony state if estimated. (#834)
* [gym_jiminy/common] Check IMU and flex frames not empty when adding Mahony filter. (#834)
* [gym_jiminy/common] Fix base 'BaseJiminyEnv.stop' not called in pipeline. (#834)
* [gym_jiminy/common] Support pipelines without any layer. (#834)
* [gym_jiminy/common] Add support of 'none' in pipeline config files. (#834)
* [gym_jiminy/common] Add 'ignore_unbounded' optional argument to flatten obs/act wrappers. (#834)
* [gym_jiminy/common] Add 'AdaptLayoutObservation' that generalizes 'FilterObservation'. (#835)
* [gym_jiminy/common] Make sure that the initial pd state is within bounds. (#835)
* [gym_jiminy/common] Add 'compute_rpy' optional argument to mahony observer. (#837)
* [gym_jiminy/common] Add 'compute_rpy' optional argument to deformation estimator. (#837)
* [gym_jiminy/common] Fix trajectory file never closed if loading fails. (#838)
* [gym_jiminy/common] Add locking mechanism to trajectory databaset. (#838)
* [gym_jiminy/common] More robust pipeline registration mechanism. (#838)
* [gym_jiminy/common] Add composition wrapper before observer-controller blocks. (#838)
* [gym_jiminy/common] Enable env composition to augment the observation space with trajectory reference. (#838)
* [gym_jiminy/common] Add 'QuantityObserver' block. (#838)
* [gym_jiminy/common] Fix 'AdditiveMixtureReward' for 'order=inf'. (#838)
* [gym_jiminy/common] Support string representation of enums in pipeline config. (#838)
* [gym_jiminy/common] Fix partially broken 'spaces.build_reduce'. (#839)
* [gym_jiminy/common] Add 'ScaleObservation', 'ScaleAction' env pipeline wrapper blocks. (#839)
* [gym_jiminy/common] Faster env pipeline. (#841) (#842)
* [gym_jiminy/toolbox] Add support of arbitrarily nested task-settable env. (#832)
* [gym_jiminy/envs] Add mirror mat to obs/action spaces. (#832)
* [gym_jiminy/rllib] Full refactoring to support ray-rllib 2.38. (#832)
* [misc] Update core dependencies. (#831)
* [misc] Use unique numpy C API symbols for jiminy. (#831)
* [misc] Drop support of Python<3.10. (#831)
* [misc] Use 4 cores to build from source. (#831)
* [misc] Move to macos-14 on Github Action (forcing panda3d tinydisplay driver). (#832)
* [misc] Cleanup MacOS CI workflow. (#833)
* [misc] Move from 'toml' to 'tomlkit' to fix heterogeneous array support. (#835)
* [misc] Fix acrobot example eval max horizon. (#837)
  • Loading branch information
duburcqa authored Dec 2, 2024
1 parent e58bdb5 commit 9d0f5aa
Show file tree
Hide file tree
Showing 136 changed files with 6,252 additions and 3,804 deletions.
33 changes: 19 additions & 14 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ jobs:
name: >-
(${{ matrix.PYTHON_VERSION }}) (${{ matrix.BUILD_TYPE }})
Build the dependencies. Build the project and run the unit tests.
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

strategy:
matrix:
PYTHON_VERSION: ['3.8', '3.9', '3.10', '3.11', '3.12']
PYTHON_VERSION: ['3.10', '3.11', '3.12']
BUILD_TYPE: ['Release']
include:
- PYTHON_VERSION: '3.10'
- PYTHON_VERSION: '3.12'
BUILD_TYPE: 'Debug'

defaults:
run:
shell: bash -ieo pipefail {0}

env:
CMAKE_CXX_FLAGS: "-march=x86-64-v3 -mtune=generic"
CXX_FLAGS: "-march=x86-64-v3 -mtune=generic"

#####################################################################################

Expand Down Expand Up @@ -72,10 +72,10 @@ jobs:
if: matrix.PYTHON_VERSION != '3.13'
run: |
"${PYTHON_EXECUTABLE}" -m pip install "torch" -f https://download.pytorch.org/whl/torch
"${PYTHON_EXECUTABLE}" -m pip install "gymnasium>=0.28,<1.0" "stable_baselines3>=2.0"
"${PYTHON_EXECUTABLE}" -m pip install "gymnasium>=0.28,<1.0" "stable_baselines3>=2.0,<2.4"
- name: Install latest numpy version at build-time for run-time binary compatibility
run: |
"${PYTHON_EXECUTABLE}" -m pip install --upgrade "numpy>=1.24,<2.0"
"${PYTHON_EXECUTABLE}" -m pip install --upgrade "numpy>=1.24" numba torch
- name: Build jiminy dependencies
run: |
BUILD_TYPE="${{ matrix.BUILD_TYPE }}" ./build_tools/build_install_deps_unix.sh
Expand All @@ -95,8 +95,8 @@ jobs:
-DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" \
-DBUILD_TESTING=ON -DBUILD_EXAMPLES=ON -DBUILD_PYTHON_INTERFACE=ON \
-DINSTALL_GYM_JIMINY=${{ (matrix.PYTHON_VERSION == '3.13' && 'OFF') || 'ON' }} \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" -DCMAKE_BUILD_TYPE="${{ matrix.BUILD_TYPE }}"
make install -j2
-DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DCMAKE_BUILD_TYPE="${{ matrix.BUILD_TYPE }}"
make install -j4
echo "LD_LIBRARY_PATH=$InstallDir/lib:$InstallDir/lib64:/usr/local/lib" >> $GITHUB_ENV
Expand All @@ -108,9 +108,10 @@ jobs:
mkdir -p "${RootDir}/core/examples/external_project/build"
cd "${RootDir}/core/examples/external_project/build"
cmake "${RootDir}/core/examples/external_project/" -DCMAKE_INSTALL_PREFIX="$InstallDir" \
-DCMAKE_PREFIX_PATH="$InstallDir" -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
cmake "${RootDir}/core/examples/external_project/" \
-DCMAKE_INSTALL_PREFIX="$InstallDir" -DCMAKE_PREFIX_PATH="$InstallDir" \
-DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" \
-DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
make install
"$InstallDir/bin/pip_double_pendulum"
Expand All @@ -131,20 +132,24 @@ jobs:
"${PYTHON_EXECUTABLE}" -m unittest discover -s "${RootDir}/python/gym_jiminy/unit_py" -v
- name: Run examples for gym jiminy add-on modules
if: matrix.BUILD_TYPE != 'Debug' && matrix.PYTHON_VERSION != '3.12'
if: matrix.BUILD_TYPE != 'Debug'
run: |
cd "${RootDir}/python/gym_jiminy/examples/rllib"
"${PYTHON_EXECUTABLE}" acrobot_ppo.py
- name: Python static type checker
if: matrix.PYTHON_VERSION == '3.8' && matrix.BUILD_TYPE != 'Debug'
if: matrix.BUILD_TYPE != 'Debug' && matrix.PYTHON_VERSION == '3.10'
run: |
# Generate stubs
# FIXME: stubgen does not work with Numpy 2.X
# (see https://github.com/python/mypy/issues/17396)
"${PYTHON_EXECUTABLE}" -m pip install "numpy<2.0"
stubgen -p jiminy_py -o ${RootDir}/build/pypi/jiminy_py/src
"${PYTHON_EXECUTABLE}" "${RootDir}/build_tools/stub_gen.py" \
"${PYTHON_EXECUTABLE}" "${RootDir}/build_tools/stubgen.py" \
-o ${RootDir}/build/stubs --ignore-invalid=all jiminy_py
cp ${RootDir}/build/stubs/jiminy_py-stubs/core/__init__.pyi \
${RootDir}/build/pypi/jiminy_py/src/jiminy_py/core/core.pyi
"${PYTHON_EXECUTABLE}" -m pip install --upgrade "numpy>=1.24" numba torch
# Re-install jiminy with stubs
cd "${RootDir}/build"
Expand Down
90 changes: 57 additions & 33 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,22 @@ on:
jobs:
build-and-test-osx:
name: >-
(${{ matrix.PYTHON_VERSION }}) (${{ matrix.BUILD_TYPE }})
(${{ matrix.OS }}) (${{ matrix.PYTHON_VERSION }}) (${{ matrix.BUILD_TYPE }})
Build and run the unit tests. Then generate and publish the wheels on PyPi.
strategy:
matrix:
OS: ['macos-13'] # 'macos-13': Intel (x86), 'macos-14': Apple Silicon (arm64)
# meshcat video recorder 'playwright' is not working on 'macos-14' runners.
OS: ['macos-15'] # 'macos-13': Intel (x86), 'macos-14+': Apple Silicon (arm64)
PYTHON_VERSION: ['3.10', '3.11', '3.12'] # `setup-python` does not support Python<3.10 on Apple Silicon
BUILD_TYPE: ['Release']
include:
- OS: 'macos-13'
PYTHON_VERSION: '3.8'
PYTHON_VERSION: '3.10'
BUILD_TYPE: 'Release'
- OS: 'macos-13'
PYTHON_VERSION: '3.9'
BUILD_TYPE: 'Release'
- OS: 'macos-13'
PYTHON_VERSION: '3.11'
- OS: 'macos-15'
PYTHON_VERSION: '3.12'
BUILD_TYPE: 'Debug'
LINKER_FLAGS: '-Wl,-ld_classic' # New "ld_prime" linker (XCode 15+) causes build failures

runs-on: ${{ matrix.OS }}

Expand All @@ -37,9 +34,9 @@ jobs:
shell: bash -ieo pipefail {0}

env:
CMAKE_C_COMPILER: "/usr/bin/clang"
CMAKE_CXX_COMPILER: "/usr/bin/clang++"
CMAKE_CXX_FLAGS: "-DEIGEN_MPL2_ONLY -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION -Wno-deprecated-declarations"
C_COMPILER: "/usr/bin/clang"
CXX_COMPILER: "/usr/bin/clang++"
CXX_FLAGS: "-DEIGEN_MPL2_ONLY -Wno-deprecated-declarations"
OSX_DEPLOYMENT_TARGET: "11.0"
OSX_ARCHITECTURES: "x86_64;arm64"
WHEEL_ARCH: "universal2"
Expand Down Expand Up @@ -67,20 +64,33 @@ jobs:
echo "RootDir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
echo "InstallDir=${GITHUB_WORKSPACE}/install" >> $GITHUB_ENV
# FIXME: Panda3d software rendering is partially broken on Apple Silicon
if [[ "${{ matrix.OS }}" != 'macos-13' ]] ; then
echo "JIMINY_PANDA3D_FORCE_TINYDISPLAY=" >> $GITHUB_ENV
fi
"${PYTHON_EXECUTABLE}" -m pip install setuptools wheel "pip>=20.3"
"${PYTHON_EXECUTABLE}" -m pip install delocate twine
- name: Install pre-compiled binaries for additional gym-jiminy dependencies
if: matrix.PYTHON_VERSION != '3.13'
run: |
"${PYTHON_EXECUTABLE}" -m pip install "torch" -f https://download.pytorch.org/whl/torch
"${PYTHON_EXECUTABLE}" -m pip install "gymnasium>=0.28,<1.0" "stable_baselines3>=2.0"
"${PYTHON_EXECUTABLE}" -m pip install "gymnasium>=0.28,<1.0" "stable_baselines3>=2.0,<2.4"
- name: Install latest numpy version at build-time for run-time binary compatibility
run: |
"${PYTHON_EXECUTABLE}" -m pip install --upgrade "numpy>=1.24,<2.0"
if [[ "${{ matrix.BUILD_TYPE }}" != 'Debug' && "${{ matrix.OS }}" != 'macos-13' ]] ; then
"${PYTHON_EXECUTABLE}" -m pip install --upgrade "numpy>=1.24" numba torch
else
# FIXME: torch on MacOS x86 for Python 3.10 does not support Numpy 2.X
# but does not enforce such restriction in requirements.
"${PYTHON_EXECUTABLE}" -m pip install --upgrade "numpy>=1.24,<2.0" numba torch
fi
- name: Build jiminy dependencies
run: |
OSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET} OSX_ARCHITECTURES=${OSX_ARCHITECTURES} \
BUILD_TYPE="${{ matrix.BUILD_TYPE }}" ./build_tools/build_install_deps_unix.sh
LINKER_FLAGS="${{ matrix.LINKER_FLAGS }}" BUILD_TYPE="${{ matrix.BUILD_TYPE }}" \
./build_tools/build_install_deps_unix.sh
#####################################################################################

Expand All @@ -93,8 +103,10 @@ jobs:
cd "${RootDir}/build"
export LD_LIBRARY_PATH="${InstallDir}/lib/:/usr/local/lib"
cmake "${RootDir}" -Wdev \
-DCMAKE_EXE_LINKER_FLAGS="${{ matrix.LINKER_FLAGS }}" \
-DCMAKE_SHARED_LINKER_FLAGS="${{ matrix.LINKER_FLAGS }}" \
-DCMAKE_INSTALL_PREFIX="${InstallDir}" -DCMAKE_PREFIX_PATH="${InstallDir}" \
-DCMAKE_C_COMPILER="${CMAKE_C_COMPILER}" -DCMAKE_CXX_COMPILER="${CMAKE_CXX_COMPILER}" \
-DCMAKE_C_COMPILER="${C_COMPILER}" -DCMAKE_CXX_COMPILER="${CXX_COMPILER}" \
-DCMAKE_OSX_ARCHITECTURES="${OSX_ARCHITECTURES}" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_DEPLOYMENT_TARGET}" \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
Expand All @@ -103,8 +115,8 @@ jobs:
-DBoost_USE_STATIC_LIBS=ON -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" \
-DBUILD_TESTING=ON -DBUILD_EXAMPLES=ON -DBUILD_PYTHON_INTERFACE=ON \
-DINSTALL_GYM_JIMINY=${{ (matrix.PYTHON_VERSION == '3.13' && 'OFF') || 'ON' }} \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" -DCMAKE_BUILD_TYPE="${{ matrix.BUILD_TYPE }}"
make -j2
-DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DCMAKE_BUILD_TYPE="${{ matrix.BUILD_TYPE }}"
make -j4
# Bundle the boost python dependencies with jiminy
mkdir -p "${RootDir}/build/pypi/jiminy_py/src/jiminy_py"
Expand All @@ -126,11 +138,22 @@ jobs:
export DYLD_FALLBACK_LIBRARY_PATH="${LD_LIBRARY_PATH}"
# Generate stubs
stubgen -p jiminy_py -o ${RootDir}/build/pypi/jiminy_py/src
"${PYTHON_EXECUTABLE}" "${RootDir}/build_tools/stub_gen.py" \
-o ${RootDir}/build/stubs --ignore-invalid=all jiminy_py
cp ${RootDir}/build/stubs/jiminy_py-stubs/core/__init__.pyi \
${RootDir}/build/pypi/jiminy_py/src/jiminy_py/core/core.pyi
if [[ "${{ matrix.BUILD_TYPE }}" != 'Debug' && "${{ matrix.OS }}" != 'macos-13' ]] ; then
# FIXME: stubgen does not work with Numpy 2.X
# (see https://github.com/python/mypy/issues/17396)
"${PYTHON_EXECUTABLE}" -m pip install "numpy<2.0"
stubgen -p jiminy_py -o ${RootDir}/build/pypi/jiminy_py/src
# FIXME: Python 3.10 crashes when generating stubs without any backtrace...
if [[ "${{ matrix.PYTHON_VERSION }}" != '3.10' ]] ; then
# lldb --batch -o "settings set target.process.stop-on-exec false" \
# -o "break set -n main" -o "run" -k "bt" -k "quit" -- \
"${PYTHON_EXECUTABLE}" "${RootDir}/build_tools/stubgen.py" \
-o ${RootDir}/build/stubs --ignore-invalid=all jiminy_py
cp ${RootDir}/build/stubs/jiminy_py-stubs/core/__init__.pyi \
${RootDir}/build/pypi/jiminy_py/src/jiminy_py/core/core.pyi
fi
"${PYTHON_EXECUTABLE}" -m pip install --upgrade "numpy>=1.24" numba torch
fi
# Generate wheels
cd "${RootDir}/build"
Expand All @@ -143,7 +166,7 @@ jobs:
-p "macosx_${OSX_DEPLOYMENT_TARGET//./_}_${WHEEL_ARCH}" "${RootDir}/build/wheelhouse/"*.whl
"${PYTHON_EXECUTABLE}" -m pip install --force-reinstall --no-deps "${RootDir}/build/wheelhouse/"*.whl
- name: Upload the wheel for Linux of jiminy_py
if: matrix.BUILD_TYPE != 'Debug'
if: matrix.BUILD_TYPE != 'Debug' && matrix.OS != 'macos-15'
uses: actions/upload-artifact@v4
with:
name: wheelhouse-${{ matrix.PYTHON_VERSION }}
Expand All @@ -159,10 +182,13 @@ jobs:
mkdir -p "${RootDir}/core/examples/external_project/build"
cd "${RootDir}/core/examples/external_project/build"
cmake "${RootDir}/core/examples/external_project/" -DCMAKE_INSTALL_PREFIX="${InstallDir}" \
-DCMAKE_C_COMPILER="${CMAKE_C_COMPILER}" -DCMAKE_CXX_COMPILER="${CMAKE_CXX_COMPILER}" \
-DCMAKE_PREFIX_PATH="${InstallDir}" -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" -DCMAKE_BUILD_TYPE="${{ matrix.BUILD_TYPE }}"
cmake "${RootDir}/core/examples/external_project/" \
-DCMAKE_EXE_LINKER_FLAGS="${{ matrix.LINKER_FLAGS }}" \
-DCMAKE_SHARED_LINKER_FLAGS="${{ matrix.LINKER_FLAGS }}" \
-DCMAKE_C_COMPILER="${C_COMPILER}" -DCMAKE_CXX_COMPILER="${CXX_COMPILER}" \
-DCMAKE_INSTALL_PREFIX="${InstallDir}" -DCMAKE_PREFIX_PATH="${InstallDir}" \
-DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" \
-DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DCMAKE_BUILD_TYPE="${{ matrix.BUILD_TYPE }}"
make install
"${InstallDir}/bin/pip_double_pendulum"
Expand All @@ -182,15 +208,13 @@ jobs:
run: |
export LD_LIBRARY_PATH="${InstallDir}/lib/:/usr/local/lib"
# FIXME: Disabling `test_pipeline_control.py` on MacOS because `test_pid_standing` is
# failing for 'panda3d-sync' backend due to meshes still loading at screenshot time.
if [[ "${{ matrix.BUILD_TYPE }}" == 'Debug' ]] ; then
export JIMINY_BUILD_DEBUG=
fi
"${PYTHON_EXECUTABLE}" -m unittest discover -s "${RootDir}/python/gym_jiminy/unit_py" -v
- name: Run examples for gym jiminy add-on modules
if: matrix.BUILD_TYPE != 'Debug' && matrix.PYTHON_VERSION != '3.12'
if: matrix.BUILD_TYPE != 'Debug'
run: |
export LD_LIBRARY_PATH="${InstallDir}/lib/:/usr/local/lib"
Expand All @@ -201,7 +225,7 @@ jobs:

publish-pypi-macos:
name: (MacOS CI) Publish on PyPi the wheel for OS X of jiminy_py
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
id-token: write

Expand All @@ -216,7 +240,7 @@ jobs:
merge-multiple: true
path: wheelhouse
- name: Publish the wheel
uses: pypa/gh-action-pypi-publish@v1.8.11
uses: pypa/gh-action-pypi-publish@v1.10.3
with:
packages-dir: wheelhouse
verify-metadata: false
Loading

0 comments on commit 9d0f5aa

Please sign in to comment.