Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Jul 1, 2023
2 parents eb8a290 + 899b6e6 commit 93af46d
Show file tree
Hide file tree
Showing 71 changed files with 32,817 additions and 38 deletions.
29 changes: 15 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,23 @@
# 2007-2021, Jose Luis Blanco <jlblanco@ual.es>
# ----------------------------------------------------------------------------

if (POLICY CMP0048)
# cmake warns if loaded from a min-3.x-required parent dir:
# -------------------------
# Setup CMake
# -------------------------
# Minimum version required for:
# - target_compile_features() => 3.8.0
# - cmakemodules/ECMFindModuleHelpers.cmake:112 => 3.16.0 (Available in Ubuntu >=20.04)
cmake_minimum_required(VERSION 3.16.0)

if (POLICY CMP0048) # cmake warns if loaded from a min-3.x-required parent dir:
cmake_policy(SET CMP0048 NEW)
endif()
if (POLICY CMP0075) # CheckIncludeFile: Yes, we will set "CMAKE_REQUIRED_LIBRARIES".
cmake_policy(SET CMP0075 NEW)
endif()
if (POLICY CMP0135) # The DOWNLOAD_EXTRACT_TIMESTAMP option was not given
cmake_policy(SET CMP0135 NEW)
endif()

# Tell CMake we'll use both C & C++ for use in its tests/flags.
project(MRPT LANGUAGES C CXX)
Expand All @@ -31,18 +44,6 @@ if (DEFINED CACHE{CMAKE_BUILD_TYPE})
"Debug" "Release" "MinSizeRel" "RelWithDebInfo" "Coverage" "SanitizeAddress" "SanitizeThread")
endif()

# -------------------------
# Setup CMake
# -------------------------
# Minimum version required for:
# - target_compile_features() => 3.8.0
# - cmakemodules/ECMFindModuleHelpers.cmake:112 => 3.16.0 (Available in Ubuntu >=20.04)
cmake_minimum_required(VERSION 3.16.0)

# CheckIncludeFile: Yes, we will set "CMAKE_REQUIRED_LIBRARIES".
if (POLICY CMP0075)
cmake_policy(SET CMP0075 NEW)
endif()

if ((NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/nanogui/include")
OR (NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/rplidar_sdk/sdk/sdk")
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# version format
version: 2.9.3-{branch}-build{build}
version: 2.9.4-{branch}-build{build}

os: Visual Studio 2019

Expand Down
10 changes: 10 additions & 0 deletions doc/source/doxygen-docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
\page changelog Change Log

# Version 2.9.4: Released July 1st, 2023
- Python:
- pymrpt now ships stub `.pyi` files, for IDEs to autocomplete MRPT Python programs.
- maps and multimaps are iterable again (Fixes a regression in v2.9.3)
- timestamps now has a `__str__` operator and `to_double()` method.
- Build system:
- Fix several modern cmake warnings.
- BUG FIXES:
- Fix fail to build with libftdi1 v1.4 (Ubuntu Focal).

# Version 2.9.3: Released June 22nd, 2023
- Python:
- New module pymrpt.ros_bridge
Expand Down
2 changes: 1 addition & 1 deletion libs/comms/src/CInterfaceFTDI_LIN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ void CInterfaceFTDI::Purge()
auto* ctx = static_cast<ftdi_context*>(m_ftdi_context);
ASSERT_(ctx->usb_dev);

#if MRPT_FTDI_VERSION >= 0x120
#if MRPT_FTDI_VERSION >= 0x150
if (ftdi_tcioflush(ctx) < 0)
#else
if (ftdi_usb_purge_buffers(ctx) < 0)
Expand Down
3 changes: 2 additions & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<package format="3">
<name>mrpt2</name>
<!-- Before updating version number, read [MRPT_ROOT]/version_prefix.txt first -->
<version>2.9.3</version>
<version>2.9.4</version>
<description>Mobile Robot Programming Toolkit (MRPT) version 2.x</description>

<author email="joseluisblancoc@gmail.com">Jose-Luis Blanco-Claraco</author>
Expand Down Expand Up @@ -47,6 +47,7 @@
<build_depend>libudev-dev</build_depend>
<build_depend>libusb-1.0-dev</build_depend>
<build_depend>pybind11-dev</build_depend>
<build_depend>python3-pip</build_depend>
<build_depend>tinyxml2</build_depend>
<build_depend>wx-common</build_depend>
<build_depend>wxwidgets</build_depend>
Expand Down
11 changes: 4 additions & 7 deletions parse-files/install-python.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@ else()
endif()

set(cmd_
@Python3_EXECUTABLE@ @MRPT_PYTHON_BUILD_DIRECTORY@/setup.py
install
--root=${INSTALL_ROOT_DIR}
--install-lib=@PYTHON_INSTALL_DIR@
--install-layout=deb
--single-version-externally-managed
@Python3_EXECUTABLE@ -m pip install .
--target=${INSTALL_ROOT_DIR}/@PYTHON_INSTALL_DIR@
--ignore-installed
)


string(REPLACE ";" " " _cmd_print "${cmd_}")
message(STATUS "Running: ${_cmd_print}")

Expand All @@ -28,3 +24,4 @@ execute_process(COMMAND ${cmd_}
if(result)
message(FATAL_ERROR "CMake step for installing python modules failed: ${result}")
endif()

9 changes: 8 additions & 1 deletion parse-files/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ package_data = {
'': [
'./*.so',
'./*.dll',
'./py.typed',
# Install .pyi stub files:
'./*.pyi',
'./pymrpt/*',
'./pymrpt/*/*',
'./pymrpt/*/*/*',
'./pymrpt/*/*/*/*'
]
}

Expand All @@ -26,7 +33,7 @@ python_install_dir="${PYTHON_INSTALL_DIRECTORY}"
sys.path.insert(0, python_install_dir)

setup(
name='MRPT',
name='mrpt',
description='Mobile Robot Programming Toolkit (MRPT)',
url='https://github.com/MRPT/mrpt',
version='${CMAKE_MRPT_FULL_VERSION}', # https://www.python.org/dev/peps/pep-0440/
Expand Down
1 change: 1 addition & 0 deletions python-examples/hwdriver-tao-imu-usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
print('Time={} obs={}'.format(timestamp, obs.asString()))

# You can access individual IMU readings with:
# o = mrpt.obs.CObservationIMU(obs)
# angVel_z = o.get(mrpt.obs.TIMUDataIndex.IMU_WZ)
#
# See: https://docs.mrpt.org/reference/latest/enum_mrpt_obs_TIMUDataIndex.html
5 changes: 3 additions & 2 deletions python-examples/lines-3d-geometry-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
TPoint3D = mrpt.math.TPoint3D_double_t
TLine3D = mrpt.math.TLine3D

l1 = TLine3D.FromTwoPoints(TPoint3D(0, 0, 0), TPoint3D(1, 0, 0))
l2 = TLine3D.FromTwoPoints(TPoint3D(1, 1, 1), TPoint3D(2, 2, 0))
l1: TLine3D = TLine3D.FromTwoPoints(TPoint3D(0, 0, 0), TPoint3D(1, 0, 0))
l2: TLine3D = TLine3D.FromTwoPoints(TPoint3D(1, 1, 1), TPoint3D(2, 2, 0))

print('l1 : ' + str(l1))
print('l2 : ' + str(l2))
print('dist(l1,l2) : ' + str(mrpt.math.distance(l1, l2)))
print('l1.director : ' + l1.getDirectorVector().asString())
9 changes: 9 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ add_custom_command(TARGET pymrpt POST_BUILD
file(WRITE ${MRPT_PYTHON_BUILD_DIRECTORY}/mrpt/__init__.py
"from . import *")

# Required if we provide the stub files: ( https://peps.python.org/pep-0561/ )
file(WRITE ${MRPT_PYTHON_BUILD_DIRECTORY}/mrpt/py.typed "")

# install stub files too:
file(COPY
${CMAKE_CURRENT_LIST_DIR}/stubs-out/
DESTINATION ${MRPT_PYTHON_BUILD_DIRECTORY}/
)

# copy ROS stuff
file(COPY
${CMAKE_CURRENT_LIST_DIR}/ros_bridge.py
Expand Down
9 changes: 5 additions & 4 deletions python/generate-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ $HOME/code/binder/build/source/binder \
-I$HOME/code/mrpt/libs/typemeta/include \
-I$HOME/code/mrpt/libs/vision/include/ \

# applying manual patches:
echo "Applying manual patches..."
find . -name "*.diff" | xargs -I FIL bash -c "git apply FIL"

# Workarounds to binder limitations:
# These are to ensure multiplatform portatbility of generated code
# (e.g. avoid build errors in armhf)
Expand All @@ -96,4 +92,9 @@ sed -i -e 's/unsigned long/size_t/g' $WRAP_OUT_DIR/std/stl_multimap.cpp
find $WRAP_OUT_DIR -name "*.cpp" | xargs -I FIL \
sed -i -e 's/(long)/(int64_t)/g' FIL

# applying manual patches:
echo "Applying manual patches..."
find . -name "*.diff" | xargs -I FIL bash -c "git apply FIL"

# Generate stub .pyi files:
stubgen -p mrpt -p mrpt.pymrpt -o stubs-out
Loading

0 comments on commit 93af46d

Please sign in to comment.