Skip to content

Commit

Permalink
Merge pull request #646 from ferrolho/hf/dev
Browse files Browse the repository at this point in the history
RigidBodyDynamics.jl v2.5.0
  • Loading branch information
rdeits authored Nov 8, 2024
2 parents 7cd36b9 + 6e694d7 commit d6df4eb
Show file tree
Hide file tree
Showing 20 changed files with 1,843 additions and 1,382 deletions.
36 changes: 24 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: CI

# Run on master, tags, or any pull request
on:
push:
branches:
Expand All @@ -15,21 +17,31 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1'
- 'lts'
- '1.9' # Temporary for notebooks
- '1.11'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
include:
- os: macOS-latest
version: 1.11
arch: arm64
- os: macOS-latest
version: 1.11
arch: x64
- os: windows-latest
version: 1.11
arch: x64

steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
- uses: actions/cache@v3
env:
cache-name: cache-artifacts
CI: true
Expand All @@ -40,15 +52,15 @@ jobs:
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@v1
env:
PYTHON: ""
JULIA_NUM_THREADS: "2"
with:
prefix: ${{ matrix.prefix }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v2
with:
file: lcov.info

docs:
name: Documentation
runs-on: ubuntu-latest
Expand Down
23 changes: 20 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
# Files generated by invoking Julia with --code-coverage
*.jl.cov
*.jl.*.cov

# Files generated by invoking Julia with --track-allocation
*.jl.mem

# System-specific files and directories generated by the BinaryProvider and BinDeps packages
# They contain absolute paths specific to the host computer, and so should not be committed
deps/deps.jl
*.ipynb_checkpoints
deps/build.log
deps/downloads/
deps/usr/
deps/src/

# Build artifacts for creating documentation generated by the Documenter package
docs/build/
docs/site/
perf/benchmarkparams.jld
/Manifest.toml

# File generated by Pkg, the package manager, based on a corresponding Project.toml
# It records a fixed state of all packages used by the project. As such, it should not be
# committed for packages, but should be committed for applications that require a static
# environment.
Manifest.toml

# Jupyter
.ipynb_checkpoints/
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "RigidBodyDynamics"
uuid = "366cf18f-59d5-5db9-a4de-86a9f6786172"
version = "2.4.0"
version = "2.5.0"

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Expand All @@ -19,8 +19,8 @@ UnsafeArrays = "c4a57d5a-5b31-53a6-b365-19f8c011fbd6"
DocStringExtensions = "0.4.1, 0.5, 0.6, 0.7, 0.8, 0.9"
LightXML = "0.8, 0.9"
LoopThrottle = "0.1"
Reexport = "0.2, 1.0"
Rotations = "1.1 - 1.2"
Reexport = "0.2, 1"
Rotations = "1"
StaticArrays = "0.8, 0.9, 0.10, 0.11, 0.12, 1"
TypeSortedCollections = "1"
UnsafeArrays = "1"
Expand Down
93 changes: 47 additions & 46 deletions docs/src/benchmarks.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Benchmarks

To attain maximal performance, it is recommended to pass `-O3`, `--check-bounds=no` as command line flags to `julia`. As of Julia 1.1, maximizing performance for the `dynamics!` algorithm requires either setting the number of BLAS threads to 1 (`using LinearAlgebra; BLAS.set_num_threads(1)`) if using OpenBLAS (the default), or compiling Julia with MKL. See [this issue](https://github.com/JuliaRobotics/RigidBodyDynamics.jl/issues/500) for more information.
To attain maximal performance, it is recommended to pass `-O3` and `--check-bounds=no` as command line flags to `julia`:

```bash
cd RigidBodyDynamics.jl
julia -O3 --check-bounds=no perf/runbenchmarks.jl
```

> **Warning**
> For Julia versions previous to `v1.8`, maximizing performance for the `dynamics!` algorithm requires either setting the number of BLAS threads to 1 (`using LinearAlgebra; BLAS.set_num_threads(1)`) if using OpenBLAS (the default), or compiling Julia with MKL. See [this issue](https://github.com/JuliaRobotics/RigidBodyDynamics.jl/issues/500) for more information.
Run `perf/runbenchmarks.jl` to see benchmark results for the Atlas robot (v5). Results below are for the following scenarios:

Expand All @@ -9,69 +17,62 @@ Run `perf/runbenchmarks.jl` to see benchmark results for the Atlas robot (v5). R
3. Do inverse dynamics.
4. Do forward dynamics.

Note that results on CI builds are **not at all** representative because of code coverage. Results on a reasonably fast laptop at commit [870bea6](https://github.com/JuliaRobotics/RigidBodyDynamics.jl/commit/870bea668d5b11ce0555fa0552592d2c3cb15c54):
> **Note**
> Results on CI builds are **not at all** representative because of code coverage.
Output of `versioninfo()`:
Below are the results for **RBD.jl 2.5.0** (commit [`93a5ea`](https://github.com/JuliaRobotics/RigidBodyDynamics.jl/commit/93a5eaf15a5f6714b1ec1ce621b053542dcb721d)) using **Julia 1.11.1** on an **Apple MacBook Air (M2, 2023)** (16GB RAM, 512GB SSD):

Output of `versioninfo()`:
```
Julia Version 1.5.3
Commit 788b2c77c1 (2020-11-09 13:37 UTC)
Julia Version 1.11.1
Commit 8f5b7ca12ad (2024-10-16 10:53 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (x86_64-apple-darwin18.7.0)
CPU: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 8 × Apple M2
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
LLVM: libLLVM-16.0.6 (ORCJIT, apple-m2)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)
```

Note that this is a different machine than the one that was used for earlier benchmarks.

Mass matrix:
> **Note**
> This is a different machine than the one that was used for earlier benchmarks.
Mass matrix ([`mass_matrix!`](@ref)):
```
memory estimate: 0 bytes
allocs estimate: 0
--------------
minimum time: 4.415 μs (0.00% GC)
median time: 4.579 μs (0.00% GC)
mean time: 4.916 μs (0.00% GC)
maximum time: 19.794 μs (0.00% GC)
BenchmarkTools.Trial: 10000 samples with 10 evaluations.
Range (min … max): 3.728 μs … 10.024 μs ┊ GC (min … max): 0.00% … 0.00%
Time (median): 3.874 μs ┊ GC (median): 0.00%
Time (mean ± σ): 3.903 μs ± 180.208 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
Memory estimate: 0 bytes, allocs estimate: 0.
```

Mass matrix and Jacobian from left hand to right foot:

Mass matrix ([`mass_matrix!`](@ref)) and Jacobian ([`geometric_jacobian!`](@ref)) from left hand to right foot:
```
memory estimate: 0 bytes
allocs estimate: 0
--------------
minimum time: 4.860 μs (0.00% GC)
median time: 4.982 μs (0.00% GC)
mean time: 5.399 μs (0.00% GC)
maximum time: 24.712 μs (0.00% GC)
BenchmarkTools.Trial: 10000 samples with 10 evaluations.
Range (min … max): 3.941 μs … 9.020 μs ┊ GC (min … max): 0.00% … 0.00%
Time (median): 4.103 μs ┊ GC (median): 0.00%
Time (mean ± σ): 4.135 μs ± 196.842 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
Memory estimate: 0 bytes, allocs estimate: 0.
```

Note the low additional cost of computing a Jacobian when the mass matrix is already computed. This is because RigidBodyDynamics.jl caches intermediate computation results.

Inverse dynamics:

Inverse dynamics ([`inverse_dynamics!`](@ref)):
```
memory estimate: 0 bytes
allocs estimate: 0
--------------
minimum time: 4.256 μs (0.00% GC)
median time: 4.541 μs (0.00% GC)
mean time: 4.831 μs (0.00% GC)
maximum time: 21.625 μs (0.00% GC)
BenchmarkTools.Trial: 10000 samples with 10 evaluations.
Range (min … max): 2.736 μs … 5.666 μs ┊ GC (min … max): 0.00% … 0.00%
Time (median): 2.866 μs ┊ GC (median): 0.00%
Time (mean ± σ): 2.882 μs ± 119.781 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
Memory estimate: 0 bytes, allocs estimate: 0.
```

Forward dynamics:

Forward dynamics ([`dynamics!`](@ref)):
```
memory estimate: 0 bytes
allocs estimate: 0
--------------
minimum time: 13.600 μs (0.00% GC)
median time: 14.419 μs (0.00% GC)
mean time: 16.071 μs (0.00% GC)
maximum time: 55.328 μs (0.00% GC)
BenchmarkTools.Trial: 10000 samples with 10 evaluations.
Range (min … max): 9.791 μs … 13.899 μs ┊ GC (min … max): 0.00% … 0.00%
Time (median): 9.874 μs ┊ GC (median): 0.00%
Time (mean ± σ): 9.942 μs ± 292.126 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
Memory estimate: 0 bytes, allocs estimate: 0.
```
1 change: 0 additions & 1 deletion examples/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
**/*.ipynb
**/*.md

Loading

4 comments on commit d6df4eb

@ferrolho
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while trying to register: Register Failed
@ferrolho, it looks like you are not a publicly listed member/owner in the parent organization (JuliaRobotics).
If you are a member/owner, you will need to change your membership to public. See GitHub Help

@ferrolho
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/118956

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.5.0 -m "<description of version>" d6df4ebeb927e98bfa5216997c5d08502273189c
git push origin v2.5.0

Please sign in to comment.