Skip to content

Commit 9089b48

Browse files
Add python bindings for the test impl_test_sot_mock_device
1 parent 9d328de commit 9089b48

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

tests/CMakeLists.txt

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,34 @@ if(BUILD_TESTING)
1010
find_package(launch_testing_ament_cmake)
1111
ament_lint_auto_find_test_dependencies()
1212

13+
# Library for sot_mock_device
14+
add_library(impl_test_sot_mock_device SHARED impl_test_sot_mock_device.cpp)
15+
set_target_properties(impl_test_sot_mock_device PROPERTIES INSTALL_RPATH
16+
$ORIGIN)
17+
# target_include_directories(impl_test_sot_mock_device PUBLIC include)
18+
target_link_libraries(
19+
impl_test_sot_mock_device PUBLIC sot-core::sot-core
20+
dynamic-graph-python::dynamic-graph-python)
21+
22+
install(
23+
TARGETS impl_test_sot_mock_device
24+
EXPORT ${TARGETS_EXPORT_NAME}
25+
DESTINATION ${DYNAMIC_GRAPH_PLUGINDIR})
26+
27+
file(MAKE_DIRECTORY
28+
${PROJECT_BINARY_DIR}/tests/dynamic_graph/ros/impl_test_sot_mock_device)
29+
30+
dynamic_graph_python_module(
31+
"${PYTHON_DIR}/ros/impl_test_sot_mock_device" impl_test_sot_mock_device
32+
dynamic_graph_bridge-impl_test_sot_mock_device-wrap SOURCE_PYTHON_MODULE
33+
"${CMAKE_CURRENT_SOURCE_DIR}/impl_test_sot_mock_device-python-module-py.cc")
34+
35+
install(
36+
TARGETS ${plugin_library_name}
37+
EXPORT ${TARGETS_EXPORT_NAME}
38+
DESTINATION ${DYNAMIC_GRAPH_PLUGINDIR})
1339
# Library for sot_external_interface
14-
add_library(impl_test_library SHARED impl_test_sot_external_interface.cpp
15-
impl_test_sot_mock_device.cpp)
40+
add_library(impl_test_library SHARED impl_test_sot_external_interface.cpp)
1641

1742
target_include_directories(impl_test_library PUBLIC include)
1843
target_link_libraries(impl_test_library PUBLIC sot-core::sot-core)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright 2023, LAAS, CNRS
3+
*
4+
* Author:Olivier Stasse
5+
*
6+
* This file is part of dynamic_graph_bridge.
7+
* This file is under the APACHE license 2.0
8+
*
9+
*/
10+
#include <dynamic-graph/python/module.hh>
11+
12+
#include "impl_test_sot_mock_device.hh"
13+
namespace dg = dynamicgraph;
14+
15+
BOOST_PYTHON_MODULE(wrap) {
16+
bp::import("dynmic_graph.sot.core.wrap");
17+
18+
dg::python::exposeEntity<ImplTestSotMockDevice,
19+
bp::bases<dg::sot::Device> >();
20+
}

0 commit comments

Comments
 (0)