Try fixing qt6-qt5 rtabmap-rviz-plugins build issue. (#1376)

* Try fixing qt6-qt5 rtabmap-rviz-plugins build issue. Disabled rtabmap-costmap-plugins for rolling.

* fixed ci

* Seems to fix the issue

* fixed rtabmap_python test failing
This commit is contained in:
matlabbe
2025-11-02 15:27:53 -08:00
committed by GitHub
parent 9963bc06af
commit f3cf0d20d0
7 changed files with 94 additions and 21 deletions
+6 -1
View File
@@ -20,12 +20,17 @@ jobs:
include: include:
- ros_distro: humble - ros_distro: humble
skip_keys: '' skip_keys: ''
packages: 'rtabmap_ros'
- ros_distro: jazzy - ros_distro: jazzy
skip_keys: '' skip_keys: ''
packages: 'rtabmap_ros'
- ros_distro: kilted - ros_distro: kilted
skip_keys: 'grid_map_ros' skip_keys: 'grid_map_ros'
packages: 'rtabmap_ros'
- ros_distro: rolling - ros_distro: rolling
skip_keys: 'nav2_bringup nav2_msgs velodyne' skip_keys: 'nav2_bringup nav2_msgs velodyne'
# rtabmap_costmap_plugins cannot be built, missing nav2 on rolling, build other packages:
packages: 'rtabmap_launch rtabmap_demos rtabmap_python rtabmap_examples rtabmap_rviz_plugins'
fail-fast: false fail-fast: false
container: container:
image: osrf/ros:${{ matrix.ros_distro }}-desktop-full image: osrf/ros:${{ matrix.ros_distro }}-desktop-full
@@ -39,7 +44,7 @@ jobs:
cat /tmp/deps.repos cat /tmp/deps.repos
- uses: ros-tooling/[email protected] - uses: ros-tooling/[email protected]
with: with:
package-name: rtabmap_ros package-name: ${{ matrix.packages }}
target-ros2-distro: ${{ matrix.ros_distro }} target-ros2-distro: ${{ matrix.ros_distro }}
vcs-repo-file-url: /tmp/deps.repos vcs-repo-file-url: /tmp/deps.repos
rosdep-skip-keys: "${{ matrix.skip_keys }}" rosdep-skip-keys: "${{ matrix.skip_keys }}"
@@ -29,7 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define MSGCONVERSION_H_ #define MSGCONVERSION_H_
#include "rclcpp/time.hpp" #include "rclcpp/time.hpp"
#include "tf2_ros/buffer.h" #include "tf2_ros/buffer.hpp"
#include <geometry_msgs/msg/transform.hpp> #include <geometry_msgs/msg/transform.hpp>
#include <geometry_msgs/msg/pose.hpp> #include <geometry_msgs/msg/pose.hpp>
#include <geometry_msgs/msg/pose_with_covariance_stamped.hpp> #include <geometry_msgs/msg/pose_with_covariance_stamped.hpp>
+27 -2
View File
@@ -1,2 +1,27 @@
# Copyright 2025 matlabbe
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of the matlabbe nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+56 -12
View File
@@ -1,8 +1,38 @@
# Copyright 2025 matlabbe
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of the matlabbe nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
import zlib
import struct import struct
import zlib
import numpy as np import numpy as np
def compress(data): def compress(data):
assert data.ndim == 1 or data.ndim == 2 assert data.ndim == 1 or data.ndim == 2
@@ -14,21 +44,35 @@ def compress(data):
dim1 = data.shape[0] dim1 = data.shape[0]
dim2 = data.shape[1] dim2 = data.shape[1]
numpy_type_to_cvtype = {'uint8': 0, 'int8': 1, 'uint16': 2, numpy_type_to_cvtype = {
'int16': 3, 'int32': 4, 'float32': 5, 'uint8': 0,
'float64': 6} 'int8': 1,
'uint16': 2,
'int16': 3,
'int32': 4,
'float32': 5,
'float64': 6,
}
compressed_data = bytearray(zlib.compress(data.tobytes())) compressed_data = bytearray(zlib.compress(data.tobytes()))
compressed_data.extend(struct.pack("iii", dim1, dim2, numpy_type_to_cvtype[data.dtype.name])) compressed_data.extend(
struct.pack('iii', dim1, dim2, numpy_type_to_cvtype[data.dtype.name])
)
return compressed_data return compressed_data
def uncompress(bytes):
cvtype_to_numpy_type = {0: 'uint8', 1: 'int8', 2: 'uint16', def uncompress(data):
3: 'int16', 4: 'int32', 5: 'float32', cvtype_to_numpy_type = {
6: 'float64'} 0: 'uint8',
out = zlib.decompress(bytes[:len(bytes)-3*4]) 1: 'int8',
rows, cols, datatype = struct.unpack_from("iii", bytes, offset=len(bytes)-3*4) 2: 'uint16',
3: 'int16',
4: 'int32',
5: 'float32',
6: 'float64',
}
out = zlib.decompress(data[: len(data) - 3 * 4])
rows, cols, datatype = struct.unpack_from('iii', data, offset=len(data) - 3 * 4)
data = np.frombuffer(out, dtype=cvtype_to_numpy_type[datatype]) data = np.frombuffer(out, dtype=cvtype_to_numpy_type[datatype])
return data.reshape((rows, cols)) return data.reshape((rows, cols))
+2 -2
View File
@@ -15,11 +15,11 @@ setup(
zip_safe=True, zip_safe=True,
maintainer='Mathieu Labbe', maintainer='Mathieu Labbe',
maintainer_email='[email protected]', maintainer_email='[email protected]',
description='RTAB-Map\'s python package.', description="RTAB-Map's python package.",
license='BSD', license='BSD',
tests_require=['pytest'], tests_require=['pytest'],
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
], ],
}, },
) )
+1
View File
@@ -26,6 +26,7 @@
<exec_depend>rtabmap_sync</exec_depend> <exec_depend>rtabmap_sync</exec_depend>
<exec_depend>rtabmap_util</exec_depend> <exec_depend>rtabmap_util</exec_depend>
<exec_depend>rtabmap_viz</exec_depend> <exec_depend>rtabmap_viz</exec_depend>
<exec_depend>rtabmap_costmap_plugins</exec_depend>
<export> <export>
<build_type>ament_cmake</build_type> <build_type>ament_cmake</build_type>
+1 -3
View File
@@ -18,6 +18,7 @@ find_package(ament_cmake_ros REQUIRED)
find_package(pcl_conversions REQUIRED) find_package(pcl_conversions REQUIRED)
find_package(pluginlib REQUIRED) find_package(pluginlib REQUIRED)
find_package(rclcpp REQUIRED) find_package(rclcpp REQUIRED)
find_package(QT NAMES Qt5 QUIET COMPONENTS Widgets)
find_package(rviz_common REQUIRED) find_package(rviz_common REQUIRED)
find_package(rviz_rendering REQUIRED) find_package(rviz_rendering REQUIRED)
find_package(rviz_default_plugins REQUIRED) find_package(rviz_default_plugins REQUIRED)
@@ -45,9 +46,6 @@ SET(Libraries
rtabmap_msgs rtabmap_msgs
) )
MESSAGE(STATUS "rtabmap_conversions=${rtabmap_conversions_LIBRARIES}")
########### ###########
## Build ## ## Build ##
########### ###########