Skip to content

Commit

Permalink
Jiminy 1.7.4 (#444)
Browse files Browse the repository at this point in the history
* [core] Implement friction cone for impulse model. (#440)
* [core] Fix numerical instability of flexibility model by adding armature-like inertia parameter. (#433)
* [core] Full support of armature for all joints but mimic.
* [core] Rename 'pncCollisionData' in 'collisionData' and 'pncModelRigidOrig_' in 'pncModelOrig_' since already clear.
* [core] Fix some implicit type conversions.
* [python/robot] Fix default hardware config file generator is both collision and visual meshes are defined.
* [python/viewer] Add physic based rendering of materials to panda3d. 
* [python/viewer] Fix shadow casting area smaller than floor in panda3d. 
* [python/viewer] Fix window name not set properly in panda3d.
* [python/viewer] Change direction of lighting in panda3d to fell natural for default camera pose.
* [python/viewer] Enhanced rendering in panda3d for discrete gpu.
* [python/viewer] Render meshes two-sided in panda3d to avoid seeing through them.
* [gym/rllib] Add option to forward keyword arguments to 'ray.init'. (#436)
* [misc] Update Python dependencies.
* [misc] Update Boost from 1.7.1 to 1.7.6.
* [misc] Build OSX wheels. (#442)

Co-authored-by: Alexis Duburcq <alexis.duburcq@wandercraft.eu>
  • Loading branch information
duburcqa and Alexis Duburcq authored Nov 12, 2021
1 parent 0369d72 commit 79dfb00
Show file tree
Hide file tree
Showing 81 changed files with 980 additions and 539 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
git config --global advice.detachedHead false
- name: Build project dependencies
run: |
./build_tools/build_install_deps_linux.sh
./build_tools/build_install_deps_unix.sh
"${PYTHON_EXECUTABLE}" -m pip install torch==1.8.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
"${PYTHON_EXECUTABLE}" -m pip install "gym>=0.18.3" "stable_baselines3>=0.10" "importlib-metadata>=3.3.0"
Expand All @@ -72,21 +72,21 @@ jobs:
mkdir "$RootDir/build"
cd "$RootDir/build"
export LD_LIBRARY_PATH="/opt/openrobots/lib:$InstallDir/lib/:/usr/local/lib"
export LD_LIBRARY_PATH="$InstallDir/lib/:/usr/local/lib"
cmake "$RootDir" -DCMAKE_INSTALL_PREFIX="$InstallDir" -DCMAKE_PREFIX_PATH="$InstallDir" \
-DBOOST_ROOT="$InstallDir" -DBoost_INCLUDE_DIR="$InstallDir/include" \
-DBoost_NO_SYSTEM_PATHS=TRUE -DBoost_NO_BOOST_CMAKE=TRUE \
-DBoost_USE_STATIC_LIBS=ON -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" \
-DBUILD_TESTING=ON -DBUILD_EXAMPLES=ON -DBUILD_PYTHON_INTERFACE=ON \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_CXX_FLAGS="-fPIC -DBOOST_BIND_GLOBAL_PLACEHOLDERS" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
make install -j2
#####################################################################################

- name: Build extension module
run: |
export LD_LIBRARY_PATH="/opt/openrobots/lib:$InstallDir/lib/:/usr/local/lib"
export LD_LIBRARY_PATH="$InstallDir/lib/:/usr/local/lib"
"$InstallDir/bin/jiminy_double_pendulum"
Expand All @@ -101,7 +101,7 @@ jobs:
- name: Run unit tests
run: |
export LD_LIBRARY_PATH="/opt/openrobots/lib:$InstallDir/lib/:/usr/local/lib"
export LD_LIBRARY_PATH="$InstallDir/lib/:/usr/local/lib"
./build/unit/unit
Expand Down
144 changes: 144 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: MacOS CI (Build from source dependencies)

on:
# Trigger the workflow on push on the master branch, or for any pull request
push:
branches:
- master
pull_request:

jobs:
build-and-test-linux:
name: >-
(${{ matrix.os }}) (${{ matrix.PYTHON_VERSION }})
Build and run the unit tests. Then generate and publish the wheels on PyPi.
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [macos-10.15, macos-11]
PYTHON_VERSION: ['3.6', '3.7', '3.8', '3.9']
exclude:
- os: macos-11
PYTHON_VERSION: '3.6'
- os: macos-11
PYTHON_VERSION: '3.7'

defaults:
run:
shell: bash -ieo pipefail {0} # Using bash enables automatic sourcing `.bashrc` and fail-fast behavior

env:
BUILD_TYPE: "Release"
MACOSX_DEPLOYMENT_TARGET: "10.9"

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

steps:
- name: Checkout jiminy
uses: actions/checkout@v2

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

- name: Configure Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.PYTHON_VERSION }}
architecture: 'x64'
- name: Setup minimal build environment
run: |
git config --global advice.detachedHead false
PYTHON_EXECUTABLE="${pythonLocation}/bin/python${PYTHON_VERSION}"
echo "PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}" >> $GITHUB_ENV
echo "RootDir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
echo "InstallDir=${GITHUB_WORKSPACE}/install" >> $GITHUB_ENV
if [ "${{ matrix.os }}" == "macos-10.15" ] ; then
echo "OSX_ARCHITECTURES=x86_64" >> $GITHUB_ENV
echo "WHEEL_ARCH=x86_64" >> $GITHUB_ENV
else
echo "OSX_ARCHITECTURES=x86_64;arm64" >> $GITHUB_ENV
echo "WHEEL_ARCH=universal2" >> $GITHUB_ENV
fi
"${PYTHON_EXECUTABLE}" -m pip install --upgrade pip
"${PYTHON_EXECUTABLE}" -m pip install --upgrade twine wheel delocate
"${PYTHON_EXECUTABLE}" -m pip install --upgrade numpy
- name: Build project dependencies
run: |
MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} OSX_ARCHITECTURES=${OSX_ARCHITECTURES} \
./build_tools/build_install_deps_unix.sh
"${PYTHON_EXECUTABLE}" -m pip install --prefer-binary "gym>=0.18.3" "stable_baselines3>=0.10" "importlib-metadata>=3.3.0"
#####################################################################################

- name: Build and install Jiminy
run: |
unset Boost_ROOT
mkdir "$RootDir/build"
cd "$RootDir/build"
export LD_LIBRARY_PATH="$InstallDir/lib/:/usr/local/lib"
cmake "$RootDir" -DCMAKE_INSTALL_PREFIX="$InstallDir" -DCMAKE_PREFIX_PATH="$InstallDir" \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF \
-DCMAKE_OSX_ARCHITECTURES="${OSX_ARCHITECTURES}" -DCMAKE_OSX_DEPLOYMENT_TARGET="${MACOSX_DEPLOYMENT_TARGET}" \
-DBOOST_ROOT="$InstallDir" -DBoost_INCLUDE_DIR="$InstallDir/include" \
-DBoost_NO_SYSTEM_PATHS=TRUE -DBoost_NO_BOOST_CMAKE=TRUE \
-DBoost_USE_STATIC_LIBS=ON -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" \
-DBUILD_TESTING=ON -DBUILD_EXAMPLES=ON -DBUILD_PYTHON_INTERFACE=ON \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
make -j2
mkdir -p "$RootDir/build/pypi/jiminy_py/src/jiminy_py"
cp -R -H "$InstallDir/lib/python${{ matrix.PYTHON_VERSION }}/site-packages/." \
"$RootDir/build/pypi/jiminy_py/src/jiminy_py/core"
find "$RootDir/build/pypi/" -name "*.so*" -exec strip -S -x -r -v {} +
make install
#####################################################################################

- name: Generate and install Python Pip wheels
run: |
export DYLD_LIBRARY_PATH="$InstallDir/lib"
cd "$RootDir/build"
cmake . -DCOMPONENT=pypi -P ./cmake_install.cmake
delocate-wheel --require-archs "${WHEEL_ARCH}" \
-w "$RootDir/build/wheelhouse" "$RootDir/build/pypi/dist/jiminy_py/"*.whl
delocate-addplat --rm-orig -p "macosx_${MACOSX_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: success() && github.repository == 'duburcqa/jiminy'
uses: actions/upload-artifact@v1
with:
name: jiminy_py-${{ matrix.PYTHON_VERSION }}-wheel
path: build/wheelhouse

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

- name: Run unit tests
run: |
./build/unit/unit
# The access to hpp-fcl shapes is not working for some reason, so that doing
# `collision_model.geometryObjects[0].geometry.clone()` is failing. It is
# probably an issue with boost python and it is not related to jiminy.
cd "$RootDir/unit_py"
#"${PYTHON_EXECUTABLE}" -m unittest discover -v
#####################################################################################

- name: Publish on PyPi the wheel for Linux of jiminy_py
if: >-
success() &&
github.repository == 'duburcqa/jiminy' && github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_DEPLOY }}
packages_dir: build/wheelhouse
20 changes: 11 additions & 9 deletions .github/workflows/manylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ jobs:
echo "export PATH=\"${pythonLocation}/bin:\$PATH\"" >> $HOME/.bashrc
source $HOME/.bashrc
git config --global advice.detachedHead false
PYTHON_EXECUTABLE="${pythonLocation}/bin/python"
echo "PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}" >> $GITHUB_ENV
echo "RootDir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
echo "InstallDir=${GITHUB_WORKSPACE}/install" >> $GITHUB_ENV
"${PYTHON_EXECUTABLE}" -m pip install --upgrade pip
"${PYTHON_EXECUTABLE}" -m pip install --upgrade twine wheel auditwheel cmake
if [ "${{ matrix.legacy }}" == true ] ; then
"${PYTHON_EXECUTABLE}" -m pip install --upgrade "numpy<1.20"
else
"${PYTHON_EXECUTABLE}" -m pip install --upgrade numpy
fi
echo "PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}" >> $GITHUB_ENV
echo "RootDir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
echo "InstallDir=${GITHUB_WORKSPACE}/install" >> $GITHUB_ENV
git config --global advice.detachedHead false
- name: Build project dependencies
run: |
./build_tools/build_install_deps_linux.sh
./build_tools/build_install_deps_unix.sh
"${PYTHON_EXECUTABLE}" -m pip install --prefer-binary "gym>=0.18.3" "stable_baselines3>=0.10" "importlib-metadata>=3.3.0"
#####################################################################################
Expand Down Expand Up @@ -95,6 +95,8 @@ jobs:
make install
#####################################################################################

- name: Generate and install Python Pip wheels
run: |
export LD_LIBRARY_PATH="$InstallDir/lib:/usr/local/lib"
Expand All @@ -105,8 +107,8 @@ jobs:
# Note that `--strip` option is not used but rather done manually because the
# built-in option corrupts the shared library for some reason...
"${PYTHON_EXECUTABLE}" "$RootDir/build_tools/wheel_repair_linux.py" repair \
-w "$RootDir/build/wheelhouse" "$RootDir"/build/pypi/dist/jiminy_py/*.whl
"${PYTHON_EXECUTABLE}" -m pip install --force-reinstall --no-deps "$RootDir"/build/wheelhouse/*.whl
-w "$RootDir/build/wheelhouse" "$RootDir/build/pypi/dist/jiminy_py/"*.whl
"${PYTHON_EXECUTABLE}" -m pip install --force-reinstall --no-deps "$RootDir/build/wheelhouse/"*.whl
- name: Upload the wheel for Linux of Jiminy_py
if: success() && github.repository == 'duburcqa/jiminy'
uses: actions/upload-artifact@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
$wheel_path = ($_.FullName)
python -m pip install --force-reinstall --no-deps $wheel_path
}
- name: Upload the wheel for Windows of Jiminy_py
- name: Upload the wheel for Windows of jiminy_py
if: success() && github.repository == 'duburcqa/jiminy'
uses: actions/upload-artifact@v1
with:
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
#########################################################################################

publish-pypi-win10:
name: (Windows) Publish on PyPi the wheel for Windows of Jiminy_py
name: (Windows) Publish on PyPi the wheel for Windows of jiminy_py
needs: build-and-test-win10
runs-on: ubuntu-20.04
if: github.repository == 'duburcqa/jiminy' && github.event_name == 'push' && github.ref == 'refs/heads/master'
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.10)

# Set the build version
set(BUILD_VERSION 1.7.3)
set(BUILD_VERSION 1.7.4)

# Set compatibility
if(CMAKE_VERSION VERSION_GREATER "3.11.0")
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ python -m pip install "numpy<1.20"
Just run the bash script already available.

```
BUILD_TYPE="Release" ./build_tools/build_install_deps_linux.sh
BUILD_TYPE="Release" ./build_tools/build_install_deps_unix.sh
```

### Build Procedure
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Beside a strong focus on performance to answer machine learning's need for runni
- Dedicated integration in Google Colab, Jupyter Lab, and VSCode working out-of-the-box - including interactive 3D viewer based on [Meshcat](https://github.com/rdeits/MeshCat.jl). This facilitates working on remote headless environnement such as machine learning clusters.
- Cross-platform offscreen rendering capability, without requiring X-server, based on [Panda3d](https://github.com/panda3d/panda3d).
- Rich simulation log output, easily customizable for recording, introspection and debugging. The simulation log is made available in RAM directly for fast access, and can be exported in raw binary, CSV or [HDF5](https://portal.hdfgroup.org/display/HDF5/Introduction+to+HDF5) format.
- Available for both Linux and Windows platforms.
- Support Linux, Mac and Windows platforms.

### Physics

Expand All @@ -52,7 +52,7 @@ Pre-configured environments for some well-known toys models and reference roboti

## Demo

<a href="./examples/tutorial.ipynb">
<a href="./examples/python/tutorial.ipynb">
<p align="middle">
<img src="https://raw.github.com/duburcqa/jiminy/readme/jiminy_plot_log.png" alt="" width="49.0%"/>
<img src="https://raw.github.com/duburcqa/jiminy/readme/jiminy_viewer_open.png" alt="" width="49.0%"/>
Expand All @@ -65,7 +65,7 @@ Pre-configured environments for some well-known toys models and reference roboti

## Getting started

Jiminy and Gym Jiminy are compatible with Linux and Windows, and supports Python3.6+. They are distributed on PyPi for Python 3.6/3.7/3.8/3.9 for both platform, so they can be installed using `pip`:
Jiminy and Gym Jiminy support Linux, Mac and Windows, and is compatible with Python3.6+. Pre-compiled binaries are distributed on PyPi for Python 3.6/3.7/3.8/3.9. They can be installed using `pip`:

```bash
# For installing Jiminy
Expand Down
Loading

0 comments on commit 79dfb00

Please sign in to comment.