Skip to content

Commit e4287b2

Browse files
committed
refactor: Merged some duplicated parts, docu and build scripts
1 parent d47fd7d commit e4287b2

27 files changed

+523
-423
lines changed

.ci/Dockerfile.focal

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,34 @@ RUN apt-get update \
2626
&& apt-get install -y \
2727
bash-completion \
2828
build-essential \
29+
cmake \
2930
clang-6.0 \
3031
clang-format-6.0 \
3132
clang-tidy-6.0 \
32-
cmake \
33+
curl \
3334
doxygen \
35+
dpkg \
36+
git \
3437
graphviz \
3538
lcov \
3639
libeigen3-dev \
3740
libpoco-dev \
38-
rename \
39-
valgrind \
4041
lsb-release \
41-
dpkg \
42-
git \
4342
libeigen3-dev \
4443
libpoco-dev \
4544
libfmt-dev \
46-
python3-dev \
47-
python3-pip \
45+
liburdfdom-headers-dev \
46+
libconsole-bridge-dev \
4847
libtinyxml2-dev \
4948
lsb-release \
50-
curl \
49+
python3-dev \
50+
python3-pip \
51+
python3-venv \
52+
python3-distutils \
53+
python3-numpy \
54+
pybind11-dev \
55+
rename \
56+
valgrind \
5157
wget \
5258
&& apt-get clean -y \
5359
&& rm -rf /var/lib/apt/lists/* \
@@ -118,5 +124,15 @@ RUN git clone --recursive --branch v3.11.1 https://github.com/nlohmann/json.git
118124
&& make install \
119125
&& cd ../.. \
120126
&& rm -rf json
127+
# Install Python wheel building tools
128+
RUN python3 -m pip install --upgrade pip setuptools wheel && \
129+
python3 -m pip install \
130+
auditwheel \
131+
build \
132+
cibuildwheel \
133+
twine \
134+
patchelf \
135+
flake8 \
136+
pybind11
121137

122138
USER $USERNAME

.ci/checkgithistory.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ if [ "$local_commit_hash" != "$public_commit_hash" ]; then
3232
exit 1
3333
else
3434
echo "Local and public commit hashes do match."
35-
fi
35+
fi

.devcontainer/Dockerfile

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,34 @@ RUN apt-get update \
2626
&& apt-get install -y \
2727
bash-completion \
2828
build-essential \
29+
cmake \
2930
clang-6.0 \
3031
clang-format-6.0 \
3132
clang-tidy-6.0 \
32-
cmake \
33+
curl \
3334
doxygen \
35+
dpkg \
36+
git \
3437
graphviz \
3538
lcov \
3639
libeigen3-dev \
3740
libpoco-dev \
38-
rename \
39-
valgrind \
4041
lsb-release \
41-
dpkg \
42-
git \
4342
libeigen3-dev \
4443
libpoco-dev \
4544
libfmt-dev \
46-
python3-dev \
47-
python3-pip \
4845
liburdfdom-headers-dev \
4946
libconsole-bridge-dev \
5047
libtinyxml2-dev \
5148
lsb-release \
52-
curl \
49+
python3-dev \
50+
python3-pip \
51+
python3-venv \
52+
python3-distutils \
53+
python3-numpy \
54+
pybind11-dev \
55+
rename \
56+
valgrind \
5357
wget \
5458
&& apt-get clean -y \
5559
&& rm -rf /var/lib/apt/lists/* \
@@ -66,11 +70,22 @@ RUN mkdir -p /etc/apt/keyrings && \
6670
apt-get clean -y && \
6771
rm -rf /var/lib/apt/lists/*
6872

73+
# Install Python wheel building tools
74+
RUN python3 -m pip install --upgrade pip setuptools wheel && \
75+
python3 -m pip install \
76+
auditwheel \
77+
build \
78+
cibuildwheel \
79+
twine \
80+
patchelf \
81+
flake8 \
82+
pybind11
83+
6984
# Set environment variables
7085
ENV PATH=/opt/openrobots/bin:$PATH \
7186
PKG_CONFIG_PATH=/opt/openrobots/lib/pkgconfig:$PKG_CONFIG_PATH \
7287
LD_LIBRARY_PATH=/opt/openrobots/lib:$LD_LIBRARY_PATH \
73-
PYTHONPATH=/opt/openrobots/lib/python3.10/site-packages:$PYTHONPATH \
88+
PYTHONPATH=~/.local/lib/python3.8/site-packages:/opt/openrobots/lib/python3.8/site-packages:$PYTHONPATH \
7489
CMAKE_PREFIX_PATH=/opt/openrobots/lib/cmake:$CMAKE_PREFIX_PATH
7590

7691
USER $USERNAME

.devcontainer/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ services:
2121
rtprio: 99
2222
rttime: -1
2323
memlock: 8428281856
24-

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,16 @@ install*/
77
.cache
88
.env
99
*.egg-info
10+
__pycache__/
11+
*.so
12+
*.dylib
13+
*.a
14+
*.lib
15+
*.exp
16+
*.def
17+
*.manifest
18+
*.res
19+
*.egg-info
20+
*.whl
21+
.mypy_cache/
22+
version_info.properties
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ repos:
3636
types_or: [c++, c, cuda]
3737
args: ["-style=file"]
3838

39-
# C++ linting with cpplint
40-
- repo: https://github.com/cpplint/cpplint
41-
rev: 1.6.1
42-
hooks:
43-
- id: cpplint
44-
args: ["--filter=-build/include_subdir,-runtime/references,-whitespace/line_length,-build/include_order,-build/include_what_you_use", "--linelength=100", "--extensions=cpp,h,hpp"]
45-
4639
# General hooks
4740
- repo: https://github.com/pre-commit/pre-commit-hooks
4841
rev: v4.4.0

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 0.16.0 - 2025-09-15
4+
5+
- Feat: Added pylibfranka - a python binding for libfranka
6+
37
## 0.15.3 - 2025-07-31
48

59
* Fix outdated Emika links

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ project(libfranka
1111

1212
option(BUILD_DOCUMENTATION "Build documentation" OFF)
1313
option(SKIP_CXX_BUILD "Skips the c++ build" OFF)
14+
option(GENERATE_PYLIBFRANKA "Generate the python bindings for libfranka" OFF)
1415
if(BUILD_DOCUMENTATION)
1516
add_subdirectory(doc)
1617

@@ -154,7 +155,9 @@ target_link_libraries(franka PUBLIC
154155
)
155156

156157
## Compile pylibfranka
157-
add_subdirectory(pylibfranka)
158+
if (GENERATE_PYLIBFRANKA)
159+
add_subdirectory(pylibfranka)
160+
endif()
158161

159162
## Installation
160163
include(GNUInstallDirs)

Jenkinsfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ pipeline {
6262
dir("build-debug.${env.DISTRO}") {
6363
sh '''
6464
cmake -DCMAKE_BUILD_TYPE=Debug -DSTRICT=ON -DBUILD_COVERAGE=OFF \
65-
-DBUILD_DOCUMENTATION=OFF -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON ..
65+
-DBUILD_DOCUMENTATION=OFF -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON \
66+
-DGENERATE_PYLIBFRANKA=ON ..
6667
make -j$(nproc)
6768
'''
6869
}
@@ -73,7 +74,8 @@ pipeline {
7374
dir("build-release.${env.DISTRO}") {
7475
sh '''
7576
cmake -DCMAKE_BUILD_TYPE=Release -DSTRICT=ON -DBUILD_COVERAGE=OFF \
76-
-DBUILD_DOCUMENTATION=ON -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON ..
77+
-DBUILD_DOCUMENTATION=ON -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON \
78+
-DGENERATE_PYLIBFRANKA=ON ..
7779
make -j$(nproc)
7880
'''
7981
}

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,29 @@ To run a sample program, navigate to the build folder and execute the following
121121
./examples/communication_test <robot-ip>
122122
```
123123

124+
### 5. Pylibfranka
125+
126+
Pylibfranka is a Python binding for libfranka, allowing you to control Franka robots using Python. It is included in the libfranka repository and can be built alongside libfranka. For more details, see `pylibfranka` and its [README](pylibfranka/README.md).
127+
128+
### 6. Development Information
129+
130+
If you actively contribute to this repository, you should install and set up pre-commit hooks:
131+
132+
```bash
133+
pip install pre-commit
134+
pre-commit install
135+
```
136+
137+
This will install pre-commit and set up the git hooks to automatically run checks before each commit. The hooks will help maintain code quality by running various checks like code formatting, linting, and other validations.
138+
139+
To manually run the pre-commit checks on all files:
140+
141+
```bash
142+
pre-commit run --all-files
143+
```
144+
145+
This will build the C++ extension and install the Python package.
146+
124147
## License
125148

126149
`libfranka` is licensed under the [Apache 2.0 license][apache-2.0].

0 commit comments

Comments
 (0)