Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Jun 19, 2023
2 parents c36ae76 + 54f9de0 commit 809a6c3
Show file tree
Hide file tree
Showing 431 changed files with 9,517 additions and 5,758 deletions.
2 changes: 1 addition & 1 deletion .lgtm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extraction:
- "libopencv-dev"
- "libeigen3-dev"
- "libgtest-dev"
- "libftdi-dev"
- "libftdi1-dev"
- "freeglut3-dev"
- "zlib1g-dev"
- "libusb-1.0-0-dev"
Expand Down
2 changes: 1 addition & 1 deletion apps/mrpt-performance/perf-icp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ double icp_test_1(int a1, int a2)
}

#if 0
mapBuilder.getCurrentlyBuiltMetricMap()->saveMetricMapRepresentationToFile( format("icp_%i_result",a1) );
mapBuilder.getCurrentlyBuiltMetricMap().saveMetricMapRepresentationToFile( format("icp_%i_result",a1) );
#endif

if (!step) step++;
Expand Down
9 changes: 0 additions & 9 deletions apps/robot-map-gui/gui/configWidget/CLandmarksConfig.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2323,16 +2323,7 @@
</layout>
<zorder>beaconRangesUseObservationStd</zorder>
<zorder>label_5</zorder>
<zorder>layoutWidget_13</zorder>
<zorder>groupBox</zorder>
<zorder>layoutWidget_15</zorder>
<zorder>layoutWidget_16</zorder>
<zorder>layoutWidget_17</zorder>
<zorder>layoutWidget_18</zorder>
<zorder>layoutWidget_20</zorder>
<zorder>layoutWidget_21</zorder>
<zorder>layoutWidget_22</zorder>
<zorder>layoutWidget_23</zorder>
<zorder>groupBox_2</zorder>
</widget>
</widget>
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.1-{branch}-build{build}
version: 2.9.2-{branch}-build{build}

os: Visual Studio 2019

Expand Down
50 changes: 21 additions & 29 deletions cmakemodules/DeclareMRPTLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,37 +54,19 @@ endfunction()
macro(mrpt_ament_cmake_python_get_python_install_dir)
if(NOT DEFINED PYTHON_INSTALL_DIR)
# avoid storing backslash in cached variable since CMake will interpret it as escape character
# (JLBC,May2023): Replaced "purelib" -> "platstdlib" below to get rid of the "/local/" path prefix.
if(NOT DEFINED ENV{ROS_DISTRO})
# For debian packages: /usr/lib/python3/dist-packages/
# Read debates online:
# - https://stackoverflow.com/questions/122327/how-do-i-find-the-location-of-my-python-site-packages-directory
# - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998739
#

# (JLBC,June 2023): *Hack* to comply with ROS conventions of storing python pkgs differently than Debian/Ubuntu standards.
if(NOT DEFINED ENV{ROS_VERSION})
# Regular Debian package.
set(_output "lib/python3/dist-packages/") # this is prefixed with "/usr/"
elseif("$ENV{ROS_VERSION}" STREQUAL "1")
# ROS 1
set(_output "lib/python3/dist-packages/") # this is prefixed with "/opt/ros/xxx/"
elseif("$ENV{ROS_VERSION}" STREQUAL "2")
# ROS 2
set(_output "lib/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/") # this is prefixed with "/opt/ros/xxx/"
else()
# For ROS packages /usr/local/lib/python3...
set(_python_code
"import os"
"import sysconfig"
"print(os.path.relpath(sysconfig.get_path('purelib', vars={'base': '${CMAKE_INSTALL_PREFIX}'}), start='${CMAKE_INSTALL_PREFIX}').replace(os.sep, '/'))"
)
# JL Was: get_executable_path(_python_interpreter Python3::Interpreter CONFIGURE)
set(_python_interpreter ${Python3_EXECUTABLE})
execute_process(
COMMAND
"${_python_interpreter}"
"-c"
"${_python_code}"
OUTPUT_VARIABLE _output
RESULT_VARIABLE _result
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT _result EQUAL 0)
message(FATAL_ERROR
"execute_process(${_python_interpreter} -c '${_python_code}') returned "
"error code ${_result}")
endif()
message(FATAL_ERROR "Unhandled value for ENV{ROS_VERSION}=$ENV{ROS_VERSION}")
endif()

set(PYTHON_INSTALL_DIR
Expand Down Expand Up @@ -252,6 +234,16 @@ macro(internal_define_mrpt_lib name headers_only )
target_compile_definitions(${name} PUBLIC _USE_MATH_DEFINES)
endif()

# Includes: <mrpt/config.h> & <mrpt/version.h> config headers:
# These are PRIVATE include to enforce including BEFORE any other headers,
# e.g. another mrpt instance installed under /opt/ros/${ROS_DISTRO} while building a local copy
# Note that there is another PUBLIC dep on the same headers for mrpt-core only, so user code
# sees those files too.
target_include_directories(${name} BEFORE PRIVATE
$<BUILD_INTERFACE:${MRPT_CONFIG_FILE_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>
)

# for gcc and clang, we must build libraries as fPIC:
if(NOT MSVC)
target_compile_options(${name} PRIVATE "-fPIC")
Expand Down
2 changes: 1 addition & 1 deletion cmakemodules/script_show_final_summary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ message(STATUS " _______________________ WRAPPERS/BINDINGS _____________________
SHOW_CONFIG_LINE_SYSTEM("Matlab / mex files " CMAKE_MRPT_HAS_MATLAB "[Version: ${MATLAB_VERSION}]")
SHOW_CONFIG_LINE("Python3 wrappers " CMAKE_MRPT_HAS_PYTHON_BINDINGS "[pybind11: ${pybind11_VERSION}]")
SHOW_CONFIG_LINE("Python3 interpreter found " Python3_FOUND "[Version: ${Python3_VERSION}]")
if ($ENV{VERBOSE})
if (("$ENV{VERBOSE}") OR ("$ENV{HOME}" STREQUAL "/home/buildfarm"))
message(STATUS "CMAKE_INSTALL_PREFIX : ${CMAKE_INSTALL_PREFIX}")
message(STATUS "DESTDIR : ${DESTDIR}")
message(STATUS "Python3_SITELIB : ${Python3_SITELIB}")
Expand Down
2 changes: 1 addition & 1 deletion doc/source/compiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Minimum compiler requisites:
libxrandr-dev libxxf86vm-dev
# Support most common sensors:
sudo apt install libftdi-dev libusb-1.0-0-dev libudev-dev libfreenect-dev \
sudo apt install libftdi1-dev libusb-1.0-0-dev libudev-dev libfreenect-dev \
libdc1394-22-dev libavformat-dev libswscale-dev libpcap-dev \
liboctomap-dev libopenni2-dev
Expand Down
21 changes: 21 additions & 0 deletions doc/source/doxygen-docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
\page changelog Change Log

# Version 2.9.2: Released June 20th, 2023
- Changes in docs:
- Update dependency in instructions from `libftdi-dev` to `libftdi1-dev`
- Changes in libraries:
- \ref mrpt_comms_grp
- mrpt::comms::CInterfaceFTDI Fix usage of deprecated API in libftdi
- \ref mrpt_obs_grp
- New static method mrpt::obs::CRawlog::ReadFromArchive() (useful for python bindings)
- New overload mrpt::obs::obs_to_viz() for mrpt::obs::CSensoryFrame containers
- \ref mrpt_slam_grp
- mrpt::slam::CMetricMapBuilder::getCurrentlyBuiltMetricMap() returns a const ref instead of a pointer (safer, and does not lead to memory crashes in the Python wrapper).
- Python:
- New wrapped functions:
- `mrpt.serialization.archiveFrom()`
- Fix python install directory:
- ROS 1 or pure Debian: `[...]/lib/python3/site-packages/`
- ROS 2: `[...]/lib/python3.X/site-packages/`
- BUG FIXES:
- Fixed including the wrong `<mrpt/config.h>` if building MRPT in a system with another ROS-provided MRPT build.
- Fixed build errors with gcc-13 (Fixes [Debian bug #1037783](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1037783))

# Version 2.9.1: Release June 14th, 2023
- Build system:
- ROS 2: fix missing explicit dep on rclcpp in package.xml.
Expand Down
6 changes: 4 additions & 2 deletions doc/source/examples.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
.. _examples:

===============
Code examples
C++ examples
===============

The source code for all these C++ examples can be found
under `MRPT/samples <https://github.com/MRPT/mrpt/tree/develop/samples>`_.
Python examples are under `MRPT/python-examples <https://github.com/MRPT/mrpt/tree/develop/python-examples>`_.

Python examples are `here <python_examples.html>`_.


.. toctree::
:maxdepth: 1
Expand Down
1 change: 1 addition & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ MRPT
tutorials
applications
examples
python_examples
wrappers
supported-sensors
unit_testing
Expand Down
20 changes: 20 additions & 0 deletions doc/source/pymrpt_example_global_localization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. _pyexample_global_localization:

====================================================
Python example: global_localization.py
====================================================

This example runs a MonteCarlo global localization
algorithm for a robot from a dataset in .rawlog format.
The adaptive particle filter algorithm has two implementations,
for 2D and 3D poses, or SE(2) or SE(3), respectively.

.. raw:: html

<iframe width="560" height="315" src="https://www.youtube.com/embed/ZfVUydQIM5E" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen>
</iframe>


.. literalinclude:: ../../python-examples/global_localization.py
:language: python
:linenos:
18 changes: 18 additions & 0 deletions doc/source/pymrpt_example_hwdriver_tao_imu_usb.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. _pyexample_hwdriver_tao_imu_usb:

====================================================
Python example: hwdriver-tao-imu-usb.py
====================================================

This example shows how to read a Taobotics USB IMU
with the pymrpt hwdrivers module.

.. raw:: html

<iframe width="560" height="315" src="https://www.youtube.com/embed/qaaP9BmZYmo" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen>
</iframe>


.. literalinclude:: ../../python-examples/hwdriver-tao-imu-usb.py
:language: python
:linenos:
11 changes: 11 additions & 0 deletions doc/source/pymrpt_example_lines-3d-geometry-example.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _pyexample_lines-3d-geometry-example:

====================================================
Python example: lines-3d-geometry-example.py
====================================================

This example illustrates some geometry functions:

.. literalinclude:: ../../python-examples/lines-3d-geometry-example.py
:language: python
:linenos:
18 changes: 18 additions & 0 deletions doc/source/pymrpt_example_rbpf_slam.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. _pyexample_rbpf_slam:

====================================================
Python example: rbpf_slam.py
====================================================

This example shows how to build a metric map using
the RBPF-SLAM algorithm:

.. raw:: html

<iframe width="560" height="315" src="https://www.youtube.com/embed/XiKTWNOQlcU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen>
</iframe>


.. literalinclude:: ../../python-examples/rbpf_slam.py
:language: python
:linenos:
12 changes: 12 additions & 0 deletions doc/source/pymrpt_example_se2-poses-example.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _pyexample_se2-poses-example:

====================================================
Python example: se2-poses-example.py
====================================================

Example usage of SE(2) poses, for transformations
in the plane (x,y,phi):

.. literalinclude:: ../../python-examples/se2-poses-example.py
:language: python
:linenos:
12 changes: 12 additions & 0 deletions doc/source/pymrpt_example_se3-poses-example.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _pyexample_se3-poses-example:

====================================================
Python example: se3-poses-example.py
====================================================

Example usage of SE(3) poses, for transformations
in the space (x,y,z,yaw,pitch,roll):

.. literalinclude:: ../../python-examples/se3-poses-example.py
:language: python
:linenos:
21 changes: 21 additions & 0 deletions doc/source/python_examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. _python_examples:

=================
Python examples
=================

The source code for all these Python examples can be found
under `MRPT/python-examples <https://github.com/MRPT/mrpt/tree/develop/python-examples>`_.

C++ examples are `here <examples.html>`_.


.. toctree::
:maxdepth: 1

pymrpt_example_global_localization.rst
pymrpt_example_hwdriver_tao_imu_usb.rst
pymrpt_example_lines-3d-geometry-example.rst
pymrpt_example_rbpf_slam.rst
pymrpt_example_se2-poses-example.rst
pymrpt_example_se3-poses-example.rst
2 changes: 1 addition & 1 deletion doc/source/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ All MRPT libraries are wrapped into one single Python3 module `pymrpt`.
See:

- pydoc reference documentation for pymrpt: https://mrpt.github.io/pymrpt-docs/mrpt.pymrpt.mrpt.html
- MRPT Python examples: https://github.com/MRPT/mrpt/tree/develop/python-examples
- MRPT `Python examples <python_examples.html>`_


3. Matlab
Expand Down
10 changes: 5 additions & 5 deletions libs/apps/src/ICP_SLAM_App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void ICP_SLAM_App_Base::run()
f_log.printf(
"%f %i\n", 1000.0f * t_exec, mapBuilder.getCurrentlyBuiltMapSize());

const CMultiMetricMap* mostLikMap =
const CMultiMetricMap& mostLikMap =
mapBuilder.getCurrentlyBuiltMetricMap();

if (LOG_FREQUENCY > 0 && 0 == (step % LOG_FREQUENCY))
Expand Down Expand Up @@ -335,10 +335,10 @@ void ICP_SLAM_App_Base::run()
}

// The maps:
view->insert(mostLikMap->getVisualization());
view->insert(mostLikMap.getVisualization());

// Only the point map:
if (auto pMap = mostLikMap->mapByClass<CPointsMap>(); pMap)
if (auto pMap = mostLikMap.mapByClass<CPointsMap>(); pMap)
view_map->insert(pMap->getVisualization());

// Draw the robot path:
Expand Down Expand Up @@ -444,11 +444,11 @@ void ICP_SLAM_App_Base::run()
}

{
const CMultiMetricMap* finalPointsMap =
const CMultiMetricMap& finalPointsMap =
mapBuilder.getCurrentlyBuiltMetricMap();
auto str = format("%s/_finalmaps_.txt", OUT_DIR);
MRPT_LOG_INFO_FMT("Dumping final metric maps to %s_XXX\n", str.c_str());
finalPointsMap->saveMetricMapRepresentationToFile(str);
finalPointsMap.saveMetricMapRepresentationToFile(str);
}

if (win3D) win3D->waitForKey();
Expand Down
6 changes: 6 additions & 0 deletions libs/comms/src/CInterfaceFTDI_LIN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,14 @@ void CInterfaceFTDI::Purge()
auto* ctx = static_cast<ftdi_context*>(m_ftdi_context);
ASSERT_(ctx->usb_dev);

#if MRPT_FTDI_VERSION >= 0x120
if (ftdi_tcioflush(ctx) < 0)
#else
if (ftdi_usb_purge_buffers(ctx) < 0)
#endif
{
THROW_EXCEPTION("Error purging device buffers");
}

m_readBuffer.clear();
#endif
Expand Down
1 change: 1 addition & 0 deletions libs/containers/include/mrpt/containers/CDynamicGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include <cmath>
#include <cstddef>
#include <cstdint>
#include <string>
#include <vector>

Expand Down
3 changes: 1 addition & 2 deletions libs/containers/src/yaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1134,8 +1134,7 @@ void yaml::comment(const std::string& c, CommentPosition position)
}

// --- key node comments API ---
const yaml::node_t& findKeyNode(
const yaml::node_t* me, const std::string_view& key)
const yaml::node_t& findKeyNode(const yaml::node_t* me, const std::string& key)
{
const auto& m = me->asMap();
auto itK = m.find(key);
Expand Down
2 changes: 1 addition & 1 deletion libs/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ define_mrpt_lib(

if(BUILD_mrpt-core)
# Includes: <mrpt/config.h> & <mrpt/version.h> config headers:
target_include_directories(core PUBLIC
target_include_directories(core BEFORE PUBLIC
$<BUILD_INTERFACE:${MRPT_CONFIG_FILE_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>
)
Expand Down
1 change: 1 addition & 0 deletions libs/core/include/mrpt/core/bits_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include <algorithm> // max()
#include <cmath> // floor(),isnan(),...
#include <cstdint>
#include <stdexcept>

namespace mrpt
Expand Down
1 change: 1 addition & 0 deletions libs/io/include/mrpt/io/vector_loadsave.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
+------------------------------------------------------------------------+ */
#pragma once

#include <cstdint>
#include <string>
#include <vector>

Expand Down
Loading

0 comments on commit 809a6c3

Please sign in to comment.