Skip to content

Commit

Permalink
Merge pull request #145 from NOSALRO/new_docs
Browse files Browse the repository at this point in the history
Documentation + fixes
  • Loading branch information
costashatz authored May 1, 2024
2 parents 551fe47 + 5e970e7 commit 48215f4
Show file tree
Hide file tree
Showing 930 changed files with 527,501 additions and 960 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,35 @@ on:
push:
branches:
- "**"
paths:
- 'cmake/**'
- 'src/examples/**'
- 'src/python/**'
- 'src/robot_dart/**'
- 'src/tests/**'
- 'src/utheque/**'
- 'utheque/**'
- 'ci/**'
- 'waf_tools/**'
- 'wscript'
- 'waf'
- '.github/workflows/ci_linux.yml'
pull_request:
branches:
- "**"
paths:
- 'cmake/**'
- 'src/examples/**'
- 'src/python/**'
- 'src/robot_dart/**'
- 'src/tests/**'
- 'src/utheque/**'
- 'utheque/**'
- 'ci/**'
- 'waf_tools/**'
- 'wscript'
- 'waf'
- '.github/workflows/ci_linux.yml'

jobs:
build:
Expand All @@ -34,12 +60,12 @@ jobs:
CI_HOME: ${{github.workspace}}
DART_DIR: "/home/runner/.dart_install/share/dart/cmake"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Ubuntu packages
run: ${{github.workspace}}/ci/install_packages.sh
- name: Cache DART
id: cache-dart
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.dart_install
key: dart-${{ matrix.dart_tag }}-${{ matrix.compiler }}-py3_${{ matrix.build_python }}-${{ matrix.os }}
Expand Down Expand Up @@ -86,6 +112,6 @@ jobs:
if [ "$BUILD_PYTHON" = "ON" ]; then
python_dist_dir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix=''))")
export PYTHONPATH=/home/runner/.dart_install/$python_dist_dir
python ${{github.workspace}}/src/python/ci.py
python ${{github.workspace}}/src/examples/python/ci.py
fi
6 changes: 3 additions & 3 deletions .github/workflows/ci_linux_dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
build_type: [Release]
build_python: [ON]
compiler: [gcc, clang]
dart_tag: ["v6.12.1"]
dart_tag: ["v6.13.1"]
env:
COMPILER: ${{ matrix.compiler }}
BUILD_TYPE: ${{ matrix.build_type }}
Expand All @@ -28,12 +28,12 @@ jobs:
CI_HOME: ${{github.workspace}}
DART_DIR: "/home/runner/.dart_install/share/dart/cmake"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Ubuntu packages
run: ${{github.workspace}}/ci/install_packages.sh
- name: Cache DART
id: cache-dart
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.dart_install
key: dart-${{ matrix.dart_tag }}-${{ matrix.compiler }}-py3_${{ matrix.build_python }}-${{ matrix.os }}
Expand Down
109 changes: 109 additions & 0 deletions .github/workflows/ci_mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# https://help.github.com/en/articles/workflow-syntax-for-github-actions

name: CI MacOS

on:
push:
branches:
- "**"
paths:
- 'cmake/**'
- 'src/examples/**'
- 'src/python/**'
- 'src/robot_dart/**'
- 'src/tests/**'
- 'src/utheque/**'
- 'utheque/**'
- 'ci/**'
- 'waf_tools/**'
- 'wscript'
- 'waf'
- '.github/workflows/ci_mac.yml'
pull_request:
branches:
- "**"
paths:
- 'cmake/**'
- 'src/examples/**'
- 'src/python/**'
- 'src/robot_dart/**'
- 'src/tests/**'
- 'src/utheque/**'
- 'utheque/**'
- 'ci/**'
- 'waf_tools/**'
- 'wscript'
- 'waf'
- '.github/workflows/ci_mac.yml'

jobs:
build:
if: github.event_name != 'workflow_dispatch'
name: OS:${{ matrix.os }}-Magnum:${{ matrix.magnum_gui }}-Build:${{ matrix.build_type }}-Python:${{ matrix.build_python }}-Compiler:${{ matrix.compiler }}-DART:${{ matrix.dart_tag }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-12]
build_type: [Release]
build_python: [OFF] # Let's remove python for now from Mac CI
compiler: [gcc, clang]
magnum_gui: [ON, OFF]
env:
COMPILER: ${{ matrix.compiler }}
BUILD_TYPE: ${{ matrix.build_type }}
BUILD_PYTHON: ${{ matrix.build_python }}
MAGNUM_GUI: ${{ matrix.magnum_gui }}
DART_TAG: ${{ matrix.dart_tag }}
CI_HOME: ${{github.workspace}}
steps:
- uses: actions/checkout@v4
- name: Install deps
run: brew install binutils pybind11
- name: Install numpy
run: python -m pip install --upgrade pip && pip3 install numpy
- name: Install DART
run: |
if [ "$BUILD_PYTHON" = "ON" ]; then
brew install dartsim --only-dependencies && pip3 install dartpy ;
else
brew install dartsim ;
fi
- name: Build Magnum
run: if [ "$MAGNUM_GUI" = "ON" ]; then brew install sdl2 glfw eigen glm bullet assimp devil faad2 freetype glslang harfbuzz libpng libspng jpeg openexr spirv-tools zstd webp && ${{github.workspace}}/ci/install_magnum.sh /usr/local ; fi
- name: Build robot_dart
run: |
if [ "$COMPILER" = "gcc" ]; then
export CC=/usr/bin/gcc && export CXX=/usr/bin/g++
fi
if [ "$COMPILER" = "clang" ]; then
export CC=/usr/bin/clang && export CXX=/usr/bin/clang++
fi
cd ${{github.workspace}}
if [ "$BUILD_PYTHON" = "ON" ]; then
./waf configure --tests --python --prefix=/usr/local ;
else
./waf configure --tests --prefix=/usr/local ;
fi
./waf
- name: Run tests
run: ./waf --tests
- name: Build examples
run: ./waf examples
- name: Install
run: sudo ./waf install
- name: Run CMake
run: |
if [ "$COMPILER" = "gcc" ]; then
export CC=/usr/bin/gcc && export CXX=/usr/bin/g++
fi
if [ "$COMPILER" = "clang" ]; then
export CC=/usr/bin/clang && export CXX=/usr/bin/clang++
fi
cd ${{github.workspace}}/cmake/example && mkdir -p build && cd build && cmake .. && make -j4
cd ${{github.workspace}}/cmake/example_utheque && mkdir -p build && cd build && cmake .. && make -j4
- name: Run Python
run: |
if [ "$BUILD_PYTHON" = "ON" ]; then
python ${{github.workspace}}/src/examples/python/ci.py
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ build
*.pyc
res/nao_meshes
.vscode
paper/*.crossref
paper/*.pdf
paper/*.tex
30 changes: 30 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BSD 2-Clause License

Copyright (c) 2022-2024 Computational Intelligence Lab, University of Patras, Greece
Copyright (c) 2023-2024 Laboratory of Automation and Robotics, University of Patras, Greece
Copyright (c) 2017-2018 LARSEN Team, Inria, France
Copyright (c) 2017-2024 Konstantinos Chatzilygeroudis
Copyright (c) 2017-2024 Jean-Baptiste Mouret
Copyright (c) 2023-2024 Dionis Totsila
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52 changes: 42 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,55 @@
robot_dart [![Build Status](https://github.com/resibots/robot_dart/actions/workflows/ci_linux.yml/badge.svg?branch=master)](https://github.com/resibots/robot_dart/actions/workflows/ci_linux.yml)
RobotDART [![Build Status](https://github.com/resibots/robot_dart/actions/workflows/ci_linux.yml/badge.svg?branch=master)](https://github.com/resibots/robot_dart/actions/workflows/ci_linux.yml)
=====================================================================================================================================================================================================

### CAUTION: The library is under-going a serious re-structure and development. Expect breaking of API/ABI, and out-of-date guides. We will soon provide a new release with many new features and a proper documentation.
RobotDART is a C++ robot simulator (with optional Python bindings) built on top of the [DART] physics engine. The RobotDART simulator is intended to be used by Robotics and Machine Learning researchers who want to write controllers or test learning algorithms without the delays and overhead that usually comes with other simulators (e.g., Gazebo, Coppelia-sim).

#### This repo contains a generic wrapper around the [DART] simulator.
## Documentation

Documentation is available at: [https://nosalro.github.io/robot_dart/](https://nosalro.github.io/robot_dart/)

## Authors

- Author/Maintainer: Konstantinos Chatzilygeroudis
- Active contributors: Jean-Baptiste Mouret
- Author/Maintainer: Konstantinos Chatzilygeroudis (University of Patras)
- Active contributors: Dionis Totsila (Inria and University of Patras), Jean-Baptiste Mouret (Inria)
- Other contributors: Antoine Cully, Vassilis Vassiliades, Vaios Papaspyros

### Using the code
## Citing RobotDART

If you use this code in a scientific publication, please use the following citation:

```bibtex
@article{chatzilygeroudis2024robot,
title={{RobotDART: a versatile robot simulator for robotics and machine learning researchers}},
author={Chatzilygeroudis, Konstantinos and Dionis, Totsila and Mouret, Jean-Baptiste},
year={2024},
booktitle={{Preprint (Submitted to JOSS)}}
}
```

## Acknowledgments

This work was supported by the [Hellenic Foundation for Research and Innovation](https://www.elidek.gr/en/homepage/) (H.F.R.I.) under the "3rd Call for H.F.R.I. Research Projects to support Post-Doctoral Researchers" (Project Acronym: NOSALRO, Project Number: 7541).

<p align="center">
<img src="https://www.elidek.gr/wp-content/themes/elidek/images/elidek_logo_en.png" alt="logo_elidek"/>
<p/>

This work was conducted within the [Computational Intelligence Lab](http://cilab.math.upatras.gr/) (CILab), Department of Mathematics, University of Patras, Greece.

<p align="center">
<img src="https://nosalro.github.io/images/logo_cilab.jpg" alt="logo_cilab" width="50%"/>
<img src="https://www.upatras.gr/wp-content/uploads/up_2017_logo_en.png" alt="logo_cilab" width="50%"/>
</p>

<!-- This work was partly supported by the ResiBots ERC Project (http://www.resibots.eu).
<p align="center">
<img src="http://resibots.eu/_static/resibots_logo_black_200px.png" alt="logo_resibots"/>
</p> -->

Please look at the [installation guide](docs/installation.md). You will find detailed guidelines on how to properly install all the dependencies, compile the code and run the examples. There is also a short [tutorial](docs/tutorial.md) where the basics of this small library are explained through coding a small example. Moreover, a small [guide](docs/guide.md) provides a brief overview of the main classes and functionality of the library. Finally, there exist python bindings of the library, located [here](src/python) (see the examples for usage).

## LICENSE
## License

[CeCILL]
[BSD 2-Clause "Simplified" License](https://opensource.org/license/bsd-2-clause/)

[CeCILL]: http://www.cecill.info/index.en.html
[DART]: http://dartsim.github.io/
48 changes: 37 additions & 11 deletions ci/install_dart_latest.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
mkdir -p ~/.deps
cd ~/.deps

python_dist_dir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix=''))")
mkdir -p ~/.dart_install/$python_dist_dir

# Select Compiler
if [ "$COMPILER" = "gcc" ]; then
export CC=/usr/bin/gcc && export CXX=/usr/bin/g++
Expand All @@ -12,26 +6,58 @@ if [ "$COMPILER" = "clang" ]; then
export CC=/usr/bin/clang && export CXX=/usr/bin/clang++
fi

PREFIX=/usr
DEPS_FOLDER=~/.deps
DART_TAG=v6.13.1
SUDOCMD=sudo

PREFIX=${1:-$PREFIX}
DEPS_FOLDER=${2:-$DEPS_FOLDER}
DART_TAG=${3:-$DART_TAG}
SUDOCMD=${4:-$SUDOCMD}

python_dist_dir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix=''))")
${SUDOCMD} mkdir -p ${PREFIX}/$python_dist_dir

mkdir -p ${DEPS_FOLDER}
cd ${DEPS_FOLDER}

if [ ! -d "dart" ]
then
git clone https://github.com/dartsim/dart.git
fi
cd dart
git checkout $DART_TAG
mkdir build
git pull
mkdir -p build
cd build

# Build DART
if [ "$BUILD_PYTHON" = "ON" ]; then
cmake -DDART_BUILD_DARTPY=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=/home/runner/.dart_install ..
cmake -DDART_TREAT_WARNINGS_AS_ERRORS=OFF -DDART_BUILD_DARTPY=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
else
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=/home/runner/.dart_install ..
cmake -DDART_TREAT_WARNINGS_AS_ERRORS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
fi
make -j4
sudo make install
${SUDOCMD} make install

# We are inside the CI
if [ "$PREFIX" = "/home/runner/.dart_install" ]; then
sudo ldconfig
cd $CI_HOME

# Hack for dartpy installation
python_file=/usr/lib/python3/dist-packages/dartpy.cpython-310-x86_64-linux-gnu.so
if [ -f "$python_file" ]; then
cp $python_file ~/.dart_install/$python_dist_dir
cp $python_file ${PREFIX}/$python_dist_dir
fi

else
# Hack for dartpy installation
python_dot_version=$(python -c "import sys; print('.'.join(str(s) for s in sys.version_info[:2]))")
python_version=$(python -c "import sys; print(''.join(str(s) for s in sys.version_info[:2]))")
python_global_install=/usr/lib/python${python_dot_version}/site-packages/dartpy.cpython-${python_version}-x86_64-linux-gnu.so
if [ -f "$python_global_install" ]; then
${SUDOCMD} mv $python_global_install ${PREFIX}/$python_dist_dir
fi
fi
Loading

0 comments on commit 48215f4

Please sign in to comment.