From 6417020ec28b3e0f3ce103201e0b6b9e9488eba8 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Sun, 14 Jan 2024 00:07:13 +0100 Subject: [PATCH 01/10] bump patch version --- appveyor.yml | 2 +- doc/source/doxygen-docs/changelog.md | 3 +++ package.xml | 2 +- version_prefix.txt | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index fd377b5f7a..0735d47627 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ # version format -version: 2.11.6-{branch}-build{build} +version: 2.11.7-{branch}-build{build} os: Visual Studio 2019 diff --git a/doc/source/doxygen-docs/changelog.md b/doc/source/doxygen-docs/changelog.md index 568ee9e867..812d9850dd 100644 --- a/doc/source/doxygen-docs/changelog.md +++ b/doc/source/doxygen-docs/changelog.md @@ -1,5 +1,8 @@ \page changelog Change Log +# Version 2.11.7: UNRELEASED +(none yet) + # Version 2.11.6: Released Jan 13th, 2024 - Changes in libraries: - \ref mrpt_obs_grp diff --git a/package.xml b/package.xml index a250da6047..5f3303cd66 100644 --- a/package.xml +++ b/package.xml @@ -7,7 +7,7 @@ mrpt2 - 2.11.6 + 2.11.7 Mobile Robot Programming Toolkit (MRPT) version 2.x Jose-Luis Blanco-Claraco diff --git a/version_prefix.txt b/version_prefix.txt index 62614ecfbe..b0836f70e3 100644 --- a/version_prefix.txt +++ b/version_prefix.txt @@ -1,4 +1,4 @@ -2.11.6 +2.11.7 # IMPORTANT: This file is parsed by CMake, don't add any comment to # the first line. # This file is used in both Windows and Linux scripts to automatically From 00ce464ed5d8494b0694b7029b8683177e1f43bf Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Mon, 15 Jan 2024 07:38:16 +0100 Subject: [PATCH 02/10] refresh console output while building PTG LUT --- libs/nav/src/tpspace/CPTG_DiffDrive_CollisionGridBased.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/nav/src/tpspace/CPTG_DiffDrive_CollisionGridBased.cpp b/libs/nav/src/tpspace/CPTG_DiffDrive_CollisionGridBased.cpp index 6cc94dbd25..eef4e0441b 100644 --- a/libs/nav/src/tpspace/CPTG_DiffDrive_CollisionGridBased.cpp +++ b/libs/nav/src/tpspace/CPTG_DiffDrive_CollisionGridBased.cpp @@ -815,7 +815,11 @@ void CPTG_DiffDrive_CollisionGridBased::internal_initialize( } // n - if (verbose) cout << k << "/" << Ki << ","; + if (verbose) + { + cout << k << "/" << Ki << ","; + cout.flush(); + } } // k if (verbose) cout << format("Done! [%.03f sec]\n", tictac.Tac()); From 21eedffc9b5623ef84982c7693a544a21bbe07b3 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Tue, 16 Jan 2024 10:37:48 +0100 Subject: [PATCH 03/10] Fix gcc warning --- libs/system/src/CFileSystemWatcher.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/libs/system/src/CFileSystemWatcher.cpp b/libs/system/src/CFileSystemWatcher.cpp index 5cd985ab85..be19ab8e8c 100644 --- a/libs/system/src/CFileSystemWatcher.cpp +++ b/libs/system/src/CFileSystemWatcher.cpp @@ -188,13 +188,13 @@ void CFileSystemWatcher::getChanges(TFileSystemChangeList& out_list) } else if (FD_ISSET(m_fd, &rfds)) { -// inotify events are available! : Read them! + // inotify events are available! : Read them! -/* size of the event structure, not counting name */ -#define EVENT_SIZE (sizeof(struct inotify_event)) + /* size of the event structure, not counting name */ + constexpr size_t EVENT_SIZE = (sizeof(struct inotify_event)); -/* reasonable guess as to size of 1024 events */ -#define BUF_LEN (1024 * (EVENT_SIZE + 16)) + /* reasonable guess as to size of 1024 events */ + constexpr size_t BUF_LEN = (1024 * (EVENT_SIZE + 16)); char buf[BUF_LEN]; ssize_t i = 0; @@ -215,17 +215,12 @@ void CFileSystemWatcher::getChanges(TFileSystemChangeList& out_list) while (i < len) { - struct inotify_event event_val - { - }; - std::memcpy( - &event_val, &buf[i], - sizeof(event_val)); // Was: event = (struct inotify_event *) ; - struct inotify_event* event = &event_val; + const inotify_event* event = + reinterpret_cast(&buf[i]); i += EVENT_SIZE + event->len; - // printf ("wd=%d mask=%u cookie=%u len=%u\n",event->wd, + // printf ("wd=%d mask=%u cookie=%u len=%u\n",event->wd, // event->mask,event->cookie, event->len); string eventName; From 59c210eb32504d4753e84a6e8aa5fe2633c16919 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Fri, 19 Jan 2024 08:07:53 +0100 Subject: [PATCH 04/10] Fix build error in debug --- libs/graphslam/include/mrpt/graphslam/ERD/CLoopCloserERD_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/graphslam/include/mrpt/graphslam/ERD/CLoopCloserERD_impl.h b/libs/graphslam/include/mrpt/graphslam/ERD/CLoopCloserERD_impl.h index eab537d5b0..d608e3d72a 100644 --- a/libs/graphslam/include/mrpt/graphslam/ERD/CLoopCloserERD_impl.h +++ b/libs/graphslam/include/mrpt/graphslam/ERD/CLoopCloserERD_impl.h @@ -1281,7 +1281,7 @@ void CLoopCloserERD::execDijkstraProjection( // ending_node is either INVALID_NODEID or one of the already registered // nodeIDs ASSERTDEB_( - ending_node == INVALID_NODEID || + ending_node == mrpt::graphs::INVALID_NODEID || (ending_node >= 0 && ending_node < this->m_graph->nodeCount())); ASSERTDEBMSG_( starting_node != ending_node, "Starting and Ending nodes coincede"); From 7d11bf46e08d331ea4e597db317b49009449ed22 Mon Sep 17 00:00:00 2001 From: Yaling Fang Date: Mon, 22 Jan 2024 09:56:39 +0800 Subject: [PATCH 05/10] Disable render test for autobuilder --- libs/opengl/src/CFBORender_unittest.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/opengl/src/CFBORender_unittest.cpp b/libs/opengl/src/CFBORender_unittest.cpp index a941a2ca68..598055f6cb 100644 --- a/libs/opengl/src/CFBORender_unittest.cpp +++ b/libs/opengl/src/CFBORender_unittest.cpp @@ -46,6 +46,10 @@ #if defined(__riscv) #undef RUN_OFFSCREEN_RENDER_TESTS #endif +// Idem with Loongarch arch: +#if defined(__loongarch__) +#undef RUN_OFFSCREEN_RENDER_TESTS +#endif namespace { From 5ae844bb123820808f926cccb43877d10635e1c0 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Mon, 22 Jan 2024 07:44:07 +0100 Subject: [PATCH 06/10] fix generated timestamps --- apps/carmen2rawlog/carmen2rawlog_main.cpp | 13 +++++++++++++ doc/source/doxygen-docs/changelog.md | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/carmen2rawlog/carmen2rawlog_main.cpp b/apps/carmen2rawlog/carmen2rawlog_main.cpp index 8b9b11326b..848e96c462 100644 --- a/apps/carmen2rawlog/carmen2rawlog_main.cpp +++ b/apps/carmen2rawlog/carmen2rawlog_main.cpp @@ -57,6 +57,10 @@ TCLAP::ValueArg arg_gz_level( "z", "compress-level", "Output GZ-compress level (optional)", false, 5, "0: none, 1-9: min-max", cmd); +TCLAP::ValueArg arg_obs_period( + "p", "period", "Observation recording period in seconds (optional)", false, + 0.1, "period [s]", cmd); + // Declarations: #define VERBOSE_COUT \ if (verbose) cout << "[carmen2rawlog] " @@ -110,6 +114,8 @@ int main(int argc, char** argv) vector importedObservations; map groundTruthPoses; // If found... unsigned int nSavedObs = 0; + const double dt = arg_obs_period.getValue(); + double tim = mrpt::Clock::nowDouble(); const mrpt::system::TTimeStamp base_timestamp = mrpt::system::now(); @@ -119,6 +125,13 @@ int main(int argc, char** argv) while (carmen_log_parse_line( input_stream, importedObservations, base_timestamp)) { + // fix timestamps. Carmen logs did not store timing information: + for (auto& o : importedObservations) + o->timestamp = mrpt::Clock::fromDouble(tim); + + tim += dt; // for the next carmen line + + // save them: for (size_t i = 0; i < importedObservations.size(); i++) { mrpt::serialization::archiveFrom(out_rawlog) diff --git a/doc/source/doxygen-docs/changelog.md b/doc/source/doxygen-docs/changelog.md index 812d9850dd..36b15ce22d 100644 --- a/doc/source/doxygen-docs/changelog.md +++ b/doc/source/doxygen-docs/changelog.md @@ -1,7 +1,8 @@ \page changelog Change Log # Version 2.11.7: UNRELEASED -(none yet) +- Changes in apps: + - carmen2rawlog: Generate valid timestamps. # Version 2.11.6: Released Jan 13th, 2024 - Changes in libraries: From 4c8da31b5970b56f79a620b13f54cddf9ce17846 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Fri, 19 Jan 2024 14:46:09 +0100 Subject: [PATCH 07/10] add support for sensor_msgs/CompressedImage --- apps/rosbag2rawlog/rosbag2rawlog_main.cpp | 25 ++++++++++++++++++++--- doc/source/doxygen-docs/changelog.md | 2 ++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/apps/rosbag2rawlog/rosbag2rawlog_main.cpp b/apps/rosbag2rawlog/rosbag2rawlog_main.cpp index 47f31ee414..f1b29e6061 100644 --- a/apps/rosbag2rawlog/rosbag2rawlog_main.cpp +++ b/apps/rosbag2rawlog/rosbag2rawlog_main.cpp @@ -43,6 +43,7 @@ #include // rosbag_storage C++ lib #include #include +#include #include #include #include @@ -379,14 +380,31 @@ Obs toRangeImage( Obs toImage(std::string_view msg, const rosbag::MessageInstance& rosmsg) { - auto image = rosmsg.instantiate(); + cv_bridge::CvImagePtr cv_ptr; + mrpt::Clock::time_point timeStamp; - auto cv_ptr = cv_bridge::toCvShare(image); + if (auto image = rosmsg.instantiate(); image) + { + cv_ptr = cv_bridge::toCvCopy(image); + timeStamp = mrpt::ros1bridge::fromROS(image->header.stamp); + } + else if (auto imC = rosmsg.instantiate(); imC) + { + cv_ptr = cv_bridge::toCvCopy(imC); + timeStamp = mrpt::ros1bridge::fromROS(imC->header.stamp); + } + else + { + THROW_EXCEPTION_FMT( + "Unhandled ROS topic '%s' type: images are expected to be either " + "sensor_msgs::Image or sensor_msgs::CompressedImage", + std::string(msg).c_str()); + } auto imgObs = mrpt::obs::CObservationImage::Create(); imgObs->sensorLabel = msg; - imgObs->timestamp = mrpt::ros1bridge::fromROS(image->header.stamp); + imgObs->timestamp = timeStamp; imgObs->image = mrpt::img::CImage(cv_ptr->image, mrpt::img::SHALLOW_COPY); @@ -462,6 +480,7 @@ class Transcriber auto callback = [=](const rosbag::MessageInstance& m) { return toImage(sensorName, m); }; + ASSERT_(sensor.count("image_topic") != 0); m_lookup[sensor.at("image_topic").as()] .emplace_back(callback); } diff --git a/doc/source/doxygen-docs/changelog.md b/doc/source/doxygen-docs/changelog.md index 36b15ce22d..a888ea2f0a 100644 --- a/doc/source/doxygen-docs/changelog.md +++ b/doc/source/doxygen-docs/changelog.md @@ -3,6 +3,8 @@ # Version 2.11.7: UNRELEASED - Changes in apps: - carmen2rawlog: Generate valid timestamps. +- Changes in libraries: + - rosbag2rawlog: Add support for `sensor_msgs/CompressedImage` topics. # Version 2.11.6: Released Jan 13th, 2024 - Changes in libraries: From ce67b1559a191c705c5ece7ef4cd2674eebca981 Mon Sep 17 00:00:00 2001 From: Fernando Date: Thu, 25 Jan 2024 14:19:35 +0100 Subject: [PATCH 08/10] FIX: missing right image in stereo capture --- doc/source/doxygen-docs/changelog.md | 2 ++ libs/hwdrivers/src/CImageGrabber_dc1394.cpp | 1 + .../rawlog-grabber/camera_stereoBumblebee_libdc1394.ini | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/source/doxygen-docs/changelog.md b/doc/source/doxygen-docs/changelog.md index a888ea2f0a..b5d9924d5f 100644 --- a/doc/source/doxygen-docs/changelog.md +++ b/doc/source/doxygen-docs/changelog.md @@ -5,6 +5,8 @@ - carmen2rawlog: Generate valid timestamps. - Changes in libraries: - rosbag2rawlog: Add support for `sensor_msgs/CompressedImage` topics. +- BUG FIXES: + - mrpt::hwdrivers::CImageGrabber_dc1394 did not mark the right image as present in stereo cameras. # Version 2.11.6: Released Jan 13th, 2024 - Changes in libraries: diff --git a/libs/hwdrivers/src/CImageGrabber_dc1394.cpp b/libs/hwdrivers/src/CImageGrabber_dc1394.cpp index 3e893c5ab7..8bea305a4d 100644 --- a/libs/hwdrivers/src/CImageGrabber_dc1394.cpp +++ b/libs/hwdrivers/src/CImageGrabber_dc1394.cpp @@ -605,6 +605,7 @@ bool CImageGrabber_dc1394::getObservation( return false; } + out_observation.hasImageRight = true; out_observation.imageLeft.loadFromMemoryBuffer( width, height, true, imageBufRGB); // Left cam. out_observation.imageRight.loadFromMemoryBuffer( diff --git a/share/mrpt/config_files/rawlog-grabber/camera_stereoBumblebee_libdc1394.ini b/share/mrpt/config_files/rawlog-grabber/camera_stereoBumblebee_libdc1394.ini index ab2e21ac7c..5cb5ab0fcc 100644 --- a/share/mrpt/config_files/rawlog-grabber/camera_stereoBumblebee_libdc1394.ini +++ b/share/mrpt/config_files/rawlog-grabber/camera_stereoBumblebee_libdc1394.ini @@ -39,7 +39,7 @@ process_rate = 80 // Hz sensorLabel = BBCamera grabber_type = bumblebee_dc1394 -preview_decimation = 1 +#preview_decimation = 1 pose_x = 0// position on the robot (meters) pose_y = 0 From 221b839e56012ca735e00930718147efdea5decb Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Thu, 25 Jan 2024 21:52:46 +0100 Subject: [PATCH 09/10] stereo calib GUI: fix exception --- apps/kinect-stereo-calib/kinect_calibrate_guiMain.cpp | 9 +++++++-- doc/source/doxygen-docs/changelog.md | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/kinect-stereo-calib/kinect_calibrate_guiMain.cpp b/apps/kinect-stereo-calib/kinect_calibrate_guiMain.cpp index f0fddcfc7b..a6a2c0df40 100644 --- a/apps/kinect-stereo-calib/kinect_calibrate_guiMain.cpp +++ b/apps/kinect-stereo-calib/kinect_calibrate_guiMain.cpp @@ -1816,8 +1816,13 @@ void kinect_calibrate_guiDialog::ProcessNewSelectedImageListBox() // ======= Undistorted image ======= case 3: { - il.undistort(il, m_calib_result.cam_params.leftCamera); - ir.undistort(ir, m_calib_result.cam_params.rightCamera); + mrpt::img::CImage ilD; + il.undistort(ilD, m_calib_result.cam_params.leftCamera); + il = ilD; + + mrpt::img::CImage irD; + ir.undistort(irD, m_calib_result.cam_params.rightCamera); + ir = irD; } break; // ======= Rectified images ======= diff --git a/doc/source/doxygen-docs/changelog.md b/doc/source/doxygen-docs/changelog.md index b5d9924d5f..e868493644 100644 --- a/doc/source/doxygen-docs/changelog.md +++ b/doc/source/doxygen-docs/changelog.md @@ -7,6 +7,7 @@ - rosbag2rawlog: Add support for `sensor_msgs/CompressedImage` topics. - BUG FIXES: - mrpt::hwdrivers::CImageGrabber_dc1394 did not mark the right image as present in stereo cameras. + - kinect-stereo-calib: Fix exception un-distorting images. # Version 2.11.6: Released Jan 13th, 2024 - Changes in libraries: From 60a0ee031a638dd2d69fd5420d6279aaa38ad769 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Thu, 25 Jan 2024 23:23:16 +0100 Subject: [PATCH 10/10] release date --- doc/source/doxygen-docs/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/doxygen-docs/changelog.md b/doc/source/doxygen-docs/changelog.md index e868493644..1675170e84 100644 --- a/doc/source/doxygen-docs/changelog.md +++ b/doc/source/doxygen-docs/changelog.md @@ -1,6 +1,6 @@ \page changelog Change Log -# Version 2.11.7: UNRELEASED +# Version 2.11.7: Released Jan 25th, 2024 - Changes in apps: - carmen2rawlog: Generate valid timestamps. - Changes in libraries: