Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Sep 24, 2022
2 parents 3205059 + c177d2f commit e84151b
Show file tree
Hide file tree
Showing 46 changed files with 662 additions and 147 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/nanogui
41 changes: 22 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@ endif()
# Tell CMake we'll use both C & C++ for use in its tests/flags.
project(MRPT LANGUAGES C CXX)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(default_build_type "Release")
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo" "Coverage")
endif()

# -------------------------
# Setup CMake
# -------------------------
if (WIN32)
cmake_minimum_required(VERSION 3.4) # required for CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
else()
cmake_minimum_required(VERSION 3.3)
endif()
# Minimum version required for:
# - target_compile_features() => 3.8.0
cmake_minimum_required(VERSION 3.8)

# CheckIncludeFile: Yes, we will set "CMAKE_REQUIRED_LIBRARIES".
if (POLICY CMP0075)
Expand Down Expand Up @@ -379,9 +387,9 @@ if(CMAKE_COMPILER_IS_GNUCXX)
# High level of warnings.
# The -Wno-long-long is required in 64bit systems when including sytem headers.
# The -Wno-variadic-macros was needed for Eigen3, StdVector.h
add_compile_options(${CMAKE_CONFIGURE_CFLAGS} -Wall -Wno-long-long -Wno-variadic-macros -Wshadow)
add_compile_options(-Wreturn-local-addr -Werror=return-local-addr)
add_compile_options(-Wno-psabi)
add_compile_options(-Wall -Wno-long-long -Wno-variadic-macros -Wshadow)
add_compile_options(-Wreturn-local-addr -Werror=return-local-addr)
add_compile_options(-Wno-psabi)

# Workaround: Eigen <3.4 produces *tons* of warnings in GCC >=6. See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221
if (NOT ${CMAKE_CXX_COMPILER_VERSION} LESS "6.0" AND "${MRPT_EIGEN_VERSION}" VERSION_LESS "3.4")
Expand All @@ -392,14 +400,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
# This causes the option "-Wnowrite-strings" to be set on gcc-4.9 on OS X
add_compile_options(-Wno-write-strings)
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CONFIGURE_CFLAGS}")

# Use "modern" C99 ! ;-)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
string(APPEND CMAKE_C_FLAGS " -std=c99")

if(MRPT_BUILD_GCC_PEDANTIC)
# Only for C++ sources:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
string(APPEND CMAKE_CXX_FLAGS " -pedantic")

# No need to be pendantic in old C files, most of them from 3rd parties anyway...
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic")
endif()
Expand All @@ -422,11 +430,9 @@ if (MRPT_COMPILER_IS_CLANG)

# High level of warnings.
# no-unused-private-field: clang seems to complain in templates without reason.
add_compile_options(${CMAKE_CONFIGURE_CFLAGS} -Wall -Wabi -Wno-unused-private-field -Wshadow-all)
add_compile_options(-Wall -Wabi -Wno-unused-private-field -Wshadow-all)
add_compile_options(-Wreturn-stack-address -Werror=return-stack-address)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CONFIGURE_CFLAGS}")

# Use "modern" C99 ! ;-)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")

Expand Down Expand Up @@ -490,7 +496,8 @@ if (MRPT_COMPILER_IS_GCC_OR_CLANG)
# If enabled, and NOT in an arch that doesn't support the flag:
if(MRPT_TUNE_NATIVE AND
(NOT "${CMAKE_MRPT_ARCH}" STREQUAL "riscv64") AND
(NOT "${CMAKE_MRPT_ARCH}" STREQUAL "parisc64") # hppa
(NOT "${CMAKE_MRPT_ARCH}" STREQUAL "parisc64") AND # hppa
(NOT "${CMAKE_MRPT_ARCH}" STREQUAL "parisc") # hppa
)
add_compile_options(-mtune=native)
endif()
Expand All @@ -506,10 +513,6 @@ if (MRPT_COMPILER_IS_GCC_OR_CLANG)
endif()
endif()

if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-O3)
endif()

# Was: add_compile_options(-mfpmath=sse)
# No need to add this flag: it's enabled by default in 64bit builds.

Expand Down
3 changes: 1 addition & 2 deletions apps/2d-slam-demo/slamdemoMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1930,8 +1930,7 @@ void slamdemoFrame::executeOneStep()
}

// Save historic data ------------------------
m_historicData.emplace_back();
THistoric& hist = m_historicData.back();
THistoric& hist = m_historicData.emplace_back();

hist.GT_robot_pose = m_GT_pose;
m_SLAM.getCurrentRobotPose(hist.estimate_robot_pose);
Expand Down
12 changes: 2 additions & 10 deletions apps/RawLogViewer/CRawlogTreeView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,14 @@ void CRawlogTreeView::setRawlogSource(CRawlog* theRawlog)
/* ------------------------------------------------------------
reloadFromRawlog
------------------------------------------------------------ */
void CRawlogTreeView::reloadFromRawlog(int hint_rawlog_items)
void CRawlogTreeView::reloadFromRawlog()
{
// Recompute the total height of the scroll area:
// We also compute a list for each index with:
// - Pointer to data
// - level in the hierarchy (0,1,2)
// --------------------------------------------------------

if (m_rawlog)
{
if (hint_rawlog_items < 0) m_tree_nodes.reserve(m_rawlog->size() + 100);
else
m_tree_nodes.reserve(hint_rawlog_items + 100);
}

// Create a "tree node" for each element in the rawlog:
// ---------------------------------------------------------
m_tree_nodes.clear();
Expand All @@ -137,8 +130,7 @@ void CRawlogTreeView::reloadFromRawlog(int hint_rawlog_items)
m_rawlog_last = INVALID_TIMESTAMP;

// Root:
m_tree_nodes.emplace_back();
m_tree_nodes.back().level = 0;
m_tree_nodes.emplace_back().level = 0;

auto lambdaCheckTimestamp = [this](const mrpt::Clock::time_point& t) {
if (t == INVALID_TIMESTAMP) return;
Expand Down
10 changes: 5 additions & 5 deletions apps/RawLogViewer/CRawlogTreeView.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ class CRawlogTreeView : public wxScrolledWindow

/** Sets the name of the rawlog file, used for the root item */
void setRawlogName(const std::string& s) { m_rawlog_name = s; }

/** Reloads from the rawlog: it adapts the size of the scroll window and
* refresh the view.
*/
void reloadFromRawlog(int hint_rawlog_items = -1);
* refresh the view */
void reloadFromRawlog();

/** Sets a handler for the event of selected item changes.
*/
Expand Down Expand Up @@ -115,7 +115,7 @@ class CRawlogTreeView : public wxScrolledWindow
size_t m_firstVisibleItem = 0, m_lastVisibleItem = 0;
size_t getTotalTreeNodes() const { return m_tree_nodes.size(); }

const std::vector<TNodeData>& treeNodes() const { return m_tree_nodes; }
const std::deque<TNodeData>& treeNodes() const { return m_tree_nodes; }

bool isItemIndexVisible(size_t idx) const;

Expand All @@ -140,7 +140,7 @@ class CRawlogTreeView : public wxScrolledWindow

/** The nuimber of rows to display for the rawlog, used to compute the
* height */
std::vector<TNodeData> m_tree_nodes;
std::deque<TNodeData> m_tree_nodes;

/** Returns an icon index depending on the class of the object in the tree
* view
Expand Down
3 changes: 2 additions & 1 deletion apps/mrpt-performance/run_build_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ bool func_comp_entries(const TPerfField& a, const TPerfField& b)
int run_build_tables()
{
using namespace std;
using namespace std::string_literals;
using namespace mrpt;
using namespace mrpt::system;
using namespace mrpt::serialization;
Expand Down Expand Up @@ -72,7 +73,7 @@ int run_build_tables()
std::sort(
lstConfigurations.begin(), lstConfigurations.end(), func_comp_entries);

ASSERT_(directoryExists(PERF_DATA_DIR + string("/perf-html/")));
ASSERT_DIRECTORY_EXISTS_(PERF_DATA_DIR + "/perf-html/"s);
CFileOutputStream fo;
// ====================================================
// index.html
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.5.3-{branch}-build{build}
version: 2.5.4-{branch}-build{build}

os: Visual Studio 2019

Expand Down
9 changes: 2 additions & 7 deletions cmakemodules/DeclareMRPTLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,9 @@ function(mrpt_lib_target_requires_cpp17 _TARGET)
set(INTERF_TYPE "PUBLIC")
endif()

# Modern, clean way to do this:
target_compile_features(${_TARGET} ${INTERF_TYPE} cxx_std_17)

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.8.0")
# Modern, clean way to do this:
get_target_property(target_type ${_TARGET} TYPE)
target_compile_features(${_TARGET} ${INTERF_TYPE} cxx_std_17)
else()
message(FATAL_ERROR "MRPT requires CMake >=3.8.0 to build since MRPT 2.2.1, so libraries compile features regarding C++ versions are handled properly. For Ubuntu Xenial, check out e.g. this PPA: https://launchpad.net/~andrew-fuller/+archive/ubuntu/cmake/+packages")
endif()
endfunction()

# Minimize the time and memory required to build and load debug info:
Expand Down
4 changes: 0 additions & 4 deletions cmakemodules/script_clang_tidy.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
if (CMAKE_VERSION VERSION_GREATER "3.6.0")
find_program(
CLANG_TIDY_EXE
NAMES "clang-tidy"
Expand Down Expand Up @@ -27,6 +26,3 @@ else()
set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "${CLANG_TIDY_CHECKS}")
endif()
endif()
else()
message(STATUS "clang-tidy: not using. CMake version must be >=3.6")
endif()
6 changes: 1 addition & 5 deletions cmakemodules/script_gl_glut.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ if (POLICY CMP0072)
endif()
find_package(OpenGL)

if (NOT "${CMAKE_VERSION}" VERSION_LESS "3.8.2")
set(MRPT_GL_LIB OpenGL::GL)
else()
set(MRPT_GL_LIB ${OPENGL_gl_LIBRARY})
endif()
set(MRPT_GL_LIB OpenGL::GL)

# EGL:
if(CMAKE_VERSION VERSION_LESS 3.16.0)
Expand Down
14 changes: 10 additions & 4 deletions doc/source/compiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@ Minimum compiler requisites:
**Minimum recommended** requisites:

.. code-block:: bash
sudo apt install build-essential pkg-config cmake libwxgtk3.0-dev \
libwxgtk3.0-gtk3-dev libopencv-dev libeigen3-dev zlib1g-dev \
# All Ubuntu versions:
sudo apt install build-essential pkg-config cmake \
libopencv-dev libeigen3-dev zlib1g-dev \
libsuitesparse-dev libjpeg-dev
# plus, only for Ubuntu < 22.04:
sudo apt install libwxgtk3.0-gtk3-dev
# plus, only for Ubuntu >= 22.04:
sudo apt install libwxgtk3.2-dev
**Recommended additional** packages to enable most MRPT features:

Expand Down Expand Up @@ -75,7 +81,7 @@ Minimum compiler requisites:
libstd-srvs-dev libstereo-msgs-dev libtf2-dev \
libtf2-msgs-dev libbz2-dev
**ROS2 support:** Invoke your ROS2 distribution ``setup.bash``` as usual before
**ROS2 support:** Invoke your ROS2 distribution ``setup.bash`` as usual before
running MRPT cmake configure to enable building of
the `mrpt::ros2bridge <group_mrpt_ros2bridge_grp.html>`_ module.

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

# Version 2.5.4: Released September 24th, 2022
- Changes in libraries:
- \ref mrpt_opengl_grp
- mrpt::opengl::CFBORender is now faster, using a LUT for converting from logarithmic to linear depth values.
- \ref mrpt_ros1bridge_grp
- Implemented missing mrpt::ros1bridge::toROS() for point clouds.
- \ref mrpt_ros2bridge_grp
- Implemented missing mrpt::ros2bridge::toROS() for point clouds.
- BUG FIXES:
- Fix build on hppa for parisc architecture too (not supported flag `-mtune=native`)
- nanogui: Fix mismatched memory allocator/free in serialization code.
- Fix potential segfault in RawLogViewer while building the tree view.

# Version 2.5.3: Released September 6th, 2022
- Changes in libraries:
- \ref mrpt_gui_grp
Expand Down Expand Up @@ -42,7 +55,7 @@
- \ref mrpt_opengl_grp
- mrpt::opengl::CMesh supports having (x,y) limits with `maxCoord<minCoord` for flipped elevation and image meshes.
- New flag mrpt::opengl::CAssimpModel::LoadFlags::IgnoreMaterialColor for mrpt::opengl::CAssimpModel::loadScene()
- A new rendering mode for default no-perspective transformations.
- A new rendering mode for default no-perspective transformations.
See mrpt::opengl::CCamera::setNoProjection()
- \ref mrpt_poses_grp
- Add correct displacement covariance calculation between two poses with cross-correlation via new method mrpt::poses::CPose3DQuatPDFGaussian::inverseCompositionCrossCorrelation() (Closes [#1242](https://github.com/MRPT/mrpt/issues/1242))
Expand Down
2 changes: 1 addition & 1 deletion doc/source/doxygen-docs/lib_mrpt_serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ serialization mechanisms.

Serializing `shared_ptr<T>` is supported for any arbitrary type `T`. It is legal
to serialize an empty (`nullptr`) smart pointer; an empty pointer will be read
back. Polymorphic classes can be also writen and read, although reading a smart
back. Polymorphic classes can be also written and read, although reading a smart
pointer to a polymorphic base class is only supported for classes derived from
MRPT's CSerializable, since that operation requires registering types in a class
factory (see \a mrpt_rtti_grp and mrpt::serialization::CSerializable).
Expand Down
9 changes: 9 additions & 0 deletions doc/source/env-vars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ numerical value (e.g. ``1``) will be interpreted as "true".
- ``MRPT_EXPR_VERBOSE``: Set to ``1`` to enable extra verbose debug traces for
`mrpt::expr::CRuntimeCompiledExpression::eval() <class_mrpt_expr_CRuntimeCompiledExpression.html>`_.

- ``MRPT_FBORENDER_SHOW_DEVICES``: If set to ``true``,
`mrpt::opengl::CFBORender <class_mrpt_opengl_CFBORender.html>`_ will print the
number of detected GPU devices to the console upon constructions.

- ``MRPT_FBORENDER_USE_LUT``: If set to ``false``,
`mrpt::opengl::CFBORender <class_mrpt_opengl_CFBORender.html>`_ will never use
the discretized LUT to convert OpenGL depth values to linear distances, but
the exact (slower for large images) formula.

- ``MRPT_HWDRIVERS_DEFAULT_LEAP_SECONDS``: In mrpt::hwdrivers::CGPSInterface, the
default offset from GPS time to UTC time, for use before any GNSS especific
message informs on this offset. Default: 17 (valid for 01/2016)
Expand Down
Binary file added doc/source/images/demo_ROSLAM_symmetry1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 17 additions & 6 deletions doc/source/range_only_localization_mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Range-only Localization and Mapping Solutions

.. contents:: :local:

Range-only SLAM

1. Range-only SLAM
====================

MRPT at present offers one SLAM solution for RO-SLAM, integrated into the
Expand All @@ -17,7 +18,10 @@ Users can employ 2D or 3D poses in RBPF-SLAM, but notice that RO-SLAM with a RBP
requires a decent odometry as input, which can comprise 2D or 3D robot motion
actions.

Range-only Localization
.. image:: images/demo_ROSLAM_symmetry1.jpg
:alt: Range-Only SLAM with symmetry example

2. Range-only Localization
==========================

There are two implementations:
Expand All @@ -26,23 +30,30 @@ pf-localization
---------------------

The `pf-localization application <https://www.mrpt.org/list-of-mrpt-apps/application-pf-localization/>`_
is a CLI to the underlying C++ class from the library: \ref mrpt_apps_grp.
is a CLI to the underlying C++ class from the library `mrpt::apps <group_mrpt_apps_grp.html>`_.

Users can employ 2D or 3D odometry as input for 2D or 3D motion estimation. If
no odometry is available, using a no-motion mean value with a large uncertainty
should work.

The CLI application works with offline data only, for online use, please refer
to the underlying class in \ref mrpt_apps_grp or use the even most low-level classes:
- mrpt::slam::CMonteCarloLocalization2D: For robots moving in 2D; pose=(x,y,phi)
- mrpt::slam::CMonteCarloLocalization3D: For robots moving in 3D space; pose=(x,y,z,yaw,pitch,roll)
to the underlying class in `mrpt::apps <group_mrpt_apps_grp.html>`_
or use the even most low-level classes:

- `mrpt::slam::CMonteCarloLocalization2D <class_mrpt_slam_CMonteCarloLocalization2D.html>`_: For robots
moving in 2D, with SE(2) poses (x,y,phi)

- `mrpt::slam::CMonteCarloLocalization3D <class_mrpt_slam_CMonteCarloLocalization3D.html>`_: For robots
moving in 3D space, with SE(3) poses (x,y,z,yaw,pitch,roll)

ro-localization
---------------------

The `ro-localization application <https://www.mrpt.org/list-of-mrpt-apps/application-ro-localization/>`_
is exactly like pf-localization above, but with two differences:

- It's available for 2D only (at present).

- It defines an extended state vector (at each particle) with an estimate of the current bias of each beacon/anchor.

If your sensors do NOT suffer of bias with often, abrupt large changes, the regular
Expand Down
Loading

0 comments on commit e84151b

Please sign in to comment.