Skip to content

Commit

Permalink
patches for python3.11 #339 (#340)
Browse files Browse the repository at this point in the history
* patches for python3.11 #339

* Reduce changes

* Create ros-noetic-pybind11-catkin.patch

---------

Co-authored-by: Tobias Fischer <[email protected]>
  • Loading branch information
lianghongzhuo and Tobias-Fischer authored Feb 7, 2023
1 parent e253488 commit b606b4e
Show file tree
Hide file tree
Showing 8 changed files with 1,413 additions and 4 deletions.
13 changes: 13 additions & 0 deletions patch/ros-noetic-canopen-chain-node.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 45c6f9d2..87154270 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,7 +22,7 @@ find_package(catkin REQUIRED

find_package(Boost REQUIRED
COMPONENTS
- filesystem
+ filesystem thread
)

add_service_files(DIRECTORY srv
22 changes: 22 additions & 0 deletions patch/ros-noetic-joint-state-publisher-gui.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/src/joint_state_publisher_gui/__init__.py b/src/joint_state_publisher_gui/__init__.py
index b4aa139..71b2ca1 100644
--- a/src/joint_state_publisher_gui/__init__.py
+++ b/src/joint_state_publisher_gui/__init__.py
@@ -100,7 +100,7 @@ class JointStatePublisherGui(QWidget):

slider.setFont(font)
slider.setRange(0, RANGE)
- slider.setValue(RANGE/2)
+ slider.setValue(int(RANGE/2))

joint_layout.addWidget(slider)

@@ -222,7 +222,7 @@ class JointStatePublisherGui(QWidget):
self.update_sliders()

def valueToSlider(self, value, joint):
- return (value - joint['min']) * float(RANGE) / (joint['max'] - joint['min'])
+ return int((value - joint['min']) * float(RANGE) / (joint['max'] - joint['min']))

def sliderToValue(self, slider, joint):
pctvalue = slider / float(RANGE)
64 changes: 60 additions & 4 deletions patch/ros-noetic-moveit-core.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,63 @@
diff --git a/moveit_core/trajectory_processing/include/moveit/trajectory_processing/ruckig_traj_smoothing.h b/moveit_core/trajectory_processing/include/moveit/trajectory_processing/ruckig_traj_smoothing.h
index 4671db898e..79f34e6d16 100644
--- a/moveit_core/trajectory_processing/include/moveit/trajectory_processing/ruckig_traj_smoothing.h
+++ b/moveit_core/trajectory_processing/include/moveit/trajectory_processing/ruckig_traj_smoothing.h
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6070e14d1..54e5f3218 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,8 +51,14 @@ else()
endif()

find_package(octomap REQUIRED)
+
find_package(ruckig REQUIRED)
+# work around catkin_package not fetching the interface includes from the target
+# to forward to downstream dependencies. The includes do not need to be added
+# in include_directories below because the target is correctly imported here.
+get_target_property(ruckig_INCLUDE_DIRS ruckig::ruckig INTERFACE_INCLUDE_DIRECTORIES)
set(ruckig_LIBRARIES "ruckig::ruckig")
+
find_package(urdfdom REQUIRED)
find_package(urdfdom_headers REQUIRED)

diff --git a/cmake/moveit.cmake b/cmake/moveit.cmake
index 134412ab3..83163d534 100644
--- a/cmake/moveit.cmake
+++ b/cmake/moveit.cmake
@@ -1,8 +1,9 @@
macro(moveit_build_options)
- # for Bionic
- if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9")
+ # for Ubuntu bionic/focal
+ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11") OR
+ (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "16"))
if(NOT "${CMAKE_CXX_STANDARD}")
- set(CMAKE_CXX_STANDARD 14)
+ set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
diff --git a/collision_detector_bullet_description.xml b/collision_detector_bullet_description.xml
index 6d90496ea..b7f688682 100644
--- a/collision_detector_bullet_description.xml
+++ b/collision_detector_bullet_description.xml
@@ -1,4 +1,4 @@
-<library path="lib/libcollision_detector_bullet_plugin">
+<library path="libcollision_detector_bullet_plugin">
<class name="Bullet" type="collision_detection::CollisionDetectorBtPluginLoader"
base_class_type="collision_detection::CollisionPlugin">
<description>
diff --git a/collision_detector_fcl_description.xml b/collision_detector_fcl_description.xml
index f96b06c05..794b8ea2a 100644
--- a/collision_detector_fcl_description.xml
+++ b/collision_detector_fcl_description.xml
@@ -1,4 +1,4 @@
-<library path="lib/libcollision_detector_fcl_plugin">
+<library path="libcollision_detector_fcl_plugin">
<class name="FCL" type="collision_detection::CollisionDetectorFCLPluginLoader"
base_class_type="collision_detection::CollisionPlugin">
<description>
diff --git a/trajectory_processing/include/moveit/trajectory_processing/ruckig_traj_smoothing.h b/trajectory_processing/include/moveit/trajectory_processing/ruckig_traj_smoothing.h
index 4671db898..d79b2645e 100644
--- a/trajectory_processing/include/moveit/trajectory_processing/ruckig_traj_smoothing.h
+++ b/trajectory_processing/include/moveit/trajectory_processing/ruckig_traj_smoothing.h
@@ -37,6 +37,7 @@

#include <Eigen/Core>
Expand Down
155 changes: 155 additions & 0 deletions patch/ros-noetic-octomap.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6c14a2d9..395f9cd7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,6 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2)
PROJECT( octomap )

-set(CMAKE_INSTALL_LIBDIR "lib")
-
include(CTest)
include(GNUInstallDirs)

@@ -57,7 +55,6 @@ LINK_DIRECTORIES(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

# Installation

-
set(INSTALL_TARGETS_DEFAULT_ARGS
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
diff --git a/include/octomap/OcTreeIterator.hxx b/include/octomap/OcTreeIterator.hxx
index 66ae63f8..5f2dd7e5 100644
--- a/include/octomap/OcTreeIterator.hxx
+++ b/include/octomap/OcTreeIterator.hxx
@@ -39,8 +39,15 @@
* const with respect to the tree. This file is included within
* OcTreeBaseImpl.h, you should probably not include this directly.
*/
- class iterator_base : public std::iterator<std::forward_iterator_tag, NodeType>{
+ template<class NodeType>
+ class iterator_base{
public:
+ using iterator_category = std::forward_iterator_tag;
+ using value_type = NodeType;
+ using difference_type = NodeType;
+ using pointer = NodeType*;
+ using reference = NodeType&;
+
struct StackElement;
/// Default ctor, only used for the end-iterator
iterator_base() : tree(NULL), maxDepth(0){}
@@ -204,16 +211,16 @@
* }
* @endcode
*/
- class tree_iterator : public iterator_base {
+ class tree_iterator : public iterator_base<NodeType> {
public:
- tree_iterator() : iterator_base(){}
+ tree_iterator() : iterator_base<NodeType>(){}
/**
* Constructor of the iterator.
*
* @param ptree OcTreeBaseImpl on which the iterator is used on
* @param depth Maximum depth to traverse the tree. 0 (default): unlimited
*/
- tree_iterator(OcTreeBaseImpl<NodeType,INTERFACE> const* ptree, uint8_t depth=0) : iterator_base(ptree, depth) {};
+ tree_iterator(OcTreeBaseImpl<NodeType,INTERFACE> const* ptree, uint8_t depth=0) : iterator_base<NodeType>(ptree, depth) {};

/// postfix increment operator of iterator (it++)
tree_iterator operator++(int){
@@ -260,9 +267,9 @@
* @endcode
*
*/
- class leaf_iterator : public iterator_base {
+ class leaf_iterator : public iterator_base<NodeType> {
public:
- leaf_iterator() : iterator_base(){}
+ leaf_iterator() : iterator_base<NodeType>(){}

/**
* Constructor of the iterator.
@@ -270,7 +277,7 @@
* @param ptree OcTreeBaseImpl on which the iterator is used on
* @param depth Maximum depth to traverse the tree. 0 (default): unlimited
*/
- leaf_iterator(OcTreeBaseImpl<NodeType, INTERFACE> const* ptree, uint8_t depth=0) : iterator_base(ptree, depth) {
+ leaf_iterator(OcTreeBaseImpl<NodeType, INTERFACE> const* ptree, uint8_t depth=0) : iterator_base<NodeType>(ptree, depth) {
// tree could be empty (= no stack)
if (this->stack.size() > 0){
// skip forward to next valid leaf node:
@@ -280,7 +287,7 @@
}
}

- leaf_iterator(const leaf_iterator& other) : iterator_base(other) {};
+ leaf_iterator(const leaf_iterator& other) : iterator_base<NodeType>(other) {};

/// postfix increment operator of iterator (it++)
leaf_iterator operator++(int){
@@ -332,9 +339,9 @@
* }
* @endcode
*/
- class leaf_bbx_iterator : public iterator_base {
+ class leaf_bbx_iterator : public iterator_base<NodeType> {
public:
- leaf_bbx_iterator() : iterator_base() {};
+ leaf_bbx_iterator() : iterator_base<NodeType>() {};
/**
* Constructor of the iterator. The bounding box corners min and max are
* converted into an OcTreeKey first.
@@ -351,7 +358,7 @@
* @param depth Maximum depth to traverse the tree. 0 (default): unlimited
*/
leaf_bbx_iterator(OcTreeBaseImpl<NodeType,INTERFACE> const* ptree, const point3d& min, const point3d& max, uint8_t depth=0)
- : iterator_base(ptree, depth)
+ : iterator_base<NodeType>(ptree, depth)
{
if (this->stack.size() > 0){
assert(ptree);
@@ -379,7 +386,7 @@
* @param depth Maximum depth to traverse the tree. 0 (default): unlimited
*/
leaf_bbx_iterator(OcTreeBaseImpl<NodeType,INTERFACE> const* ptree, const OcTreeKey& min, const OcTreeKey& max, uint8_t depth=0)
- : iterator_base(ptree, depth), minKey(min), maxKey(max)
+ : iterator_base<NodeType>(ptree, depth), minKey(min), maxKey(max)
{
// tree could be empty (= no stack)
if (this->stack.size() > 0){
@@ -389,7 +396,7 @@
}
}

- leaf_bbx_iterator(const leaf_bbx_iterator& other) : iterator_base(other) {
+ leaf_bbx_iterator(const leaf_bbx_iterator& other) : iterator_base<NodeType>(other) {
minKey = other.minKey;
maxKey = other.maxKey;
}
@@ -430,10 +437,10 @@
protected:

void singleIncrement(){
- typename iterator_base::StackElement top = this->stack.top();
+ typename iterator_base<NodeType>::StackElement top = this->stack.top();
this->stack.pop();

- typename iterator_base::StackElement s;
+ typename iterator_base<NodeType>::StackElement s;
s.depth = top.depth +1;
key_type center_offset_key = this->tree->tree_max_val >> s.depth;
// push on stack in reverse order
diff --git a/src/testing/CMakeLists.txt b/src/testing/CMakeLists.txt
index eae2876d..5dc1d952 100644
--- a/src/testing/CMakeLists.txt
+++ b/src/testing/CMakeLists.txt
@@ -50,4 +50,6 @@ if(BUILD_TESTING)
ADD_TEST (NAME test_mapcollection COMMAND test_mapcollection ${PROJECT_SOURCE_DIR}/share/data/mapcoll.txt)
ADD_TEST (NAME test_color_tree COMMAND test_color_tree)
ADD_TEST (NAME test_bbx COMMAND test_bbx)
+
+ SET_TESTS_PROPERTIES (ReadGraph PROPERTIES DEPENDS InsertScan)
endif()
Loading

0 comments on commit b606b4e

Please sign in to comment.