Skip to content

Commit

Permalink
Jiminy 1.7.7 (#486)
Browse files Browse the repository at this point in the history
* [core] Always regenerate original flexible model at reset to allow manual overwrite of rigid original model. (#475)
* [core] Fix segfault when adding unspecified constraint. (#476)
* [core] Fix 'buildReducedModel' for pinocchio < 2.6.0. (#477)
* [core] Fix segfault when initializing engine with null robot. (#477)
* [python/viewer] Fallback to generic direct connection through ipykernel for Meshcat (VSCode, Jupyterlab). (#479)
* [python/viewer] More robust comm filtering for executing meshcat related requests out of order. (#479)
* [python/viewer] Fix connection to existing meshcat process. (#479)
* [python/viewer] Speed up frame capture and reduce CPU load in offscreen mode for panda3d backend. (#481)
* [python/viewer] Drop support of 'gepetto-gui' backend. (#482)
* [python/viewer] Fix random segfault at exit for synchronous panda3d backend. (#484)
* [gym/common] Enable to provide custom robot to 'WalkerJiminyEnv'. (#477)
* [gym/rllib] Refactor PPO implementation to support 'ray>=1.10.0'. (#474) (#485)
* [gym/rllib] PPO supports dict and box spaces for observation/action. (#474)
* [gym/rllib] PPO L2 reg only on train params. (#485)
* [misc] Use Ctest for managing C++ unit tests. (#475)

Co-authored-by: Alexis Duburcq <alexis.duburcq@wandercraft.eu>
  • Loading branch information
duburcqa and Alexis Duburcq authored Mar 2, 2022
1 parent e96beb9 commit a1e571b
Show file tree
Hide file tree
Showing 85 changed files with 1,336 additions and 1,308 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
"${PYTHON_EXECUTABLE}" -m pip install --upgrade pip
"${PYTHON_EXECUTABLE}" -m pip install --upgrade wheel
"${PYTHON_EXECUTABLE}" -m pip install --upgrade numpy
"${PYTHON_EXECUTABLE}" -m pip install --upgrade "numpy<1.22" # for numba compat.
echo "RootDir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
echo "InstallDir=${GITHUB_WORKSPACE}/install" >> $GITHUB_ENV
Expand Down Expand Up @@ -103,7 +103,8 @@ jobs:
run: |
export LD_LIBRARY_PATH="$InstallDir/lib:$InstallDir/lib64:/usr/local/lib"
./build/unit/unit
cd "$RootDir/build"
ctest
cd "$RootDir/unit_py"
"${PYTHON_EXECUTABLE}" -m unittest discover -v
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
"${PYTHON_EXECUTABLE}" -m pip install --upgrade pip
"${PYTHON_EXECUTABLE}" -m pip install --upgrade twine wheel delocate
"${PYTHON_EXECUTABLE}" -m pip install --upgrade numpy
"${PYTHON_EXECUTABLE}" -m pip install --upgrade "numpy<1.22" # for numba compat.
- name: Build project dependencies
run: |
MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} OSX_ARCHITECTURES=${OSX_ARCHITECTURES} \
Expand Down Expand Up @@ -130,7 +130,8 @@ jobs:

- name: Run unit tests
run: |
./build/unit/unit
cd "$RootDir/build"
ctest
cd "$RootDir/unit_py"
"${PYTHON_EXECUTABLE}" -m unittest discover -v
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/manylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ jobs:
"${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"
"${PYTHON_EXECUTABLE}" -m pip install --upgrade "numpy<1.20" # for tensorflow compat.
else
"${PYTHON_EXECUTABLE}" -m pip install --upgrade numpy
"${PYTHON_EXECUTABLE}" -m pip install --upgrade "numpy<1.22" # for numba compat.
fi
- name: Build project dependencies
run: |
Expand Down Expand Up @@ -124,7 +124,8 @@ jobs:

- name: Run unit tests
run: |
./build/unit/unit
cd "$RootDir/build"
ctest
cd "$RootDir/unit_py"
"${PYTHON_EXECUTABLE}" -m unittest discover -v
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
matrix:
include:
- os: ubuntu-18.04
BUILD_TYPE: 'Release'
- os: ubuntu-20.04
BUILD_TYPE: 'Debug'
- os: ubuntu-20.04
BUILD_TYPE: 'Release'

defaults:
run:
Expand Down Expand Up @@ -51,15 +51,14 @@ jobs:
run: |
sudo env "PATH=$PATH" "${GITHUB_WORKSPACE}/build_tools/easy_install_deps_ubuntu.sh"
"${PYTHON_EXECUTABLE}" -m pip install tensorflow
"${PYTHON_EXECUTABLE}" -m pip install --upgrade numpy
"${PYTHON_EXECUTABLE}" -m pip install --upgrade "numpy<1.22" # for numba compat.
"${PYTHON_EXECUTABLE}" -m pip install "torch==1.8.0+cpu" -f https://download.pytorch.org/whl/torch_stable.html
"${PYTHON_EXECUTABLE}" -m pip install --prefer-binary "gym>=0.18.3" "stable_baselines3>=0.10" "importlib-metadata>=3.3.0"
"${PYTHON_EXECUTABLE}" -m pip install "ray[default,rllib]<=1.4.0" # Type checking is not working with 1.4.1
#####################################################################################

- name: PEP8 Code Style Check
if: matrix.os == 'ubuntu-18.04'
if: matrix.os == 'ubuntu-20.04'
run: |
flake8 --ignore=E121,E126,E123,E226,E241,E266,E402,F405,W504 --count --show-source --statistics "$RootDir/python"
Expand Down Expand Up @@ -93,7 +92,8 @@ jobs:
- name: Run jiminy unit tests
run: |
"$RootDir/build/unit/unit"
cd "$RootDir/build"
ctest
cd "$RootDir/unit_py"
"${PYTHON_EXECUTABLE}" -m unittest discover -v
Expand All @@ -110,7 +110,7 @@ jobs:
# Ubuntu 18 is distributed with Python3.6, which is not supported by Numpy>=1.20.
# The new type check support of Numpy is raising pylint and mypy errors, so Ubuntu 18
# is used to do type checking for now.
if: matrix.os == 'ubuntu-18.04'
if: matrix.os == 'ubuntu-20.04'
run: |
gym_modules=(
"common"
Expand All @@ -120,12 +120,13 @@ jobs:
for name in "${gym_modules[@]}"; do
cd "$RootDir/python/gym_jiminy/$name"
pylint --unsafe-load-any-extension=y --ignore-imports=y --min-similarity-lines=7 --max-nested-blocks=7 \
pylint --unsafe-load-any-extension=y --ignore-imports=y --min-similarity-lines=20 --max-nested-blocks=7 \
--good-names=i,j,k,t,q,v,x,e,u,s,v,b,c,f,M,dt,rg,fd,lo,hi,tb,_ \
--disable=fixme,abstract-method,protected-access,useless-super-delegation \
--disable=too-many-instance-attributes,too-many-arguments,too-few-public-methods,too-many-lines \
--disable=too-many-locals,too-many-branches,too-many-statements \
--disable=unspecified-encoding,logging-fstring-interpolation \
--disable=misplaced-comparison-constant --disable=cyclic-import \
--generated-members=numpy.*,torch.* "gym_jiminy/"
mypy --allow-redefinition --check-untyped-defs --disallow-incomplete-defs --disallow-untyped-defs \
Expand All @@ -143,7 +144,7 @@ jobs:
cmake . -DCOMPONENT=docs -P ./cmake_install.cmake
- name: Deploy to GitHub Pages
if: >-
matrix.os == 'ubuntu-18.04' && success() &&
matrix.os == 'ubuntu-20.04' && success() &&
github.repository == 'duburcqa/jiminy' && github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: crazy-max/ghaction-github-pages@v2
with:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
git config --global advice.detachedHead false
python -m pip install --upgrade pip
python -m pip install --upgrade wheel pefile machomachomangler
python -m pip install --upgrade numpy
python -m pip install --upgrade "numpy<1.22" # for numba compat.
python -m pip uninstall -y pipx # Uninstall unecessary packages causing conflicts with the new resolver
- name: Build project dependencies
run: |
Expand Down Expand Up @@ -153,7 +153,8 @@ jobs:
run: |
$RootDir = "${env:GITHUB_WORKSPACE}" -replace '\\', '/'
& "$RootDir/build/unit\${env:BUILD_TYPE}/unit.exe"
Set-Location -Path "$RootDir/build"
ctest
Set-Location -Path "$RootDir/unit_py"
python -m unittest discover -v
Expand Down
4 changes: 3 additions & 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.6)
set(BUILD_VERSION 1.7.7)

# Set compatibility
if(CMAKE_VERSION VERSION_GREATER "3.11.0")
Expand Down Expand Up @@ -64,6 +64,8 @@ endif()

option(BUILD_TESTING "Build the C++ unit tests." ON)
if(BUILD_TESTING)
include(CTest)
include(GoogleTest)
add_subdirectory(unit)
endif()

Expand Down
20 changes: 1 addition & 19 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,7 @@

#### Dependencies installation

There is not requirement to install `jiminy_py` on linux if one does not want to build it. Nevertheless, this package does not provide the backend viewer `gepetto-gui` (still, the backend `meshcat` is available).

##### (optional) Gepetto viewer

The first step to install `gepetto-gui` is to setup the APT repository `robotpkg` to have access to compiled binaries.

```bash
sh -c "echo 'deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub bionic robotpkg' >> /etc/apt/sources.list.d/robotpkg.list" && \
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add -
apt update
```

Once done, it is straightforward to install the required package for Python 3.6.

For Python 3.6

```bash
sudo apt install -y robotpkg-gepetto-viewer=4.4.0 robotpkg-py36-qt4-gepetto-viewer-corba=5.1.2 robotpkg-py36-omniorbpy
```
There is no requirement to install `jiminy_py` on linux if one does not want to build it.

#### Install Jiminy Python package

Expand Down
5 changes: 2 additions & 3 deletions build_tools/easy_install_deps_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ apt update && \
apt install -y sudo python3-setuptools python3-pip python3-tk && \
sudo -u $(id -nu "${SUDO_UID}") env "PATH=${PATH}" python3 -m pip install --upgrade pip && \
sudo -u $(id -nu "${SUDO_UID}") env "PATH=${PATH}" python3 -m pip install --upgrade wheel && \
sudo -u $(id -nu "${SUDO_UID}") env "PATH=${PATH}" python3 -m pip install --upgrade "numpy>=1.16"
sudo -u $(id -nu "${SUDO_UID}") env "PATH=${PATH}" python3 -m pip install --upgrade "numpy>=1.16,<1.22"

# Install Python 3 toolsuite for testing and documentation generation
sudo -u $(id -nu "${SUDO_UID}") env "PATH=${PATH}" python3 -m pip install --upgrade setuptools auditwheel && \
Expand Down Expand Up @@ -81,8 +81,7 @@ fi
# Note that `apt-get` is used instead of `apt` because it supports wildcard in package names
apt-get install -y --allow-downgrades --allow-unauthenticated \
robotpkg-octomap=1.9.0 robotpkg-urdfdom-headers=1.0.4 robotpkg-hpp-fcl=1.7.1 robotpkg-pinocchio=2.5.6 \
robotpkg-qt5-osgqt=3.5.7r2 robotpkg-py3*-qt5-gepetto-viewer=4.12.0r2 robotpkg-py3*-qt5-gepetto-viewer-corba=5.6.0 \
robotpkg-py3*-omniorbpy=4.2.4 robotpkg-py3*-eigenpy=2.6.2 robotpkg-py3*-hpp-fcl=1.7.1 robotpkg-py3*-pinocchio=2.5.6
robotpkg-py3*-eigenpy=2.6.2 robotpkg-py3*-hpp-fcl=1.7.1 robotpkg-py3*-pinocchio=2.5.6

# Add openrobots libraries to python packages search path
if ! [ -f "${PYTHON_SITELIB}/openrobots.pth" ]; then
Expand Down
2 changes: 1 addition & 1 deletion build_tools/wheel_repair_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def copylib(src_path: str, dest_dir: str,
patcher: ElfPatcher) -> Tuple[str, str]:
# Do NOT hash filename to make it unique in the particular case of boost
# python modules, since otherwise it will be impossible to share a common
# registery, which is necessary for cross module interoperability.
# registry, which is necessary for cross module interoperability.
if "libboost_python" in src_path:
src_name = os.path.basename(src_path)
dest_path = os.path.join(dest_dir, src_name)
Expand Down
2 changes: 1 addition & 1 deletion build_tools/wheel_repair_win.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

# This tool has been copied from https://github.com/vinayak-mehta/pdftopng/blob/main/scripts/wheel_repair.py
# and extended to supported hierarchical folder architecture with mulitple .pyd
# and extended to supported hierarchical folder architecture with multiple .pyd
# to update, and to move all the DLL in a common folder *package*.lib installed
# jointly with the package itself, similarly to auditwheel on Linux platform.
#(see also https://discuss.python.org/t/delocate-auditwheel-but-for-windows/2589/9).
Expand Down
4 changes: 2 additions & 2 deletions core/include/jiminy/core/constraints/DistanceConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ namespace jiminy
std::vector<std::string> framesNames_; ///< Names of the frames on which the constraint operates.
std::vector<frameIndex_t> framesIdx_; ///< Corresponding frames indices.
float64_t distanceRef_; ///< Reference Distance between the frames
matrixN_t firstFrameJacobian_; ///< Stores first frame jacobian in world.
matrixN_t secondFrameJacobian_; ///< Stores second frame jacobian in world.
matrix6N_t firstFrameJacobian_; ///< Stores first frame jacobian in world.
matrix6N_t secondFrameJacobian_; ///< Stores second frame jacobian in world.
};
}

Expand Down
20 changes: 10 additions & 10 deletions core/include/jiminy/core/constraints/FixedFrameConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ namespace jiminy
vectorN_t const & v) override final;

private:
std::string const frameName_; ///< Name of the frame on which the constraint operates.
frameIndex_t frameIdx_; ///< Corresponding frame index.
std::vector<uint32_t> dofsFixed_; ///< Degrees of freedom to fix.
bool_t isFixedPositionXY_; ///< Whether or not the frame is fixed for both X and Y translations
pinocchio::SE3 transformRef_; ///< Reference pose of the frame to enforce.
vector3_t normal_; ///< Normal direction locally at the interface.
matrix3_t rotationLocal_; ///< Rotation matrix of the local frame in which to apply masking
matrix6N_t frameJacobian_; ///< Stores full frame jacobian in reference frame.
pinocchio::Motion frameDrift_; ///< Stores full frame drift in reference frame.
matrixN_t UiJt_; ///< Used to store intermediary computation to compute (J.Minv.Jt)_{i,i}
std::string const frameName_; ///< Name of the frame on which the constraint operates.
frameIndex_t frameIdx_; ///< Corresponding frame index.
std::vector<uint32_t> dofsFixed_; ///< Degrees of freedom to fix.
bool_t isFixedPositionXY_; ///< Whether or not the frame is fixed for both X and Y translations
pinocchio::SE3 transformRef_; ///< Reference pose of the frame to enforce.
vector3_t normal_; ///< Normal direction locally at the interface.
matrix3_t rotationLocal_; ///< Rotation matrix of the local frame in which to apply masking
matrix6N_t frameJacobian_; ///< Stores full frame jacobian in reference frame.
pinocchio::Motion frameDrift_; ///< Stores full frame drift in reference frame.
Eigen::Matrix<float64_t, Eigen::Dynamic, 2> UiJt_; ///< Used to store intermediary computation to compute diag(J.Minv.Jt)_t
};
}

Expand Down
2 changes: 1 addition & 1 deletion core/include/jiminy/core/constraints/SphereConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace jiminy
vector3_t normal_; ///< Ground normal, world frame.
matrix3_t shewRadius_; ///< Skew of ground normal, in world frame, scaled by radius.
pinocchio::SE3 transformRef_; ///< Reference pose of the frame to enforce.
matrixN_t frameJacobian_; ///< Stores full frame jacobian in world.
matrix6N_t frameJacobian_; ///< Stores full frame jacobian in world.
};
}

Expand Down
20 changes: 10 additions & 10 deletions core/include/jiminy/core/constraints/WheelConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ namespace jiminy
vectorN_t const & v) override final;

private:
std::string frameName_; ///< Name of the frame on which the constraint operates.
frameIndex_t frameIdx_; ///< Corresponding frame index.
float64_t radius_; ///< Wheel radius.
vector3_t normal_; ///< Ground normal, world frame.
vector3_t axis_; ///< Wheel axis, local frame.
vector3_t x3_; ///< Wheel axis, world frame.
matrix3_t skewRadius_; ///< Skew matrix of wheel axis, in world frame, scaled by radius.
matrix3_t dskewRadius_; ///< Derivative of skew matrix of wheel axis, in world frame, scaled by radius.
pinocchio::SE3 transformRef_; ///< Reference pose of the frame to enforce.
matrixN_t frameJacobian_; ///< Stores full frame jacobian in world.
std::string frameName_; ///< Name of the frame on which the constraint operates.
frameIndex_t frameIdx_; ///< Corresponding frame index.
float64_t radius_; ///< Wheel radius.
vector3_t normal_; ///< Ground normal, world frame.
vector3_t axis_; ///< Wheel axis, local frame.
vector3_t x3_; ///< Wheel axis, world frame.
matrix3_t skewRadius_; ///< Skew matrix of wheel axis, in world frame, scaled by radius.
matrix3_t dskewRadius_; ///< Derivative of skew matrix of wheel axis, in world frame, scaled by radius.
pinocchio::SE3 transformRef_; ///< Reference pose of the frame to enforce.
matrix6N_t frameJacobian_; ///< Stores full frame jacobian in world.
};
}

Expand Down
8 changes: 4 additions & 4 deletions core/include/jiminy/core/engine/EngineMultiRobot.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,10 @@ namespace jiminy
/// \param[in] forceFct Callback function returning the force that systemName2
/// applies on systemName1, in the global frame of frameName1.
hresult_t registerForceCoupling(std::string const & systemName1,
std::string const & systemName2,
std::string const & frameName1,
std::string const & frameName2,
forceCouplingFunctor_t forceFct);
std::string const & systemName2,
std::string const & frameName1,
std::string const & frameName2,
forceCouplingFunctor_t forceFct);
hresult_t registerViscoElasticDirectionalForceCoupling(std::string const & systemName1,
std::string const & systemName2,
std::string const & frameName1,
Expand Down
2 changes: 1 addition & 1 deletion core/include/jiminy/core/engine/System.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ namespace jiminy
std::vector<int32_t> boundJointsActiveDir; ///< Store the active "direction" of the bound (0 for lower, 1 for higher)
forceVector_t contactFramesForces; ///< Contact forces for each contact frames in local frame
vector_aligned_t<forceVector_t> collisionBodiesForces; ///< Contact forces for each geometries of each collision bodies in local frame
matrixN_t jointJacobian; ///< Buffer used for intermediary computation of `data.u`
matrix6N_t jointJacobian; ///< Buffer used for intermediary computation of `data.u`
vectorN_t lo; ///< Lower bound of LCP problem
vectorN_t hi; ///< Higher bound of LCP problem
std::vector<std::vector<int32_t> > fIndices; ///< Used to indicate linear coupling between bounds of LCP and the solution (i.e. friction cone: - mu * F_z < F_x/F_y < mu * F_z)
Expand Down
2 changes: 1 addition & 1 deletion core/include/jiminy/core/robot/AbstractSensor.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ namespace jiminy
sharedHolder_->data_.resize(2);
for (matrixN_t & data : sharedHolder_->data_)
{
data = matrixN_t::Zero(getSize(), sharedHolder_->num_); // Do NOT use setZero since the size may be ill-defined
data.setZero(getSize(), sharedHolder_->num_);
}
sharedHolder_->dataMeasured_.setZero();

Expand Down
2 changes: 1 addition & 1 deletion core/include/jiminy/core/robot/Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace jiminy

std::shared_ptr<AbstractConstraintBase> get(std::string const & key);
std::shared_ptr<AbstractConstraintBase> get(std::string const & key,
constraintsHolderType_t const & holderType);
constraintsHolderType_t const & holderType);

void insert(constraintsMap_t const & constraintsMap,
constraintsHolderType_t const & holderType);
Expand Down
Loading

0 comments on commit a1e571b

Please sign in to comment.