Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Apr 8, 2023
2 parents b750be5 + 697f6eb commit 72acf55
Show file tree
Hide file tree
Showing 43 changed files with 997 additions and 281 deletions.
11 changes: 5 additions & 6 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ endif()
# ----------------------------------
if(CMAKE_MRPT_HAS_FREENECT AND NOT CMAKE_MRPT_HAS_FREENECT_SYSTEM)

find_package(libusb-1.0)
if (NOT LIBUSB_1_FOUND)
#find_package(libusb-1.0)
PKG_CHECK_MODULES(PKG_LIBUSB10 QUIET libusb-1.0 IMPORTED_TARGET GLOBAL) # PkgConfig::PKG_LIBUSB10

if (NOT PKG_LIBUSB10_FOUND)
# Error:
message(SEND_ERROR "*** ERROR *** Please, set libusb-1 variables, disable CMAKE_MRPT_HAS_FREENECT, or provide a system library for libfreenect.")
endif()
Expand Down Expand Up @@ -71,10 +73,7 @@ if(CMAKE_MRPT_HAS_FREENECT AND NOT CMAKE_MRPT_HAS_FREENECT_SYSTEM)
${LIBUSB_1_INCLUDE_DIRS}/libusb-1.0
)
endif()
if (LIBUSB_1_LIBRARIES)
message(STATUS "LIBUSB_1_LIBRARIES: ${LIBUSB_1_LIBRARIES}")
target_link_libraries(mrpt_freenect PUBLIC ${LIBUSB_1_LIBRARIES})
endif()
target_link_libraries(mrpt_freenect PUBLIC PkgConfig::PKG_LIBUSB10)
set_target_properties(mrpt_freenect PROPERTIES FOLDER "3rd party")

unset(SRCS)
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ endif()
# -------------------------
# Minimum version required for:
# - target_compile_features() => 3.8.0
cmake_minimum_required(VERSION 3.8)
# - 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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ sudo apt install ros-$ROS_DISTRO-mrpt2

| Distro | `develop` branch | Stable release | Next builds |
|---|---|---|---|
| ROS1 Melodic @ u18.04 | [![Build Status](https://build.ros.org/job/Mdev__mrpt2__ubuntu_bionic_amd64/badge/icon)](https://build.ros.org/job/Mdev__mrpt2__ubuntu_bionic_amd64/) | [![Version](https://img.shields.io/ros/v/melodic/mrpt2)](https://index.ros.org/search/?term=mrpt2) | [![Build Status](https://build.ros.org/job/Mbin_uB64__mrpt2__ubuntu_bionic_amd64__binary/badge/icon)](https://build.ros.org/job/Mbin_uB64__mrpt2__ubuntu_bionic_amd64__binary/) |
| ROS1 Melodic @ u18.04 | | [![Version](https://img.shields.io/ros/v/melodic/mrpt2)](https://index.ros.org/search/?term=mrpt2) | |
| ROS1 Noetic @ u20.04 | [![Build Status](https://build.ros.org/job/Ndev__mrpt2__ubuntu_focal_amd64/badge/icon)](https://build.ros.org/job/Ndev__mrpt2__ubuntu_focal_amd64/) | [![Version](https://img.shields.io/ros/v/noetic/mrpt2)](https://index.ros.org/search/?term=mrpt2) | [![Build Status](https://build.ros.org/job/Nbin_uF64__mrpt2__ubuntu_focal_amd64__binary/badge/icon)](https://build.ros.org/job/Nbin_uF64__mrpt2__ubuntu_focal_amd64__binary/) |
| ROS2 Foxy @ u20.04 | [![Build Status](https://build.ros2.org/job/Fdev__mrpt2__ubuntu_focal_amd64/badge/icon)](https://build.ros2.org/job/Fdev__mrpt2__ubuntu_focal_amd64/) | [![Version](https://img.shields.io/ros/v/foxy/mrpt2)](https://index.ros.org/search/?term=mrpt2) | [![Build Status](https://build.ros2.org/job/Fbin_uF64__mrpt2__ubuntu_focal_amd64__binary/badge/icon)](https://build.ros2.org/job/Fbin_uF64__mrpt2__ubuntu_focal_amd64__binary/) |
| ROS2 Humble @ u22.04 | [![Build Status](https://build.ros2.org/job/Hdev__mrpt2__ubuntu_jammy_amd64/badge/icon)](https://build.ros2.org/job/Hdev__mrpt2__ubuntu_jammy_amd64/) | [![Version](https://img.shields.io/ros/v/humble/mrpt2)](https://index.ros.org/search/?term=mrpt2) | [![Build Status](https://build.ros2.org/job/Hbin_uJ64__mrpt2__ubuntu_jammy_amd64__binary/badge/icon)](https://build.ros2.org/job/Hbin_uJ64__mrpt2__ubuntu_jammy_amd64__binary/) |
Expand Down
2 changes: 1 addition & 1 deletion apps/benchmarking-image-features/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if(CMAKE_MRPT_HAS_Qt5 AND CMAKE_MRPT_HAS_OPENCV AND NOT "${MRPT_OPENCV_VERSION}"


# Add the required libraries for linking:
qt5_use_modules(${PROJECT_NAME} Widgets OpenGL)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets Qt5::OpenGL)

target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})

Expand Down
2 changes: 0 additions & 2 deletions apps/robot-map-gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ if(CMAKE_MRPT_HAS_Qt5 AND CMAKE_MRPT_HAS_OPENGL_GLUT)
)

# Add the required libraries for linking:
#qt5_use_modules(${PROJECT_NAME} Widgets OpenGL) # obsolete

target_link_libraries(${PROJECT_NAME} ${MRPT_OPENGL_LIBS})
target_link_libraries(${PROJECT_NAME} Qt5::Widgets Qt5::OpenGL)

Expand Down
32 changes: 32 additions & 0 deletions apps/rosbag2rawlog/rosbag2rawlog_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,20 @@
#include <mrpt/obs/CActionRobotMovement3D.h>
#include <mrpt/obs/CObservation3DRangeScan.h>
#include <mrpt/obs/CObservationIMU.h>
#include <mrpt/obs/CObservationOdometry.h>
#include <mrpt/obs/CObservationPointCloud.h>
#include <mrpt/obs/CObservationRotatingScan.h>
#include <mrpt/poses/CPose3DQuat.h>
#include <mrpt/ros1bridge/imu.h>
#include <mrpt/ros1bridge/point_cloud2.h>
#include <mrpt/ros1bridge/pose.h>
#include <mrpt/ros1bridge/time.h>
#include <mrpt/serialization/CArchive.h>
#include <mrpt/serialization/CSerializable.h>
#include <mrpt/system/filesystem.h>
#include <mrpt/system/os.h>
#include <mrpt/system/progress.h>
#include <nav_msgs/Odometry.h>
#include <rosbag/bag.h> // rosbag_storage C++ lib
#include <rosbag/view.h>
#include <sensor_msgs/CameraInfo.h>
Expand Down Expand Up @@ -280,6 +283,27 @@ Obs toIMU(std::string_view msg, const rosbag::MessageInstance& rosmsg)
return {mrptObs};
}

Obs toOdometry(std::string_view msg, const rosbag::MessageInstance& rosmsg)
{
auto odo = rosmsg.instantiate<nav_msgs::Odometry>();

auto mrptObs = mrpt::obs::CObservationOdometry::Create();

mrptObs->sensorLabel = msg;
mrptObs->timestamp = mrpt::ros1bridge::fromROS(odo->header.stamp);

// Convert data:
const auto pose = mrpt::ros1bridge::fromROS(odo->pose);
mrptObs->odometry = {pose.mean.x(), pose.mean.y(), pose.mean.yaw()};

mrptObs->hasVelocities = true;
mrptObs->velocityLocal.vx = odo->twist.twist.linear.x;
mrptObs->velocityLocal.vy = odo->twist.twist.linear.y;
mrptObs->velocityLocal.omega = odo->twist.twist.angular.z;

return {mrptObs};
}

Obs toRangeImage(
std::string_view msg, const sensor_msgs::Image::Ptr& image,
const sensor_msgs::CameraInfo::Ptr& cameraInfo, bool rangeIsDepth)
Expand Down Expand Up @@ -448,6 +472,14 @@ class Transcriber
callback);
// m_lookup["/tf"].emplace_back(sync->bindTfSync());
}
else if (sensorType == "CObservationOdometry")
{
auto callback = [=](const rosbag::MessageInstance& m) {
return toOdometry(sensorName, m);
};
m_lookup[sensor.at("topic").as<std::string>()].emplace_back(
callback);
}
// TODO: Handle more cases?
}
}
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.7.0-{branch}-build{build}
version: 2.8.0-{branch}-build{build}

os: Visual Studio 2019

Expand Down
98 changes: 0 additions & 98 deletions cmakemodules/Findlibusb-1.0.cmake

This file was deleted.

16 changes: 8 additions & 8 deletions cmakemodules/script_kinect.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mark_as_advanced(DISABLE_LIBUSB)
if (NOT DISABLE_LIBUSB)
if(UNIX)
if(PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(PKG_LIBUSB10 QUIET libusb-1.0)
PKG_CHECK_MODULES(PKG_LIBUSB10 QUIET libusb-1.0 IMPORTED_TARGET GLOBAL) # PkgConfig::PKG_LIBUSB10
endif()
endif(UNIX)
else ()
Expand All @@ -21,7 +21,7 @@ mark_as_advanced(DISABLE_DETECT_LIBFREENECT)
if (NOT DISABLE_DETECT_LIBFREENECT)
if(UNIX)
if(PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(PKG_LIBFREENECT QUIET libfreenect)
PKG_CHECK_MODULES(PKG_LIBFREENECT QUIET libfreenect IMPORTED_TARGET GLOBAL) # PkgConfig::PKG_LIBFREENECT
endif()
endif()
else ()
Expand Down Expand Up @@ -57,9 +57,9 @@ if(MRPT_WITH_KINECT)
else()
# If a system version is found, use it:
if(PKG_LIBFREENECT_FOUND)
set(FREENECT_LIBS ${PKG_LIBFREENECT_LIBRARIES})
set(FREENECT_LIBS PkgConfig::PKG_LIBFREENECT)
if($ENV{VERBOSE})
message(STATUS "- PKG_LIBFREENECT_LIBRARIES: ${PKG_LIBFREENECT_LIBRARIES}")
message(STATUS "- PKG_LIBFREENECT_LIBRARIES: PkgConfig::PKG_LIBFREENECT")
endif()

set(CMAKE_MRPT_HAS_KINECT 1)
Expand All @@ -70,9 +70,9 @@ if(MRPT_WITH_KINECT)
set(CMAKE_MRPT_HAS_KINECT 1)
set(CMAKE_MRPT_HAS_FREENECT 1)

set(LIBUSB10_LIBS ${PKG_LIBUSB10_LIBRARIES})
set(LIBUSB10_LIBS PkgConfig::PKG_LIBUSB10)
if($ENV{VERBOSE})
message(STATUS "- PKG_LIBUSB10_LIBRARIES: ${PKG_LIBUSB10_LIBRARIES}")
message(STATUS "- PKG_LIBUSB10_LIBRARIES: PkgConfig::PKG_LIBUSB10")
endif()
else()
message(SEND_ERROR "MRPT_WITH_KINECT requires libusb-1.0. Install it or disable MRPT_WITH_KINECT")
Expand All @@ -85,10 +85,10 @@ if(MRPT_WITH_KINECT)

if (MRPT_WITH_KINECT_USE_FREENECT)
# Find packages needed to build library in Windows
find_package(libusb-1.0 REQUIRED)
PKG_CHECK_MODULES(PKG_LIBUSB10 QUIET libusb-1.0 IMPORTED_TARGET GLOBAL) # PkgConfig::PKG_LIBUSB10

if (LIBUSB_1_FOUND)
set(FREENECT_LIBS ${LIBUSB_1_LIBRARIES})
set(FREENECT_LIBS PkgConfig::PKG_LIBUSB10)

# All OK:
set(CMAKE_MRPT_HAS_KINECT 1)
Expand Down
9 changes: 5 additions & 4 deletions cmakemodules/script_xsens.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ if (WIN32)
else()
set(DEFAULT_BUILD_MT4 "OFF")
if (PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(PKG_LIBUSB10 QUIET libusb-1.0)
PKG_CHECK_MODULES(PKG_LIBUDEV QUIET libudev)
PKG_CHECK_MODULES(PKG_LIBUSB10 QUIET libusb-1.0 IMPORTED_TARGET GLOBAL) # PkgConfig::PKG_LIBUSB10
PKG_CHECK_MODULES(PKG_LIBUDEV QUIET libudev IMPORTED_TARGET GLOBAL) # PkgConfig::PKG_LIBUDEV

if(PKG_LIBUSB10_FOUND AND PKG_LIBUDEV_FOUND)
set(DEFAULT_BUILD_MT4 "ON")
endif()
Expand Down Expand Up @@ -46,14 +47,14 @@ if (MRPT_WITH_XSENS)
# In Linux: libusb-1.0
if(PKG_LIBUSB10_FOUND)
# Perfect, we have libusb-1.0
set(XSENS4_LIBS ${XSENS4_LIBS} ${PKG_LIBUDEV_LIBRARIES})
set(XSENS4_LIBS ${XSENS4_LIBS} PkgConfig::PKG_LIBUSB10)
else()
message(SEND_ERROR "MRPT_WITH_XSENS requires libusb-1.0. Install it or disable MRPT_WITH_XSENS")
endif()

# In Linux: libdev
if (PKG_LIBUDEV_FOUND)
set(XSENS4_LIBS ${XSENS4_LIBS} ${PKG_LIBUDEV_LIBRARIES})
set(XSENS4_LIBS ${XSENS4_LIBS} PkgConfig::PKG_LIBUDEV)
endif ()
endif()
endif ()
Expand Down
1 change: 1 addition & 0 deletions doc/remote-static-files.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
(cd html && wget https://mrpt.github.io/imgs/mrpt-skybox-demo.gif)
(cd html && wget https://mrpt.github.io/imgs/screenshot_hwdrivers_taobotics_imu.jpg)
22 changes: 22 additions & 0 deletions doc/source/doxygen-docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
\page changelog Change Log

# Version 2.8.0: Released April 8th, 2023
- Changes in apps:
- rosbag2rawlog: Added support for converting nav_msgs/Odometry topics to mrpt::obs::CObservationOdometry
- Changes in libraries:
- \ref mrpt_hwdrivers_grp
- New driver for TAObotics IMU sensors. See mrpt::hwdrivers::CTaoboticsIMU and the example \ref hwdrivers_taobotics_imu
- \ref mrpt_math_grp
- mrpt::math::getRegressionPlane() return value is not roughly the inverse of the condition number of the regression problem, which gives a stronger quality indicator than the former formula.
- \ref mrpt_opengl_grp
- Header `<mrpt/opengl.h>` has been updated to include the backwards-compatible type `mrpt::opengl::COpenGLScene` to smooth transition of existing code bases.
- mrpt::opengl::CSphere now has a number of divisions property instead of two (one of them was not actually used).
- Fixed const correctness of mrpt::opengl::CGeneralizedEllipsoidTemplate::getNumberOfSegments()
- \ref mrpt_system_grp
- Removed mrpt::system::setConsoleColor() (Deprecated since MRPT 2.3.3)
- Build system:
- Fix use of obsolete `qt5_use_modules()`.
- New minimum CMake version required is CMake 3.16.0
- BUG FIXES:
- Fix regression in mrpt::obs::CRawlog::detectImagesDirectory() leading to RawLogViewer and other apps not finding the external image directories for datasets.
- Fix wrong rendering of shadows of lines when in orthographic projection.
- mrpt::opengl::CSphere::onUpdateBuffers_Triangles() did not update the list of points

# Version 2.7.0: Released March 4th, 2023
- Changes in libraries:
- \ref mrpt_gui_grp
Expand Down
8 changes: 8 additions & 0 deletions doc/source/doxygen-docs/example-hwdrivers_taobotics_imu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
\page hwdrivers_taobotics_imu Example: hwdrivers_taobotics_imu

This example demonstrates the C++ API to read from Taobotics IMU sensors (e.g. ROS IMU HFI A9).

![Screenshot](https://mrpt.github.io/imgs/screenshot_hwdrivers_taobotics_imu.jpg)

C++ example source code:
\include hwdrivers_taobotics_imu/test.cpp
1 change: 1 addition & 0 deletions doc/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ under `MRPT/samples <https://github.com/MRPT/mrpt/tree/develop/samples>`_.
page_hwdrivers_sick_eth_example.rst
page_hwdrivers_sick_serial_example.rst
page_hwdrivers_swissranger_example.rst
page_hwdrivers_taobotics_imu.rst
page_img_basic_example.rst
page_img_convolution_fft.rst
page_img_correlation_example.rst
Expand Down
1 change: 0 additions & 1 deletion libs/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ if(BUILD_mrpt-gui)
endif()

if(CMAKE_MRPT_HAS_Qt5)
#qt5_use_modules(mrpt-gui Widgets OpenGL) # deprecated!
target_link_libraries(gui PRIVATE Qt5::Widgets Qt5::OpenGL)
endif()

Expand Down
6 changes: 2 additions & 4 deletions libs/hmtslam/src/CHierarchicalMapMHPartition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1185,15 +1185,13 @@ void CHierarchicalMapMHPartition::getAs3DScene(
const CPose3D meanPose = CPose3D(it2->second);

// The sphere of the node:
mrpt::opengl::CSphere::Ptr objSphere = mrpt::opengl::CSphere::Create();
mrpt::opengl::CSphere::Ptr objSphere =
mrpt::opengl::CSphere::Create(nodes_radius, 16);

objSphere->setName(node->m_label);
objSphere->setColor(0, 0, 1);
objSphere->setLocation(
meanPose.x(), meanPose.y(), meanPose.z() + nodes_height);
objSphere->setRadius(nodes_radius);
objSphere->setNumberDivsLongitude(16);
objSphere->setNumberDivsLatitude(16);

outScene.insert(objSphere);

Expand Down
Loading

0 comments on commit 72acf55

Please sign in to comment.