Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
5098f90
Buildable version with reduced functionality:
DmitryNeverov Apr 27, 2020
bc62e9c
Fixed Transform extension type:
DmitryNeverov Apr 27, 2020
23672d9
Returned all previous functionallity:
DmitryNeverov Apr 27, 2020
2dee003
Fixed ordering mismatch bug
DmitryNeverov Apr 27, 2020
af54f59
Fix bvh path
CyrilWaechter Jul 23, 2020
6ecd4d2
update metadata to fcl 0.6.1
CyrilWaechter Jul 21, 2021
92502dc
update docker file for manylinux build
CyrilWaechter Jul 23, 2021
158e3c9
Add github actions to build python wheels
CyrilWaechter Jul 23, 2021
8f606d5
Fix many issues in deployment process
CyrilWaechter Jul 25, 2021
bf53e55
Add macos build
CyrilWaechter Jul 26, 2021
0a046fb
Add windows build
CyrilWaechter Jul 27, 2021
369e48c
Update setup.cfg + refactor ps script
CyrilWaechter Jul 27, 2021
f64a153
Fix build for blender and win ci
CyrilWaechter Jul 29, 2021
4d13c91
Fix release tag and remove useless before build
CyrilWaechter Aug 3, 2021
840fd64
Fix Linux build : build on manylinux_2010 instead
CyrilWaechter Aug 3, 2021
9c18116
Modify metadata/dockerfile/travis to prepare merge
CyrilWaechter Aug 4, 2021
12edfe2
Split push/release github actions workflows
CyrilWaechter Aug 4, 2021
2173ff9
Remove useless blender_requirement.txt
CyrilWaechter Aug 5, 2021
c5d4f1f
Update src/fcl/fcl.pyx
mikedh Aug 6, 2021
9c19f8a
Update src/fcl/fcl.pyx
mikedh Aug 6, 2021
ffea96f
Merge pull request #29 from CyrilWaechter/master
mikedh Sep 9, 2021
0b4a1cf
add pypi upload step
mikedh Sep 9, 2021
61b67c8
run release on push to master
mikedh Sep 9, 2021
46deaf3
github actions new env-variable setting method
mikedh Sep 9, 2021
3ed68c2
get version differently on windows
mikedh Sep 9, 2021
0378a2c
GA tag
mikedh Sep 9, 2021
df3e347
matrix key
mikedh Sep 9, 2021
f0836e2
skip auto tag for now
mikedh Sep 9, 2021
5a8d359
fix user for pypi
mjd3 Jan 4, 2022
96144af
ci: remove travis, add formatting
mjd3 Jul 1, 2022
2cb71fa
fix: py2to3 example
mjd3 Jul 1, 2022
780f4b0
feat: expose signed distance flag
mjd3 Jul 1, 2022
8ba0882
feat: bind fcl convex type
mjd3 Jul 1, 2022
e9f3037
fix: min distance nearest points fix, add to tests
mjd3 Jul 1, 2022
cc75369
bump version for pypi, fix CI versioning
mjd3 Jul 6, 2022
8ffedeb
upgrade to fcl 0.7.0, octomap 1.9.8 (#51)
mjd3 Jul 6, 2022
b2bd50e
Enable double precision libccd builds for windows/linux (#52)
mjd3 Jul 9, 2022
5019454
try newer cibuildwheel
mikedh Jan 11, 2023
4c26f80
try avoiding auto cleanup
mikedh Jan 11, 2023
5a844b1
Merge pull request #57 from BerkeleyAutomation/feat/311
mikedh Jan 11, 2023
7068479
feat: macos arm wheels
jackbow Jan 17, 2023
cb03f82
feat: format and upgrade github actions
jackbow Jan 17, 2023
8747d18
fix: bump version to 0.7.0.3
jackbow Jan 18, 2023
33a2610
Merge pull request #59 from jackbow/upgrade-actions
mikedh Jan 18, 2023
0de3c38
Merge branch 'master' into master
jackbow Jan 19, 2023
4afd38e
Merge pull request #58 from jackbow/master
mikedh Jan 19, 2023
6318381
fix: release.yml echo echo
jackbow Jan 19, 2023
85c7b45
Merge pull request #60 from jackbow/master
mikedh Jan 19, 2023
dc99953
Update version.py
mikedh Jan 19, 2023
b41e440
Update push.yml
Eric-Vin Aug 15, 2023
942657e
Update release.yml
Eric-Vin Aug 15, 2023
e872011
Bump Version from 0.7.0.4 -> 0.7.0.5
Eric-Vin Aug 15, 2023
9bdcfd9
Ran black on tests.
Eric-Vin Aug 15, 2023
ba2c811
Added max Cython version.
Eric-Vin Aug 15, 2023
5dd75b4
Rerun black with '-l 90'
Eric-Vin Aug 15, 2023
2f67f5b
Changed numpy versioning.
Eric-Vin Aug 15, 2023
74215b3
Changed installed numpy version to fixed versions.
Eric-Vin Aug 15, 2023
17d1b56
Try changing back from oldest-supported-numpy to numpy
Eric-Vin Aug 16, 2023
43ebd59
Tweak to avoid double specifying numpy?
Eric-Vin Aug 16, 2023
c1e2cdb
Merge pull request #70 from Eric-Vin/master
mikedh Aug 16, 2023
418819d
Update url and misc in setup.cfg
CyrilWaechter Jan 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build

on: [push, pull_request, workflow_dispatch]

jobs:
formatting:
name: Check Formatting
runs-on: ubuntu-latest
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: flake8
uses: py-actions/flake8@v2
- name: black
uses: psf/black@stable
with:
options: '--check --diff -l 90'

build_wheels:
name: Build wheel on ${{matrix.platform}}
runs-on: ${{matrix.platform}}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/cibuildwheel@v2.15.0
env:
CIBW_ARCHS_MACOS: 'x86_64 arm64'
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
78 changes: 78 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Release To Pypi

on:
push:
branches:
- master

jobs:
create_release:
name: Create GitHub Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35.4.1
- name: Tag Version
if: contains(steps.changed-files.outputs.modified_files, 'src/fcl/version.py')
id: set_tag
run: |
export VER=v$(python -c "exec(open('src/fcl/version.py','r').read());print(__version__)")
echo "tag_name=${VER}" >> $GITHUB_OUTPUT
- name: Create Release
if: contains(steps.changed-files.outputs.modified_files, 'src/fcl/version.py')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.set_tag.outputs.tag_name }}
release_name: ${{ steps.set_tag.outputs.tag_name }}
draft: false
prerelease: false
outputs:
mod_files: ${{ steps.changed-files.outputs.modified_files }}

build_wheels:
if: contains(needs.create_release.outputs.mod_files, 'src/fcl/version.py')
name: Build wheel on ${{matrix.platform}}
runs-on: ${{matrix.platform}}
needs: create_release
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/cibuildwheel@v2.15.0
env:
CIBW_ARCHS_MACOS: 'x86_64 arm64'
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
- uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: ./wheelhouse/*.whl
overwrite: true
draft: false
update_latest_release: true

upload_pypi:
if: contains(needs.create_release.outputs.mod_files, 'src/fcl/version.py')
needs: [create_release, build_wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.6.4
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ wheels/
.installed.cfg
*.egg
MANIFEST
deps/

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -103,3 +104,6 @@ venv.bak/

# mypy
.mypy_cache/

# vscode settings
.vscode/
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# python-fcl
### Python Interface for the Flexible Collision Library

[![Build Status](https://travis-ci.org/BerkeleyAutomation/python-fcl.svg?branch=master)](https://travis-ci.org/BerkeleyAutomation/python-fcl)

Python-FCL is an (unofficial) Python interface for the [Flexible Collision Library (FCL)](https://github.com/flexible-collision-library/fcl),
an excellent C++ library for performing proximity and collision queries on pairs of geometric models.
Currently, this package is targeted for FCL 0.5.0.
Currently, this package is targeted for FCL 0.7.0.

This package supports three types of proximity queries for pairs of geometric models:
* __Collision Detection__: Detecting whether two models overlap (and optionally where).
Expand All @@ -19,6 +17,7 @@ This package also supports most of FCL's object shapes, including:
* Ellipsoid
* Capsule
* Cone
* Convex
* Cylinder
* Half-Space
* Plane
Expand All @@ -27,10 +26,11 @@ This package also supports most of FCL's object shapes, including:

## Installation

First, install [octomap](https://github.com/OctoMap/octomap), which is necessary using OcTree. For Ubuntu, using `sudo apt-get install liboctomap-dev`
First, install [octomap](https://github.com/OctoMap/octomap), which is necessary to use OcTree. For Ubuntu, use `sudo apt-get install liboctomap-dev`.
Second, install FCL using the instructions provided [here](https://github.com/flexible-collision-library/fcl).
If you're on Ubuntu 17.04 or newer, you can install FCL using `sudo apt-get install libfcl-dev`.
Otherwise, just compile FCL from source -- it's quick and easy, and its dependencies are all easily installed via `apt` or `brew`.
Note: the provided install scripts (under `build_dependencies`) can automate this process as well.

In order to install the Python wrappers for FCL, simply run
```shell
Expand All @@ -41,8 +41,7 @@ pip install python-fcl

### Collision Objects
The primary construct in FCL is the `CollisionObject`, which forms the backbone of all collision and distance computations.
A `CollisionObject` consists of two components -- its geometry, defined by a `CollisionGeometry` object,
and its pose, defined by a `Transform` object.
A `CollisionObject` consists of two components -- its geometry, defined by a `CollisionGeometry` object, and its pose, defined by a `Transform` object.

#### Collision Geometries
There are two main types of `CollisionGeometry` objects -- geometric primitives, such as boxes and spheres,
Expand Down Expand Up @@ -90,6 +89,20 @@ m.addSubModel(verts, tris)
m.endModel()
```

If the mesh is convex, such as the example above, you can also wrap it in the `Convex` class. Note that the instantiation is a bit different because the `Convex` class supports arbitrary polygons for each face of the convex object.
```python
verts = np.array([[1.0, 1.0, 1.0],
[2.0, 1.0, 1.0],
[1.0, 2.0, 1.0],
[1.0, 1.0, 2.0]])
tris = np.array([[0,2,1],
[0,3,2],
[0,1,3],
[1,2,3]])
faces = np.concatenate((3 * np.ones((len(tris), 1), dtype=np.int64), tris), axis=1).flatten()
c = fcl.Convex(verts, len(tris), faces)
```

#### Transforms
In addition to a `CollisionGeometry`, a `CollisionObject` requires a `Transform`, which tells FCL where the `CollisionGeometry` is actually located in the world.
All `Transform` objects specify a rigid transformation (i.e. a rotation and a translation).
Expand Down Expand Up @@ -349,4 +362,4 @@ for coll_pair in objs_in_collision:
```
>>> Object obj1 in collision with object obj2!
```
For more examples, see `example/example.py`.
For more examples, see `examples/example.py`.
25 changes: 25 additions & 0 deletions build_dependencies/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# NOTE: this docker file is only for local testing of the build
# example of testing a build locally:
# docker build . -t pythonfcl -f build_dependencies/Dockerfile

FROM quay.io/pypa/manylinux2010_x86_64:latest

# build and install libccd and fcl using cmake
COPY build_dependencies/install_linux.sh .
RUN bash install_linux.sh

# manylinux includes a bunch of pythons
# to test with others change this env variable
#ENV PATH=/opt/python/cp27-cp27m/bin:$PATH
ENV PATH=/opt/python/cp39-cp39/bin:$PATH

# we need numpy to build python-fcl
# since we set our path we'll be using the right pip
RUN pip install numpy cython

# build the python-fcl module
COPY . /python_fcl
RUN pip wheel /python_fcl --no-deps -w wheelhouse/
RUN pip install python_fcl --no-index -f /wheelhouse
RUN ls /wheelhouse
RUN auditwheel repair wheelhouse/python_fcl-0.7.0-cp39-cp39-linux_x86_64.whl -w /wheelhouse
44 changes: 44 additions & 0 deletions build_dependencies/install_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# exit immediately on any failed step
set -xe

mkdir -p deps
cd deps

curl -OL https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz
tar -zxf eigen-3.3.9.tar.gz

rm -rf libccd
git clone --depth 1 --branch v2.1 https://github.com/danfis/libccd.git

rm -rf octomap
git clone --depth 1 --branch v1.9.8 https://github.com/OctoMap/octomap.git

rm -rf fcl
git clone --depth 1 --branch v0.7.0 https://github.com/ambi-robotics/fcl.git

# Install eigen
cmake -B build -S eigen-3.3.9
cmake --install build

# Build and install libccd
cd libccd
cmake . -D ENABLE_DOUBLE_PRECISION=ON
make -j4
make install
cd ..

# Build and install octomap
cd octomap
cmake . -D CMAKE_BUILD_TYPE=Release -D BUILD_OCTOVIS_SUBPROJECT=OFF -D BUILD_DYNAMICETD3D_SUBPROJECT=OFF
make -j4
make install
cd ..

# Build and install fcl
cd fcl
cmake .
make -j4
make install
cd ..

cd ..
20 changes: 20 additions & 0 deletions build_dependencies/install_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# prevent brew from auto cleanup
export HOMEBREW_NO_INSTALL_CLEANUP=1

brew install fcl

# mkdir -p deps
# cd deps
# # Octomap
# git clone https://github.com/OctoMap/octomap
# cd octomap
# git checkout tags/v1.8.0
# mkdir build
# cd build
# cmake ..
# make
# sudo make install

# cd ..
# cd ..
# cd ..
Loading