Skip to content

Commit 31dfb64

Browse files
author
Tim Schneider
committed
Added compatibility for libfranka 0.8
1 parent 2e18d01 commit 31dfb64

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ find_package(Eigen3 3.3.7 REQUIRED NO_MODULE)
1717
find_package(Franka REQUIRED)
1818

1919
if (${Franka_VERSION} VERSION_GREATER_EQUAL "0.8.0")
20-
add_compile_definitions(FRANKA8)
20+
add_compile_definitions(FRANKA_0_8)
21+
endif ()
22+
23+
if (${Franka_VERSION} VERSION_GREATER_EQUAL "0.9.0")
24+
add_compile_definitions(FRANKA_0_9)
2125
endif ()
2226

2327
message("Found Eigen Version: ${Eigen3_VERSION}")

python/python.cpp

+9-6
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ PYBIND11_MODULE(_franky, m) {
191191
.def(py::self * py::self);
192192
py::implicitly_convertible<double, RelativeDynamicsFactor>();
193193

194-
#define ERRORS7 \
194+
#define ERRORS_0_8 \
195195
joint_position_limits_violation, \
196196
cartesian_position_limits_violation, \
197197
self_collision_avoidance_violation, \
@@ -230,15 +230,15 @@ PYBIND11_MODULE(_franky, m) {
230230
instability_detected, \
231231
joint_move_in_wrong_direction
232232

233-
#ifdef FRANKA8
234-
#define ERRORS ERRORS7, \
233+
#ifdef FRANKA_0_9
234+
#define ERRORS ERRORS_0_8, \
235235
cartesian_spline_motion_generator_violation, \
236236
joint_via_motion_generator_planning_joint_limit_violation, \
237237
base_acceleration_initialization_timeout, \
238238
base_acceleration_invalid_reading
239239
#define NUM_ERRORS 41
240240
#else
241-
#define ERRORS ERRORS7
241+
#define ERRORS ERRORS_0_8
242242
#define NUM_ERRORS 37
243243
#endif
244244

@@ -325,15 +325,18 @@ PYBIND11_MODULE(_franky, m) {
325325
py::is_operator())
326326
.def("__repr__", &Measure::repr);
327327

328-
#ifdef FRANKA8
328+
#ifdef FRANKA_0_8
329329
#define EXTRA_FIELDS1 \
330330
F_T_NE, \
331331
NE_T_EE,
332+
#else
333+
#define EXTRA_FIELDS1
334+
#endif
332335

336+
#ifdef FRANKA_0_9
333337
#define EXTRA_FIELDS2 \
334338
O_ddP_O,
335339
#else
336-
#define EXTRA_FIELDS1
337340
#define EXTRA_FIELDS2
338341
#endif
339342

0 commit comments

Comments
 (0)