Skip to content

Commit 43e77ec

Browse files
authored
Update Python wrapper to upstream Feb 2022 (#17)
* Updated python modules passing tests * Fix KinGroupIKInputs SWIG type, add test_tesseract_environmnt_kingroup.py * Update tesseract_viewer_python and examples * Modify dependencies.rosinstall to use development branches for CI testing. Change to upstream before merging!!! * Bump github actions * Don't use pathlib for Python 2.7 compatibility * Add CTEST_OUTPUT_ON_FAILURE to github tests * Don't use pathlib for Python 2.7 compatibility - fix test_tesseract_environment.py * Use windows-2019 for CI testing * Update dependencies_with_ext.rosinstall with temporary upstream sources for Windows testing * Add Python path to windows_noetic_build.yml * Update dependencies.rosinstall
1 parent 40d9f06 commit 43e77ec

File tree

55 files changed

+883
-855
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+883
-855
lines changed

.github/workflows/bionic_build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
UPSTREAM_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Release"
2828
TARGET_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Debug -DTESSERACT_ENABLE_TESTING=ON"
2929
AFTER_SCRIPT: 'catkin build -w $target_ws --no-deps --verbose tesseract_python --make-args test'
30+
CTEST_OUTPUT_ON_FAILURE: 1
3031
steps:
3132
- uses: actions/checkout@v1
3233

.github/workflows/focal_build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
BEFORE_RUN_TARGET_TEST_EMBED: "ici_with_unset_variables source /root/target_ws/install/setup.bash"
2828
UPSTREAM_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Release"
2929
TARGET_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Debug -DTESSERACT_ENABLE_TESTING=ON"
30+
CTEST_OUTPUT_ON_FAILURE: 1
3031
steps:
3132
- uses: actions/checkout@v1
3233

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,43 @@
1-
name: Windows-Noetic-Build
2-
3-
on:
4-
push:
5-
branches:
6-
- master
7-
pull_request:
8-
schedule:
9-
- cron: '0 5 * * *'
10-
11-
jobs:
12-
windows_ci:
13-
name: Noetic
14-
runs-on: windows-latest
15-
env:
16-
ROS_DISTRO: noetic
17-
steps:
18-
- uses: actions/checkout@v2
19-
with:
20-
submodules: recursive
21-
path: src/tesseract_python
22-
- name: Build
23-
shell: cmd
24-
run: |
25-
choco sources add -n=roswin -s https://aka.ms/ros/public --priority 1
26-
choco install ros-%ROS_DISTRO%-desktop_full -y --no-progress
27-
choco install swig
28-
29-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64
30-
call "C:\opt\ros\%ROS_DISTRO%\x64\setup.bat"
31-
32-
set
33-
34-
rosdep update
35-
36-
vcs import --input "${{ github.workspace }}/src/tesseract_python/dependencies_with_ext.rosinstall" src/
37-
38-
rosdep install -q --from-paths . --ignore-src -y
39-
40-
catkin_make_isolated --install --use-nmake --force-cmake --only-pkg-with-deps tesseract_python --cmake-args -DCMAKE_BUILD_TYPE=Release -DINSTALL_OMPL=ON -DINSTALL_OMPL_TAG=master -DBUILD_IPOPT=OFF -DBUILD_SNOPT=OFF -DINSTALL_FCL=ON -DINSTALL_BULLET=ON
41-
call "D:\a\tesseract_python\tesseract_python\install_isolated\setup.bat"
42-
catkin_make_isolated --install --use-nmake --force-cmake --pkg tesseract_python --cmake-args -DCMAKE_BUILD_TYPE=Release -DTESSERACT_ENABLE_TESTING=ON -DINSTALL_OMPL=ON -DINSTALL_OMPL_TAG=master -DBUILD_IPOPT=OFF -DBUILD_SNOPT=OFF -DINSTALL_FCL=ON -DINSTALL_BULLET=ON
1+
name: Windows-Noetic-Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
schedule:
9+
- cron: '0 5 * * *'
10+
11+
jobs:
12+
windows_ci:
13+
name: Noetic
14+
runs-on: windows-2019
15+
env:
16+
ROS_DISTRO: noetic
17+
CTEST_OUTPUT_ON_FAILURE: 1
18+
steps:
19+
- uses: actions/checkout@v2
20+
with:
21+
submodules: recursive
22+
path: src/tesseract_python
23+
- name: Build
24+
shell: cmd
25+
run: |
26+
choco sources add -n=roswin -s https://aka.ms/ros/public --priority 1
27+
choco install ros-%ROS_DISTRO%-desktop_full -y --no-progress
28+
choco install swig
29+
30+
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64
31+
call "C:\opt\ros\%ROS_DISTRO%\x64\setup.bat"
32+
33+
set
34+
35+
rosdep update
36+
37+
vcs import --input "${{ github.workspace }}/src/tesseract_python/dependencies_with_ext.rosinstall" src/
38+
39+
rosdep install -q --from-paths . --ignore-src -y
40+
41+
catkin_make_isolated --install --use-nmake --force-cmake --only-pkg-with-deps tesseract_python --cmake-args -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=C:/opt/ros/noetic/x64/python.exe -DPYTHON_LIBRARY=C:/opt/ros/noetic/x64/Lib/python38.lib -DINSTALL_OMPL=ON -DINSTALL_OMPL_TAG=master -DBUILD_IPOPT=OFF -DBUILD_SNOPT=OFF -DINSTALL_FCL=ON -DINSTALL_BULLET=ON
42+
call "D:\a\tesseract_python\tesseract_python\install_isolated\setup.bat"
43+
catkin_make_isolated --install --use-nmake --force-cmake --pkg tesseract_python --cmake-args -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=C:/opt/ros/noetic/x64/python.exe -DPYTHON_LIBRARY=C:/opt/ros/noetic/x64/Lib/python38.lib -DTESSERACT_ENABLE_TESTING=ON -DINSTALL_OMPL=ON -DINSTALL_OMPL_TAG=master -DBUILD_IPOPT=OFF -DBUILD_SNOPT=OFF -DINSTALL_FCL=ON -DINSTALL_BULLET=ON

dependencies.rosinstall

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
- git:
22
local-name: ros_industrial_cmake_boilerplate
33
uri: https://github.com/ros-industrial/ros_industrial_cmake_boilerplate.git
4-
version: master
4+
version: 0.2.14
5+
56
- git:
67
local-name: tesseract
7-
uri: https://github.com/ros-industrial-consortium/tesseract.git
8-
version: master
8+
uri: https://github.com/tesseract-robotics/tesseract.git
9+
version: 3a14e2a071a06c60763c0ea985de539fba7341b2
910
- git:
1011
local-name: tesseract_planning
11-
uri: https://github.com/ros-industrial-consortium/tesseract_planning.git
12-
version: master
12+
uri: https://github.com/tesseract-robotics/tesseract_planning.git
13+
version: 1627231f3de8118f48d19272d0a7ac43dfe2f98a
1314
- git:
1415
local-name: trajopt
15-
uri: https://github.com/ros-industrial-consortium/trajopt_ros.git
16-
version: master
16+
uri: https://github.com/tesseract-robotics/trajopt.git
17+
version: 0.2.0
1718
- git:
1819
local-name: descartes_light
1920
uri: https://github.com/swri-robotics/descartes_light.git
20-
version: master
21+
version: 0.3.0
2122
- git:
2223
local-name: opw_kinematics
2324
uri: https://github.com/Jmeyer1292/opw_kinematics.git
24-
version: master
25+
version: 0.4.4
2526
- git:
2627
local-name: ifopt
2728
uri: https://github.com/ethz-adrl/ifopt.git
28-
version: master
29+
version: 2.1.2

dependencies_with_ext.rosinstall

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
11
- git:
22
local-name: ros_industrial_cmake_boilerplate
33
uri: https://github.com/ros-industrial/ros_industrial_cmake_boilerplate.git
4-
version: master
5-
- git:
6-
local-name: tesseract_ext
7-
uri: https://github.com/ros-industrial-consortium/tesseract_ext.git
8-
version: master
4+
version: 0.2.14
5+
96
- git:
107
local-name: tesseract
11-
uri: https://github.com/ros-industrial-consortium/tesseract.git
12-
version: master
8+
uri: https://github.com/tesseract-robotics/tesseract.git
9+
version: 3a14e2a071a06c60763c0ea985de539fba7341b2
1310
- git:
1411
local-name: tesseract_planning
15-
uri: https://github.com/ros-industrial-consortium/tesseract_planning.git
16-
version: master
12+
uri: https://github.com/tesseract-robotics/tesseract_planning.git
13+
version: 1627231f3de8118f48d19272d0a7ac43dfe2f98a
1714
- git:
1815
local-name: trajopt
19-
uri: https://github.com/ros-industrial-consortium/trajopt_ros.git
20-
version: master
16+
uri: https://github.com/tesseract-robotics/trajopt.git
17+
version: 0.2.0
2118
- git:
2219
local-name: descartes_light
2320
uri: https://github.com/swri-robotics/descartes_light.git
24-
version: master
21+
version: 0.3.0
2522
- git:
2623
local-name: opw_kinematics
2724
uri: https://github.com/Jmeyer1292/opw_kinematics.git
28-
version: master
25+
version: 0.4.4
2926
- git:
3027
local-name: ifopt
3128
uri: https://github.com/ethz-adrl/ifopt.git
29+
version: 2.1.2
30+
- git:
31+
local-name: tesseract_ext
32+
uri: https://github.com/tesseract-robotics/tesseract_ext.git
3233
version: master

tesseract_python/CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,23 +109,20 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/tesseract_python_module.cmake)
109109
tesseract_python_module(tesseract_common_python SWIG_SRCS swig/tesseract_common_python.i PACKAGE tesseract_common LIBS tesseract::tesseract_common )
110110
tesseract_python_module(tesseract_geometry_python SWIG_SRCS swig/tesseract_geometry_python.i PACKAGE tesseract_geometry LIBS tesseract::tesseract_geometry )
111111
tesseract_python_module(tesseract_collision_python SWIG_SRCS swig/tesseract_collision_python.i PACKAGE tesseract_collision LIBS tesseract::tesseract_collision_core )
112-
tesseract_python_module(tesseract_collision_bullet_python SWIG_SRCS swig/tesseract_collision_bullet_python.i PACKAGE tesseract_collision_bullet LIBS tesseract::tesseract_collision_bullet )
113-
tesseract_python_module(tesseract_collision_fcl_python SWIG_SRCS swig/tesseract_collision_fcl_python.i PACKAGE tesseract_collision_fcl LIBS tesseract::tesseract_collision_fcl )
114112
tesseract_python_module(tesseract_scene_graph_python SWIG_SRCS swig/tesseract_scene_graph_python.i PACKAGE tesseract_scene_graph LIBS tesseract::tesseract_scene_graph )
115113
tesseract_python_module(tesseract_srdf_python SWIG_SRCS swig/tesseract_srdf_python.i PACKAGE tesseract_srdf LIBS tesseract::tesseract_srdf )
116114
tesseract_python_module(tesseract_urdf_python SWIG_SRCS swig/tesseract_urdf_python.i PACKAGE tesseract_urdf LIBS tesseract::tesseract_urdf )
115+
tesseract_python_module(tesseract_state_solver_python SWIG_SRCS swig/tesseract_state_solver_python.i PACKAGE tesseract_state_solver LIBS tesseract::tesseract_state_solver_core tesseract::tesseract_state_solver_ofkt tesseract::tesseract_state_solver_kdl)
117116
tesseract_python_module(tesseract_kinematics_python SWIG_SRCS swig/tesseract_kinematics_python.i PACKAGE tesseract_kinematics LIBS tesseract::tesseract_kinematics_core )
118-
tesseract_python_module(tesseract_kinematics_kdl_python SWIG_SRCS swig/tesseract_kinematics_kdl_python.i PACKAGE tesseract_kinematics_kdl LIBS tesseract::tesseract_kinematics_kdl )
119-
tesseract_python_module(tesseract_kinematics_opw_python SWIG_SRCS swig/tesseract_kinematics_opw_python.i PACKAGE tesseract_kinematics_opw LIBS tesseract::tesseract_kinematics_opw )
120-
tesseract_python_module(tesseract_environment_python SWIG_SRCS swig/tesseract_environment_python.i PACKAGE tesseract_environment LIBS tesseract::tesseract_environment_core tesseract::tesseract_environment_kdl )
117+
tesseract_python_module(tesseract_environment_python SWIG_SRCS swig/tesseract_environment_python.i PACKAGE tesseract_environment LIBS tesseract::tesseract_environment )
118+
tesseract_python_module(tesseract_visualization_python SWIG_SRCS swig/tesseract_visualization_python.i PACKAGE tesseract_visualization LIBS tesseract::tesseract_visualization)
121119
tesseract_python_module(tesseract_command_language_python SWIG_SRCS swig/tesseract_command_language_python.i PACKAGE tesseract_command_language LIBS tesseract::tesseract_command_language)
122120
tesseract_python_module(tesseract_motion_planners_python SWIG_SRCS swig/tesseract_motion_planners_python.i PACKAGE tesseract_motion_planners LIBS tesseract::tesseract_motion_planners_simple tesseract::tesseract_motion_planners_core )
123121
tesseract_python_module(tesseract_motion_planners_simple_python SWIG_SRCS swig/tesseract_motion_planners_simple_python.i PACKAGE tesseract_motion_planners_simple LIBS tesseract::tesseract_motion_planners_simple )
124122
tesseract_python_module(tesseract_motion_planners_trajopt_python SWIG_SRCS swig/tesseract_motion_planners_trajopt_python.i PACKAGE tesseract_motion_planners_trajopt LIBS tesseract::tesseract_motion_planners_trajopt )
125123
tesseract_python_module(tesseract_motion_planners_ompl_python SWIG_SRCS swig/tesseract_motion_planners_ompl_python.i PACKAGE tesseract_motion_planners_ompl LIBS tesseract::tesseract_motion_planners_ompl )
126124
tesseract_python_module(tesseract_motion_planners_descartes_python SWIG_SRCS swig/tesseract_motion_planners_descartes_python.i PACKAGE tesseract_motion_planners_descartes LIBS tesseract::tesseract_motion_planners_descartes )
127125
tesseract_python_module(tesseract_time_parameterization_python SWIG_SRCS swig/tesseract_time_parameterization_python.i PACKAGE tesseract_time_parameterization LIBS tesseract::tesseract_time_parameterization )
128-
tesseract_python_module(tesseract_visualization_python SWIG_SRCS swig/tesseract_visualization_python.i PACKAGE tesseract_visualization LIBS tesseract::tesseract_visualization)
129126
tesseract_python_module(tesseract_process_managers_python SWIG_SRCS swig/tesseract_process_managers_python.i PACKAGE tesseract_process_managers LIBS tesseract::tesseract_process_managers )
130127

131128
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/__package_init__.py.in ${CMAKE_CURRENT_BINARY_DIR}/python/tesseract_robotics/__init__.py @ONLY)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// https://stackify.dev/940798-how-to-handle-unique-ptrs-with-swig
2+
3+
namespace std {
4+
%feature("novaluewrapper") unique_ptr;
5+
template <typename Type>
6+
struct unique_ptr {
7+
typedef Type* pointer;
8+
9+
explicit unique_ptr( pointer Ptr );
10+
unique_ptr (unique_ptr&& Right);
11+
template<class Type2, Class Del2> unique_ptr( unique_ptr<Type2, Del2>&& Right );
12+
unique_ptr( const unique_ptr& Right) = delete;
13+
14+
15+
pointer operator-> () const;
16+
pointer release ();
17+
void reset (pointer __p=pointer());
18+
void swap (unique_ptr &__u);
19+
pointer get () const;
20+
operator bool () const;
21+
22+
~unique_ptr();
23+
};
24+
}
25+
26+
%define %wrap_unique_ptr(Name, Type)
27+
28+
%typemap(out) std::unique_ptr<Type> %{
29+
$result = SWIG_NewPointerObj(new $1_ltype(std::move($1)), $&1_descriptor, SWIG_POINTER_OWN);
30+
%}
31+
32+
%typemap(memberin) std::unique_ptr<Type> %{
33+
$1 = std::move(*$input);
34+
%}
35+
36+
%template(Name) std::unique_ptr<Type>;
37+
%newobject std::unique_ptr<Type>::release;
38+
39+
/*%typemap(out) std::unique_ptr<Type> const %{
40+
$result = SWIG_NewPointerObj(new $1_ltype(std::move($1)), $&1_descriptor, SWIG_POINTER_OWN);
41+
%}*/
42+
43+
%enddef

tesseract_python/swig/tesseract_collision_bullet_python.i

Lines changed: 0 additions & 53 deletions
This file was deleted.

tesseract_python/swig/tesseract_collision_fcl_python.i

Lines changed: 0 additions & 47 deletions
This file was deleted.

tesseract_python/swig/tesseract_collision_python.i

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@
4141
// tesseract_collision
4242
#include <tesseract_collision/core/types.h>
4343
#include <tesseract_collision/core/discrete_contact_manager.h>
44-
#include <tesseract_collision/core/discrete_contact_manager_factory.h>
4544
#include <tesseract_collision/core/continuous_contact_manager.h>
46-
#include <tesseract_collision/core/continuous_contact_manager_factory.h>
45+
#include <tesseract_collision/core/contact_managers_plugin_factory.h>
4746

4847
#include "tesseract_collisions_python_std_functions.h"
4948
%}
@@ -52,14 +51,10 @@
5251

5352
%tesseract_std_function(IsContactAllowedFn,tesseract_collision,bool,const std::string&,a,const std::string&,b);
5453
%tesseract_std_function(IsContactValidFn,tesseract_collision,bool,const tesseract_collision::ContactResult&,a);
55-
%tesseract_std_function_noargs(ContinuousContactManagerFactoryCreateMethod,tesseract_collision,tesseract_collision::ContinuousContactManager::Ptr);
56-
%tesseract_std_function_noargs(DiscreteContactManagerFactoryCreateMethod,tesseract_collision,tesseract_collision::DiscreteContactManager::Ptr);
5754

5855
// tesseract_collision
5956
#define TESSERACT_COLLISION_CORE_PUBLIC
6057
%include "tesseract_collision/core/types.h"
6158
%include "tesseract_collision/core/discrete_contact_manager.h"
62-
%include "tesseract_collision/core/discrete_contact_manager_factory.h"
6359
%include "tesseract_collision/core/continuous_contact_manager.h"
64-
%include "tesseract_collision/core/continuous_contact_manager_factory.h"
65-
60+
%include "tesseract_collision/core/contact_managers_plugin_factory.h"

0 commit comments

Comments
 (0)