franky-control 1.1.1__cp38-cp38-manylinux_2_28_x86_64.whl → 1.1.2__cp38-cp38-manylinux_2_28_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- franky/_franky.cpython-38-x86_64-linux-gnu.so +0 -0
- {franky_control-1.1.1.dist-info → franky_control-1.1.2.dist-info}/METADATA +103 -103
- {franky_control-1.1.1.dist-info → franky_control-1.1.2.dist-info}/RECORD +11 -11
- franky_control.libs/{libPocoFoundation-f89fb772.so.95 → libPocoFoundation-55da614c.so.95} +0 -0
- franky_control.libs/{libPocoNet-a223dcdc.so.95 → libPocoNet-18bb01e7.so.95} +0 -0
- franky_control.libs/libfranka-ef91489b.so.0.15.3 +0 -0
- franky_control.libs/{libpinocchio_default-17c55e05.so.3.1.0 → libpinocchio_default-79007ccc.so.3.1.0} +0 -0
- franky_control.libs/{libpinocchio_parsers-f66a7fc8.so.3.1.0 → libpinocchio_parsers-75953cdd.so.3.1.0} +0 -0
- franky_control.libs/libfranka-92ddaf43.so.0.15.0 +0 -0
- {franky_control-1.1.1.dist-info → franky_control-1.1.2.dist-info}/LICENSE +0 -0
- {franky_control-1.1.1.dist-info → franky_control-1.1.2.dist-info}/WHEEL +0 -0
- {franky_control-1.1.1.dist-info → franky_control-1.1.2.dist-info}/top_level.txt +0 -0
Binary file
|
@@ -1,12 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: franky-control
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.2
|
4
4
|
Summary: High-level control library for Franka robots.
|
5
5
|
Home-page: https://github.com/TimSchneider42/franky
|
6
6
|
Author: Tim Schneider
|
7
7
|
Author-email: tim@robot-learning.de
|
8
8
|
License: LGPL-3.0-or-later
|
9
|
-
Keywords:
|
9
|
+
Keywords: control,robotics,franka,franka-panda,franka-research-3
|
10
10
|
Classifier: Development Status :: 4 - Beta
|
11
11
|
Classifier: Intended Audience :: Science/Research
|
12
12
|
Classifier: Topic :: Scientific/Engineering
|
@@ -44,17 +44,17 @@ Requires-Dist: numpy
|
|
44
44
|
</a>
|
45
45
|
</p>
|
46
46
|
|
47
|
-
|
48
|
-
By providing a high-level control interface,
|
47
|
+
franky is a high-level control library for Franka robots, offering Python and C++ support.
|
48
|
+
By providing a high-level control interface, franky eliminates the need for strict real-time programming at 1 kHz,
|
49
49
|
making control from non-real-time environments, such as Python programs, feasible.
|
50
|
-
Instead of relying on low-level control commands,
|
50
|
+
Instead of relying on low-level control commands, franky expects high-level position or velocity targets and
|
51
51
|
uses [Ruckig](https://github.com/pantor/ruckig) to plan time-optimal trajectories in real-time.
|
52
52
|
|
53
|
-
Although Python does not provide real-time guarantees,
|
54
|
-
Motions can be preempted at any moment, prompting
|
55
|
-
To handle unforeseen situations—such as unexpected contact with the environment —
|
56
|
-
allows
|
57
|
-
Furthermore, most non-real-time functionality of [libfranka](https://
|
53
|
+
Although Python does not provide real-time guarantees, franky strives to maintain as much real-time control as possible.
|
54
|
+
Motions can be preempted at any moment, prompting franky to re-plan trajectories on the fly.
|
55
|
+
To handle unforeseen situations—such as unexpected contact with the environment — franky includes a reaction system that
|
56
|
+
allows for updating motion commands dynamically.
|
57
|
+
Furthermore, most non-real-time functionality of [libfranka](https://frankarobotics.github.io/docs/libfranka.html), such as
|
58
58
|
Gripper control is made directly available in Python.
|
59
59
|
|
60
60
|
Check out the [tutorial](#-tutorial) and the [examples](https://github.com/TimSchneider42/franky/tree/master/examples)
|
@@ -68,13 +68,13 @@ at [https://timschneider42.github.io/franky/](https://timschneider42.github.io/f
|
|
68
68
|
No more endless hours setting up ROS, juggling packages, or untangling dependencies. Just `pip install` — no ROS at all.
|
69
69
|
|
70
70
|
- **[Four control modes](#motion-types)**: [Cartesian position](#cartesian-position-control), [Cartesian velocity](#cartesian-velocity-control), [Joint position](#joint-position-control), [Joint velocity](#joint-velocity-control)
|
71
|
-
|
71
|
+
franky uses [Ruckig](https://github.com/pantor/ruckig) to generate smooth, time-optimal trajectories while respecting velocity, acceleration, and jerk limits.
|
72
72
|
|
73
73
|
- **[Real-time control from Python and C++](#real-time-motions)**
|
74
|
-
Need to change the target while the robot’s moving? No problem.
|
74
|
+
Need to change the target while the robot’s moving? No problem. franky replans trajectories on the fly so that you can preempt motions anytime.
|
75
75
|
|
76
76
|
- **[Reactive behavior](#-real-time-reactions)**
|
77
|
-
Robots don’t always go according to plan.
|
77
|
+
Robots don’t always go according to plan. franky lets you define reactions to unexpected events—like contact with the environment — so you can change course in real-time.
|
78
78
|
|
79
79
|
- **[Motion and reaction callbacks](#motion-callbacks)**
|
80
80
|
Want to monitor what’s happening under the hood? Add callbacks to your motions and reactions. They won’t block the control thread and are super handy for debugging or logging.
|
@@ -83,17 +83,17 @@ at [https://timschneider42.github.io/franky/](https://timschneider42.github.io/f
|
|
83
83
|
Adjust max velocity, acceleration, and jerk to match your setup or task. Fine control for smooth, safe operation.
|
84
84
|
|
85
85
|
- **Full Python access to the libfranka API**
|
86
|
-
Want to tweak impedance, read the robot state, set force thresholds, or mess with the Jacobian? Go for it. If libfranka supports it, chances are
|
86
|
+
Want to tweak impedance, read the robot state, set force thresholds, or mess with the Jacobian? Go for it. If libfranka supports it, chances are franky does, too.
|
87
87
|
|
88
88
|
## 📖 Python Quickstart Guide
|
89
89
|
|
90
|
-
Real-time kernel already installed and real-time permissions granted? Just install
|
90
|
+
Real-time kernel already installed and real-time permissions granted? Just install franky via
|
91
91
|
|
92
92
|
```bash
|
93
93
|
pip install franky-control
|
94
94
|
```
|
95
95
|
|
96
|
-
|
96
|
+
Otherwise, follow the [setup instructions](#setup) first.
|
97
97
|
|
98
98
|
Now we are already ready to go!
|
99
99
|
Unlock the brakes in the web interface, activate FCI, and start coding:
|
@@ -101,7 +101,7 @@ Unlock the brakes in the web interface, activate FCI, and start coding:
|
|
101
101
|
```python
|
102
102
|
from franky import *
|
103
103
|
|
104
|
-
robot = Robot("
|
104
|
+
robot = Robot("10.90.90.1") # Replace this with your robot's IP
|
105
105
|
|
106
106
|
# Let's start slow (this lets the robot use a maximum of 5% of its velocity, acceleration, and jerk limits)
|
107
107
|
robot.relative_dynamics_factor = 0.05
|
@@ -115,20 +115,20 @@ If you are seeing server version mismatch errors, such as
|
|
115
115
|
```
|
116
116
|
franky.IncompatibleVersionException: libfranka: Incompatible library version (server version: 5, library version: 9)
|
117
117
|
```
|
118
|
-
then your Franka robot is either not on the most recent firmware version or you are using the older Franka Panda model.
|
119
|
-
In any case, it's no big deal; just check [here](https://
|
118
|
+
then your Franka robot is either not on the most recent firmware version, or you are using the older Franka Panda model.
|
119
|
+
In any case, it's no big deal; just check [here](https://frankarobotics.github.io/docs/compatibility.html) which libfranka version you need and follow our [instructions](installing-franky) to install the appropriate franky wheels.
|
120
120
|
|
121
121
|
## <a id="setup" /> ⚙️ Setup
|
122
122
|
|
123
|
-
To install
|
123
|
+
To install franky, you have to follow three steps:
|
124
124
|
|
125
|
-
1. Ensure that you are using a
|
125
|
+
1. Ensure that you are using a real-time kernel
|
126
126
|
2. Ensure that the executing user has permission to run real-time applications
|
127
|
-
3. Install
|
127
|
+
3. Install franky via pip or build it from source
|
128
128
|
|
129
129
|
### Installing a real-time kernel
|
130
130
|
|
131
|
-
In order for Franky to function properly, it requires the underlying OS to use a
|
131
|
+
In order for Franky to function properly, it requires the underlying OS to use a real-time kernel.
|
132
132
|
Otherwise, you might see `communication_constrains_violation` errors.
|
133
133
|
|
134
134
|
To check whether your system is currently using a real-time kernel, type `uname -a`.
|
@@ -143,12 +143,12 @@ If it does not say PREEMPT_RT, you are not currently running a real-time kernel.
|
|
143
143
|
|
144
144
|
There are multiple ways of installing a real-time kernel.
|
145
145
|
You
|
146
|
-
can [build it from source](https://
|
146
|
+
can [build it from source](https://frankarobotics.github.io/docs/installation_linux.html#setting-up-the-real-time-kernel)
|
147
147
|
or, if you are using Ubuntu, it can be [enabled through Ubuntu Pro](https://ubuntu.com/real-time).
|
148
148
|
|
149
149
|
### Allowing the executing user to run real-time applications
|
150
150
|
|
151
|
-
First, create a group `realtime` and add your user (or whoever is running
|
151
|
+
First, create a group `realtime` and add your user (or whoever is running franky) to this group:
|
152
152
|
|
153
153
|
```bash
|
154
154
|
sudo addgroup realtime
|
@@ -175,18 +175,18 @@ $ groups
|
|
175
175
|
... realtime
|
176
176
|
```
|
177
177
|
|
178
|
-
If
|
178
|
+
If real-time is not listed in your groups, try rebooting.
|
179
179
|
|
180
|
-
### Installing
|
180
|
+
### Installing franky
|
181
181
|
|
182
|
-
To start using
|
182
|
+
To start using franky with Python and libfranka *0.16.0*, just install it via
|
183
183
|
|
184
184
|
```bash
|
185
185
|
pip install franky-control
|
186
186
|
```
|
187
187
|
|
188
188
|
We also provide wheels for libfranka versions *0.7.1*, *0.8.0*, *0.9.2*, *0.10.0*, *0.11.0*, *0.12.1*, *0.13.3*,
|
189
|
-
*0.14.2*, and *0.
|
189
|
+
*0.14.2*, *0.15.3*, and *0.16.0*.
|
190
190
|
They can be installed via
|
191
191
|
|
192
192
|
```bash
|
@@ -199,7 +199,7 @@ pip install --no-index --find-links=./dist franky-control
|
|
199
199
|
|
200
200
|
### Using Docker
|
201
201
|
|
202
|
-
To use
|
202
|
+
To use franky within Docker we provide a [Dockerfile](docker/run/Dockerfile) and
|
203
203
|
accompanying [docker-compose](docker-compose.yml) file.
|
204
204
|
|
205
205
|
```bash
|
@@ -208,7 +208,7 @@ cd franky/
|
|
208
208
|
docker compose build franky-run
|
209
209
|
```
|
210
210
|
|
211
|
-
To use another version of libfranka than the default (0.
|
211
|
+
To use another version of libfranka than the default (0.16.0), add a build argument:
|
212
212
|
|
213
213
|
```bash
|
214
214
|
docker compose build franky-run --build-arg LIBFRANKA_VERSION=0.9.2
|
@@ -220,15 +220,15 @@ To run the container:
|
|
220
220
|
docker compose run franky-run bash
|
221
221
|
```
|
222
222
|
|
223
|
-
The container requires access to the host
|
223
|
+
The container requires access to the host machine's network *and* elevated user rights to allow the Docker user to set RT
|
224
224
|
capabilities of the processes run from within it.
|
225
225
|
|
226
|
-
### Can I use CUDA jointly with
|
226
|
+
### Can I use CUDA jointly with franky?
|
227
227
|
|
228
228
|
Yes. However, you need to set `IGNORE_PREEMPT_RT_PRESENCE=1` during the installation and all subsequent updates of the CUDA drivers on the real-time kernel.
|
229
229
|
|
230
230
|
First, make sure that you have rebooted your system after installing the real-time kernel.
|
231
|
-
Then, add `IGNORE_PREEMPT_RT_PRESENCE=1` to `/etc/environment`, call `export IGNORE_PREEMPT_RT_PRESENCE=1` to also set it in the current session and follow the instructions of Nvidia to install CUDA on your system.
|
231
|
+
Then, add `IGNORE_PREEMPT_RT_PRESENCE=1` to `/etc/environment`, call `export IGNORE_PREEMPT_RT_PRESENCE=1` to also set it in the current session, and follow the instructions of Nvidia to install CUDA on your system.
|
232
232
|
|
233
233
|
If you are on Ubuntu, you can also use [this](tools/install_cuda_realtime.bash) script to install CUDA on your real-time system:
|
234
234
|
```bash
|
@@ -249,15 +249,15 @@ Alternatively, if you are a cowboy and do not care about security, you can also
|
|
249
249
|
bash <(wget -qO- https://raw.githubusercontent.com/timschneider42/franky/master/tools/install_cuda_realtime.bash)
|
250
250
|
```
|
251
251
|
|
252
|
-
### Building
|
252
|
+
### Building franky
|
253
253
|
|
254
|
-
|
254
|
+
franky is based on [libfranka](https://github.com/frankarobotics/libfranka), [Eigen](https://eigen.tuxfamily.org) for
|
255
255
|
transformation calculations and [pybind11](https://github.com/pybind/pybind11) for the Python bindings.
|
256
256
|
As the Franka is sensitive to acceleration discontinuities, it requires jerk-constrained motion generation, for which
|
257
|
-
|
257
|
+
franky uses the [Ruckig](https://ruckig.com) community version for Online Trajectory Generation (OTG).
|
258
258
|
|
259
259
|
After installing the dependencies (the exact versions can be found [here](#-development)), you can build and install
|
260
|
-
|
260
|
+
franky via
|
261
261
|
|
262
262
|
```bash
|
263
263
|
git clone --recurse-submodules git@github.com:timschneider42/franky.git
|
@@ -269,10 +269,10 @@ make
|
|
269
269
|
make install
|
270
270
|
```
|
271
271
|
|
272
|
-
To use
|
272
|
+
To use franky, you can also include it as a subproject in your parent CMake via `add_subdirectory(franky)` and then
|
273
273
|
`target_link_libraries(<target> franky)`.
|
274
274
|
|
275
|
-
If you need only the Python module, you can install
|
275
|
+
If you need only the Python module, you can install franky via
|
276
276
|
|
277
277
|
```bash
|
278
278
|
pip install .
|
@@ -281,9 +281,9 @@ pip install .
|
|
281
281
|
Make sure that the built library `_franky.cpython-3**-****-linux-gnu.so` is in the Python path, e.g. by adjusting
|
282
282
|
`PYTHONPATH` accordingly.
|
283
283
|
|
284
|
-
#### Building
|
284
|
+
#### Building franky with Docker
|
285
285
|
|
286
|
-
For building
|
286
|
+
For building franky and its wheels, we provide another Docker container that can also be launched using docker-compose:
|
287
287
|
|
288
288
|
```bash
|
289
289
|
docker compose build franky-build
|
@@ -293,7 +293,7 @@ docker compose run --rm franky-build build-wheels # To build wheels for all sup
|
|
293
293
|
|
294
294
|
## 📚 Tutorial
|
295
295
|
|
296
|
-
|
296
|
+
franky comes with both a C++ and Python API that differ only regarding real-time capability.
|
297
297
|
We will introduce both languages next to each other.
|
298
298
|
In your C++ project, just include `include <franky.hpp>` and link the library.
|
299
299
|
For Python, just `import franky`.
|
@@ -304,7 +304,7 @@ As a first example, only four lines of code are needed for simple robotic motion
|
|
304
304
|
using namespace franky;
|
305
305
|
|
306
306
|
// Connect to the robot with the FCI IP address
|
307
|
-
Robot robot("
|
307
|
+
Robot robot("10.90.90.1");
|
308
308
|
|
309
309
|
// Reduce velocity and acceleration of the robot
|
310
310
|
robot.setRelativeDynamicsFactor(0.05);
|
@@ -321,7 +321,7 @@ The corresponding program in Python is
|
|
321
321
|
```python
|
322
322
|
from franky import Affine, CartesianMotion, Robot, ReferenceType
|
323
323
|
|
324
|
-
robot = Robot("
|
324
|
+
robot = Robot("10.90.90.1")
|
325
325
|
robot.relative_dynamics_factor = 0.05
|
326
326
|
|
327
327
|
motion = CartesianMotion(Affine([0.2, 0.0, 0.0]), ReferenceType.Relative)
|
@@ -331,7 +331,7 @@ robot.move(motion)
|
|
331
331
|
Before executing any code, make sure that you have enabled the Franka Control Interface (FCI) in the Franka UI web interface.
|
332
332
|
|
333
333
|
Furthermore, we will introduce methods for geometric calculations, for moving the robot according to different motion
|
334
|
-
types, how to implement real-time reactions and changing waypoints in real time as well as controlling the gripper.
|
334
|
+
types, how to implement real-time reactions and changing waypoints in real time, as well as controlling the gripper.
|
335
335
|
|
336
336
|
### 🧮 Geometry
|
337
337
|
|
@@ -356,18 +356,18 @@ In all cases, distances are in [m] and rotations in [rad].
|
|
356
356
|
|
357
357
|
### 🤖 Robot
|
358
358
|
|
359
|
-
|
360
|
-
Moreover, we added methods to adapt the
|
359
|
+
franky exposes most of the libfanka API for Python.
|
360
|
+
Moreover, we added methods to adapt the dynamic limits of the robot for all motions.
|
361
361
|
|
362
362
|
```python
|
363
363
|
from franky import *
|
364
364
|
|
365
|
-
robot = Robot("
|
365
|
+
robot = Robot("10.90.90.1")
|
366
366
|
|
367
367
|
# Recover from errors
|
368
368
|
robot.recover_from_errors()
|
369
369
|
|
370
|
-
# Set velocity, acceleration and jerk to 5% of the maximum
|
370
|
+
# Set velocity, acceleration, and jerk to 5% of the maximum
|
371
371
|
robot.relative_dynamics_factor = 0.05
|
372
372
|
|
373
373
|
# Alternatively, you can define each constraint individually
|
@@ -375,7 +375,7 @@ robot.relative_dynamics_factor = RelativeDynamicsFactor(
|
|
375
375
|
velocity=0.1, acceleration=0.05, jerk=0.1
|
376
376
|
)
|
377
377
|
|
378
|
-
# Or, for more
|
378
|
+
# Or, for more fine-grained access, set individual limits
|
379
379
|
robot.translation_velocity_limit.set(3.0)
|
380
380
|
robot.rotation_velocity_limit.set(2.5)
|
381
381
|
robot.elbow_velocity_limit.set(2.62)
|
@@ -399,21 +399,21 @@ print(robot.joint_jerk_limit.max)
|
|
399
399
|
The robot state can be retrieved by accessing the following properties:
|
400
400
|
|
401
401
|
* `state`: Object of type `franky.RobotState`, which extends the
|
402
|
-
libfranka [franka::RobotState](https://
|
402
|
+
libfranka [franka::RobotState](https://frankarobotics.github.io/libfranka/0.15.3/structfranka_1_1RobotState.html) structure by
|
403
403
|
additional state elements.
|
404
404
|
* `current_cartesian_state`: Object of type `franky.CartesianState`, which contains the end-effector pose and velocity
|
405
405
|
obtained
|
406
|
-
from [franka::RobotState::O_T_EE](https://
|
407
|
-
and [franka::RobotState::O_dP_EE_c](https://
|
406
|
+
from [franka::RobotState::O_T_EE](https://frankarobotics.github.io/libfranka/0.15.3/structfranka_1_1RobotState.html#a193781d47722b32925e0ea7ac415f442)
|
407
|
+
and [franka::RobotState::O_dP_EE_c](https://frankarobotics.github.io/libfranka/0.15.3/structfranka_1_1RobotState.html#a4be112bd1a9a7d777a67aea4a18a8dcc).
|
408
408
|
* `current_joint_state`: Object of type `franky.JointState`, which contains the joint positions and velocities
|
409
409
|
obtained
|
410
|
-
from [franka::RobotState::q](https://
|
411
|
-
and [franka::RobotState::dq](https://
|
410
|
+
from [franka::RobotState::q](https://frankarobotics.github.io/libfranka/0.15.3/structfranka_1_1RobotState.html#ade3335d1ac2f6c44741a916d565f7091)
|
411
|
+
and [franka::RobotState::dq](https://frankarobotics.github.io/libfranka/0.15.3/structfranka_1_1RobotState.html#a706045af1b176049e9e56df755325bd2).
|
412
412
|
|
413
413
|
```python
|
414
414
|
from franky import *
|
415
415
|
|
416
|
-
robot = Robot("
|
416
|
+
robot = Robot("10.90.90.1")
|
417
417
|
|
418
418
|
# Get the current state as `franky.RobotState`. See the documentation for a list of fields.
|
419
419
|
state = robot.state
|
@@ -438,10 +438,10 @@ f_t_ee = Affine()
|
|
438
438
|
ee_t_k = Affine()
|
439
439
|
ee_pose_kin = robot.model.pose(Frame.EndEffector, q, f_t_ee, ee_t_k)
|
440
440
|
|
441
|
-
# Get the
|
441
|
+
# Get the Jacobian of the current robot state
|
442
442
|
jacobian = robot.model.body_jacobian(Frame.EndEffector, state)
|
443
443
|
|
444
|
-
# Alternatively, just get the URDF as string and do the kinematics computation yourself (only
|
444
|
+
# Alternatively, just get the URDF as a string and do the kinematics computation yourself (only
|
445
445
|
# for libfranka >= 0.15.0)
|
446
446
|
urdf_model = robot.model_urdf
|
447
447
|
```
|
@@ -452,10 +452,10 @@ and [Model](https://timschneider42.github.io/franky/classfranky_1_1_model.html)
|
|
452
452
|
|
453
453
|
### <a id="motion-types" /> 🏃♂️ Motion Types
|
454
454
|
|
455
|
-
|
455
|
+
franky currently supports four different impedance control modes: **joint position control**, **joint velocity control**, **cartesian position control**, and **cartesian velocity control**.
|
456
456
|
Each of these control modes is invoked by passing the robot an appropriate _Motion_ object.
|
457
457
|
|
458
|
-
In the following, we provide a brief example for each motion type implemented by
|
458
|
+
In the following, we provide a brief example for each motion type implemented by franky in Python.
|
459
459
|
The C++ interface is generally analogous, though some variable and method names are different because we
|
460
460
|
follow [PEP 8](https://peps.python.org/pep-0008/) naming conventions in Python
|
461
461
|
and [Google naming conventions](https://google.github.io/styleguide/cppguide.html) in C++.
|
@@ -481,7 +481,7 @@ m_jp2 = JointWaypointMotion(
|
|
481
481
|
]
|
482
482
|
)
|
483
483
|
|
484
|
-
# Intermediate waypoints also permit
|
484
|
+
# Intermediate waypoints also permit specifying target velocities. The default target velocity
|
485
485
|
# is 0, meaning that the robot will stop at every waypoint.
|
486
486
|
m_jp3 = JointWaypointMotion(
|
487
487
|
[
|
@@ -496,8 +496,8 @@ m_jp3 = JointWaypointMotion(
|
|
496
496
|
]
|
497
497
|
)
|
498
498
|
|
499
|
-
# Stop the robot in joint position control mode. The difference
|
500
|
-
# stop-motions such as CartesianStopMotion is that JointStopMotion stops the robot in joint
|
499
|
+
# Stop the robot in joint position control mode. The difference between JointStopMotion to other
|
500
|
+
# stop-motions, such as CartesianStopMotion, is that JointStopMotion stops the robot in joint
|
501
501
|
# position control mode while CartesianStopMotion stops it in cartesian pose control mode. The
|
502
502
|
# difference becomes relevant when asynchronous move commands are being sent or reactions are
|
503
503
|
# being used(see below).
|
@@ -509,7 +509,7 @@ m_jp4 = JointStopMotion()
|
|
509
509
|
```python
|
510
510
|
from franky import *
|
511
511
|
|
512
|
-
# Accelerate to the given joint velocity and hold it. After 1000ms stop the robot again.
|
512
|
+
# Accelerate to the given joint velocity and hold it. After 1000ms, stop the robot again.
|
513
513
|
m_jv1 = JointVelocityMotion(
|
514
514
|
[0.1, 0.3, -0.1, 0.0, 0.1, -0.2, 0.4], duration=Duration(1000)
|
515
515
|
)
|
@@ -555,7 +555,7 @@ m_cp2 = CartesianMotion(
|
|
555
555
|
RobotPose(Affine([0.4, -0.2, 0.3], quat), elbow_state=ElbowState(0.3))
|
556
556
|
)
|
557
557
|
|
558
|
-
# A linear motion in
|
558
|
+
# A linear motion in Cartesian space relative to the initial position
|
559
559
|
# (Note that this motion is relative both in position and orientation. Hence, when the robot's
|
560
560
|
# end-effector is oriented differently, it will move in a different direction)
|
561
561
|
m_cp3 = CartesianMotion(Affine([0.2, 0.0, 0.0]), ReferenceType.Relative)
|
@@ -577,7 +577,7 @@ m_cp4 = CartesianWaypointMotion(
|
|
577
577
|
]
|
578
578
|
)
|
579
579
|
|
580
|
-
# Cartesian waypoints permit
|
580
|
+
# Cartesian waypoints permit specifying target velocities
|
581
581
|
m_cp5 = CartesianWaypointMotion(
|
582
582
|
[
|
583
583
|
CartesianWaypoint(Affine([0.5, -0.2, 0.3], quat)),
|
@@ -590,7 +590,7 @@ m_cp5 = CartesianWaypointMotion(
|
|
590
590
|
]
|
591
591
|
)
|
592
592
|
|
593
|
-
# Stop the robot in
|
593
|
+
# Stop the robot in Cartesian position control mode.
|
594
594
|
m_cp6 = CartesianStopMotion()
|
595
595
|
```
|
596
596
|
|
@@ -599,7 +599,7 @@ m_cp6 = CartesianStopMotion()
|
|
599
599
|
```python
|
600
600
|
from franky import *
|
601
601
|
|
602
|
-
# A
|
602
|
+
# A Cartesian velocity motion with linear (first argument) and angular (second argument)
|
603
603
|
# components
|
604
604
|
m_cv1 = CartesianVelocityMotion(Twist([0.2, -0.1, 0.1], [0.1, -0.1, 0.2]))
|
605
605
|
|
@@ -608,8 +608,8 @@ m_cv2 = CartesianVelocityMotion(
|
|
608
608
|
RobotVelocity(Twist([0.2, -0.1, 0.1], [0.1, -0.1, 0.2]), elbow_velocity=-0.2)
|
609
609
|
)
|
610
610
|
|
611
|
-
# Cartesian velocity motions also support multiple waypoints. Unlike in
|
612
|
-
# control, a
|
611
|
+
# Cartesian velocity motions also support multiple waypoints. Unlike in Cartesian position
|
612
|
+
# control, a Cartesian velocity waypoint is a target velocity to be reached. This particular
|
613
613
|
# example first accelerates the end-effector, holds the velocity for 1s, then reverses
|
614
614
|
# direction for 2s, reverses direction again for 1s, and finally stops. It is important not to
|
615
615
|
# forget to stop the robot at the end of such a sequence, as it will otherwise throw an error.
|
@@ -631,25 +631,25 @@ m_cv4 = CartesianVelocityWaypointMotion(
|
|
631
631
|
]
|
632
632
|
)
|
633
633
|
|
634
|
-
# Stop the robot in
|
634
|
+
# Stop the robot in Cartesian velocity control mode.
|
635
635
|
m_cv6 = CartesianVelocityStopMotion()
|
636
636
|
```
|
637
637
|
|
638
638
|
#### Relative Dynamics Factors
|
639
639
|
|
640
|
-
Every motion and waypoint type allows
|
640
|
+
Every motion and waypoint type allows for adapting the dynamics (velocity, acceleration, and jerk) by setting the respective
|
641
641
|
`relative_dynamics_factor` parameter.
|
642
|
-
This parameter can also be set for the robot globally as shown below or in the `robot.move` command.
|
642
|
+
This parameter can also be set for the robot globally, as shown below, or in the `robot.move` command.
|
643
643
|
Crucially, relative dynamics factors on different layers (robot, move command, and motion) do not override each other
|
644
644
|
but rather get multiplied.
|
645
645
|
Hence, a relative dynamics factor on a motion can only reduce the dynamics of the robot and never increase them.
|
646
646
|
|
647
|
-
There is one exception to this rule and that is if any layer sets the relative dynamics factor to
|
647
|
+
There is one exception to this rule, and that is if any layer sets the relative dynamics factor to
|
648
648
|
`RelativeDynamicsFactor.MAX_DYNAMICS`.
|
649
649
|
This will cause the motion to be executed with maximum velocity, acceleration, and jerk limits, independently of the
|
650
650
|
relative dynamics factors of the other layers.
|
651
|
-
This feature should only be used to abruptly stop the robot in case of an unexpected environment contact as executing
|
652
|
-
|
651
|
+
This feature should only be used to abruptly stop the robot in case of an unexpected environment contact, as executing
|
652
|
+
Other motions with it are likely to lead to a discontinuity error and might be dangerous.
|
653
653
|
|
654
654
|
#### Executing Motions
|
655
655
|
|
@@ -665,7 +665,7 @@ robot.relative_dynamics_factor = RelativeDynamicsFactor(0.05, 0.1, 0.15)
|
|
665
665
|
|
666
666
|
robot.move(m_jp1)
|
667
667
|
|
668
|
-
# We can also set a relative dynamics factor in the move command. It will be multiplied
|
668
|
+
# We can also set a relative dynamics factor in the move command. It will be multiplied by
|
669
669
|
# the other relative dynamics factors (robot and motion if present).
|
670
670
|
robot.move(m_jp2, relative_dynamics_factor=0.8)
|
671
671
|
```
|
@@ -692,7 +692,7 @@ robot.move(m_jp1)
|
|
692
692
|
|
693
693
|
Note that in Python, these callbacks are not executed in the control thread since they would otherwise block it.
|
694
694
|
Instead, they are put in a queue and executed by another thread.
|
695
|
-
While this scheme ensures that the control thread can always run, it cannot prevent
|
695
|
+
While this scheme ensures that the control thread can always run, it cannot prevent the queue from growing indefinitely
|
696
696
|
when the callbacks take more time to execute than it takes for new callbacks to be queued.
|
697
697
|
Hence, callbacks might be executed significantly after they were queued if they take a long time to execute.
|
698
698
|
|
@@ -709,11 +709,11 @@ motion = CartesianMotion(Affine([0.0, 0.0, 0.1]), ReferenceType.Relative) # Mov
|
|
709
709
|
|
710
710
|
# It is important that the reaction motion uses the same control mode as the original motion.
|
711
711
|
# Hence, we cannot register a JointMotion as a reaction motion to a CartesianMotion.
|
712
|
-
# Move up
|
713
|
-
reaction_motion = CartesianMotion(Affine([0.0, 0.0, 0.01]), ReferenceType.Relative)
|
712
|
+
# Move up by 1cm
|
713
|
+
reaction_motion = CartesianMotion(Affine([0.0, 0.0, -0.01]), ReferenceType.Relative)
|
714
714
|
|
715
715
|
# Trigger reaction if the Z force is greater than 30N
|
716
|
-
reaction = Reaction(Measure.FORCE_Z >
|
716
|
+
reaction = Reaction(Measure.FORCE_Z > 5.0, reaction_motion)
|
717
717
|
motion.add_reaction(reaction)
|
718
718
|
|
719
719
|
robot.move(motion)
|
@@ -770,7 +770,7 @@ with lower priority to ensure that the control thread does not get blocked.
|
|
770
770
|
Thus, the callbacks might fire substantially after the reaction has fired, depending on the time it takes to execute
|
771
771
|
them.
|
772
772
|
|
773
|
-
In C
|
773
|
+
In C++, you can additionally use lambdas to define more complex behaviours:
|
774
774
|
|
775
775
|
```c++
|
776
776
|
auto motion = CartesianMotion(
|
@@ -812,20 +812,20 @@ Instead, it returns immediately and, thus, allows the main thread to set new mot
|
|
812
812
|
import time
|
813
813
|
from franky import Affine, CartesianMotion, Robot, ReferenceType
|
814
814
|
|
815
|
-
robot = Robot("
|
815
|
+
robot = Robot("10.90.90.1")
|
816
816
|
robot.relative_dynamics_factor = 0.05
|
817
817
|
|
818
818
|
motion1 = CartesianMotion(Affine([0.2, 0.0, 0.0]), ReferenceType.Relative)
|
819
819
|
robot.move(motion1, asynchronous=True)
|
820
820
|
|
821
821
|
time.sleep(0.5)
|
822
|
-
# Note that similar to reactions, when preempting active motions with new motions, the
|
822
|
+
# Note that, similar to reactions, when preempting active motions with new motions, the
|
823
823
|
# control mode cannot change. Hence, we cannot use, e.g., a JointMotion here.
|
824
824
|
motion2 = CartesianMotion(Affine([0.2, 0.0, 0.0]), ReferenceType.Relative)
|
825
825
|
robot.move(motion2, asynchronous=True)
|
826
826
|
```
|
827
827
|
|
828
|
-
By calling `Robot.join_motion
|
828
|
+
By calling `Robot.join_motion`, the main thread can be synchronized with the motion thread, as it will block until the
|
829
829
|
robot finishes its motion.
|
830
830
|
|
831
831
|
```python
|
@@ -834,21 +834,21 @@ robot.join_motion()
|
|
834
834
|
|
835
835
|
Note that when exceptions occur during the asynchronous execution of a motion, they will not be thrown immediately.
|
836
836
|
Instead, the control thread stores the exception and terminates.
|
837
|
-
The next time `Robot.join_motion` or `Robot.move`
|
837
|
+
The next time `Robot.join_motion` or `Robot.move` is called, they will throw the stored exception in the main thread.
|
838
838
|
Hence, after an asynchronous motion has finished, make sure to call `Robot.join_motion` to ensure being notified of any
|
839
839
|
exceptions that occurred during the motion.
|
840
840
|
|
841
841
|
### <a id="gripper" /> 👌 Gripper
|
842
842
|
|
843
843
|
In the `franky::Gripper` class, the default gripper force and gripper speed can be set.
|
844
|
-
Then,
|
844
|
+
Then, in addition to the libfranka commands, the following helper methods can be used:
|
845
845
|
|
846
846
|
```c++
|
847
847
|
#include <franky.hpp>
|
848
848
|
#include <chrono>
|
849
849
|
#include <future>
|
850
850
|
|
851
|
-
auto gripper = franky::Gripper("
|
851
|
+
auto gripper = franky::Gripper("10.90.90.1");
|
852
852
|
|
853
853
|
double speed = 0.02; // [m/s]
|
854
854
|
double force = 20.0; // [N]
|
@@ -879,12 +879,12 @@ if (!success_future.wait_for(std::chrono::seconds(1)) == std::future_status::rea
|
|
879
879
|
}
|
880
880
|
```
|
881
881
|
|
882
|
-
The Python API follows the
|
882
|
+
The Python API follows the C++ API closely:
|
883
883
|
|
884
884
|
```python
|
885
885
|
import franky
|
886
886
|
|
887
|
-
gripper = franky.Gripper("
|
887
|
+
gripper = franky.Gripper("10.90.90.1")
|
888
888
|
|
889
889
|
speed = 0.02 # [m/s]
|
890
890
|
force = 20.0 # [N]
|
@@ -917,9 +917,9 @@ else:
|
|
917
917
|
|
918
918
|
For Franka robots, control happens via the Franka Control Interface (FCI), which has to be enabled through the Franka UI in the robot's web interface.
|
919
919
|
The Franka UI also provides methods for locking and unlocking the brakes, setting the execution mode, and executing the safety self-test.
|
920
|
-
However, sometimes you may want to access these methods programmatically, e.g
|
920
|
+
However, sometimes you may want to access these methods programmatically, e.g., for automatically unlocking the brakes before starting a motion, or automatically executing the self-test after 24h of continuous execution.
|
921
921
|
|
922
|
-
For that reason,
|
922
|
+
For that reason, franky provides a `RobotWebSession` class that allows you to access the web interface API of the robot.
|
923
923
|
Note that directly accessing the web interface API is not officially supported and documented by Franka.
|
924
924
|
Hence, use this feature at your own risk.
|
925
925
|
|
@@ -928,7 +928,7 @@ A typical automated workflow could look like this:
|
|
928
928
|
```python
|
929
929
|
import franky
|
930
930
|
|
931
|
-
with franky.RobotWebSession("
|
931
|
+
with franky.RobotWebSession("10.90.90.1", "username", "password") as robot_web_session:
|
932
932
|
# First take control
|
933
933
|
try:
|
934
934
|
# Try taking control. The session currently holding control has to release it in order
|
@@ -966,7 +966,7 @@ In case you are running the robot for longer than 24h you will have noticed that
|
|
966
966
|
import time
|
967
967
|
import franky
|
968
968
|
|
969
|
-
with franky.RobotWebSession("
|
969
|
+
with franky.RobotWebSession("10.90.90.1", "username", "password") as robot_web_session:
|
970
970
|
# Execute self-test if the time until self-test is less than 5 minutes.
|
971
971
|
if robot_web_session.get_system_status()["safety"]["timeToTd2"] < 300:
|
972
972
|
robot_web_session.disable_fci()
|
@@ -990,9 +990,9 @@ See [robot_web_session.py](franky/robot_web_session.py) for an example of how to
|
|
990
990
|
|
991
991
|
## 🛠️ Development
|
992
992
|
|
993
|
-
|
993
|
+
franky is currently tested against the following versions
|
994
994
|
|
995
|
-
- libfranka 0.7.1, 0.8.0, 0.9.2, 0.10.0, 0.11.0, 0.12.1, 0.13.3, 0.14.2, 0.15.0
|
995
|
+
- libfranka 0.7.1, 0.8.0, 0.9.2, 0.10.0, 0.11.0, 0.12.1, 0.13.3, 0.14.2, 0.15.3, 0.16.0
|
996
996
|
- Eigen 3.4.0
|
997
997
|
- Pybind11 2.13.6
|
998
998
|
- POCO 1.12.5p2
|
@@ -1003,20 +1003,20 @@ Franky is currently tested against following versions
|
|
1003
1003
|
## 📜 License
|
1004
1004
|
|
1005
1005
|
For non-commercial applications, this software is licensed under the LGPL v3.0.
|
1006
|
-
If you want to use
|
1006
|
+
If you want to use franky within commercial applications or under a different license, please contact us for individual
|
1007
1007
|
agreements.
|
1008
1008
|
|
1009
1009
|
## 🔍 Differences to frankx
|
1010
1010
|
|
1011
|
-
|
1011
|
+
franky started originally as a fork of [frankx](https://github.com/pantor/frankx), though both codebase and
|
1012
1012
|
functionality differ substantially from frankx by now.
|
1013
|
-
Aside
|
1013
|
+
Aside from bug fixes and general performance improvements, franky provides the following new features/improvements:
|
1014
1014
|
|
1015
1015
|
* [Motions can be updated asynchronously.](#-real-time-motions)
|
1016
1016
|
* [Reactions allow for the registration of callbacks instead of just printing to stdout when fired.](#-real-time-reactions)
|
1017
1017
|
* [Motions allow for the registration of callbacks for profiling.](#motion-callbacks)
|
1018
1018
|
* [The robot state is also available during control.](#robot-state)
|
1019
|
-
* A larger part of the libfranka API is exposed to python (e.g
|
1019
|
+
* A larger part of the libfranka API is exposed to python (e.g., `setCollisionBehavior`, `setJoinImpedance`, and
|
1020
1020
|
`setCartesianImpedance`).
|
1021
1021
|
* Cartesian motion generation handles boundaries in Euler angles properly.
|
1022
1022
|
* [There is a new joint motion type that supports waypoints.](#-motion-types)
|
@@ -1027,7 +1027,7 @@ Aside of bug fixes and general performance improvements, Franky provides the fol
|
|
1027
1027
|
* [The `Measure` class allows for arithmetic operations.](#-real-time-reactions)
|
1028
1028
|
* Exceptions caused by libfranka are raised properly instead of being printed to stdout.
|
1029
1029
|
* [We provide wheels for both Franka Research 3 and the older Franka Panda](#-setup)
|
1030
|
-
*
|
1030
|
+
* franky supports [joint velocity control](#joint-velocity-control)
|
1031
1031
|
and [cartesian velocity control](#cartesian-velocity-control)
|
1032
1032
|
* The dynamics limits are not hard-coded anymore but can be [set for each robot instance](#-robot).
|
1033
1033
|
|
@@ -1038,4 +1038,4 @@ Please run the [pre-commit](https://pre-commit.com/) hooks before submitting you
|
|
1038
1038
|
To install the pre-commit hooks, run:
|
1039
1039
|
|
1040
1040
|
1. [Install pre-commit](https://pre-commit.com/#install)
|
1041
|
-
2. Install the Git hooks by running `pre-commit install` or, alternatively, run `pre-commit run --all-files manually.
|
1041
|
+
2. Install the Git hooks by running `pre-commit install` or, alternatively, run `pre-commit run --all-files` manually.
|
@@ -1,27 +1,27 @@
|
|
1
1
|
franky/__init__.py,sha256=57BsmUytdeqMrhHglwvxMS6CgpAEVPw0KJge8_UTzEA,378
|
2
|
-
franky/_franky.cpython-38-x86_64-linux-gnu.so,sha256=
|
2
|
+
franky/_franky.cpython-38-x86_64-linux-gnu.so,sha256=Imetnx8BIwf9hw_LevIuP_nY00sBXpGFuaHlIoGHHUo,3075809
|
3
3
|
franky/_franky.pyi,sha256=odBnBaM2qGN4mUa8WvFN5SL9aszPgDTsZj5Jb9UkFHk,60047
|
4
4
|
franky/motion.py,sha256=TWsx2Ba9iYG9e-OxpuYZlVn1wdzKS-Zvz6ayHT_HYXQ,354
|
5
5
|
franky/reaction.py,sha256=cBuHAMek9yH-9Zmwfa0dzz2t5G_1SQEWXNdW7mhhCI8,1519
|
6
6
|
franky/robot.py,sha256=NaTNh4PaJshbz44eibvLCMt6O_Ak7TRVjhUR6AGay9A,236
|
7
7
|
franky/robot_web_session.py,sha256=rYpnUe4b8xj5JjCYxNRZ0uYz8lL2qfxKglcImFDw24Y,9070
|
8
|
-
franky_control.libs/libPocoFoundation-
|
9
|
-
franky_control.libs/libPocoNet-
|
8
|
+
franky_control.libs/libPocoFoundation-55da614c.so.95,sha256=C9mBkna2m4LazUpeOgAp9-NRNUMDdpBMVeaasVAZzSk,3273833
|
9
|
+
franky_control.libs/libPocoNet-18bb01e7.so.95,sha256=rw04unxMioVxQ1Dd01N0pP0hy8kii8uYN7bOQjtrf50,2504833
|
10
10
|
franky_control.libs/libboost_filesystem-38deced9.so.1.66.0,sha256=-thu-LYmEDUKnOhQw3njV9C58dVZV12pn_6-KoqDCeI,145241
|
11
11
|
franky_control.libs/libboost_serialization-3aa46b41.so.1.66.0,sha256=KpSA9K4iakzd-Mvv5JvPSqxJyMYsVkcIXrUbSlAkiIo,316673
|
12
12
|
franky_control.libs/libboost_system-69a6c43e.so.1.66.0,sha256=sd_lA0coUWXm-bluxkOkNrzrxFSAXYDphjPDwBekik8,22905
|
13
13
|
franky_control.libs/libconsole_bridge-def124d9.so.0.3,sha256=Eg1wJzVIRG5GQhyr59_qdYgnmhto0orU0j8HW2A0JIg,27297
|
14
14
|
franky_control.libs/libfmt-8375f6bf.so.6.2.1,sha256=Z8D_NYG4rsuwMIYP3KfNB95w7vnsPaV5XLm2EnWd9Fk,327441
|
15
|
-
franky_control.libs/libfranka-
|
16
|
-
franky_control.libs/libpinocchio_default-
|
17
|
-
franky_control.libs/libpinocchio_parsers-
|
15
|
+
franky_control.libs/libfranka-ef91489b.so.0.15.3,sha256=eVy59SBbO6LWbJgdmJfiPrZuLYrIRJmxufaGKUXCEPs,1608673
|
16
|
+
franky_control.libs/libpinocchio_default-79007ccc.so.3.1.0,sha256=L22h0rzxvI-BfOpnGXX92_tNeo1TGqgLTk0jSwTbNms,9255841
|
17
|
+
franky_control.libs/libpinocchio_parsers-75953cdd.so.3.1.0,sha256=csrLN2aHiR_j77t8xTqUloqxcy043HzGG8lFT4K-tAA,713129
|
18
18
|
franky_control.libs/libtinyxml-435d1f53.so.0.2.6.2,sha256=BGSkG-zXEYTuGquHhydNow2ufOetDZpEP7MbBZyf6hA,120209
|
19
19
|
franky_control.libs/liburdfdom_model-9e7b5a88.so.1.0,sha256=c4cAZ09SHlu-dpMZmwsxC8Ydklm8RzEANxvdJHeh4Ho,187561
|
20
20
|
franky_control.libs/liburdfdom_model_state-741cbb83.so.1.0,sha256=NvqLfm2u-YlCihr5GRoUGL6iJMLRHm-RFEmR0he5csM,59105
|
21
21
|
franky_control.libs/liburdfdom_sensor-5dbb5bb4.so.1.0,sha256=udrHZ0oYFTf9qwr8hm8rSrBKZDkd1L5yy5tyh10D018,51777
|
22
22
|
franky_control.libs/liburdfdom_world-bd943329.so.1.0,sha256=ja9WE45nXtAGUoLpg1T1Hte8BZLldj_WNf9cL3H1RPk,187561
|
23
|
-
franky_control-1.1.
|
24
|
-
franky_control-1.1.
|
25
|
-
franky_control-1.1.
|
26
|
-
franky_control-1.1.
|
27
|
-
franky_control-1.1.
|
23
|
+
franky_control-1.1.2.dist-info/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
|
24
|
+
franky_control-1.1.2.dist-info/METADATA,sha256=rAAddCuosCjBZ7YkBKAIelfYItywXBzyEXSk3IkfXoY,41091
|
25
|
+
franky_control-1.1.2.dist-info/WHEEL,sha256=4bDjsNqNiwr2G2bLNR18ftAr5l4l03O656kYhb6U22c,111
|
26
|
+
franky_control-1.1.2.dist-info/top_level.txt,sha256=LdDKRvHTODs6ll6Ow5b-gmWqt4NJffHxL83MRTCv_Ag,22
|
27
|
+
franky_control-1.1.2.dist-info/RECORD,,
|
index 5a8a2a3..4aec85b 100755
|
|
Binary file
|
index dc82175..385d75e 100755
|
|
Binary file
|
Binary file
|
index c0bfda3..059f79f 100755
|
|
Binary file
|
index 8314b06..119d11a 100755
|
|
Binary file
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|