Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion distros/humble/distro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ pinning_overrides:
# xsimd (14), which no xtensor >= 0.25 accepts, and falls back to xtensor 0.23.9, whose
# xtensor_simd.hpp doesn't build with it. 0.25 brings a matching xsimd (as in jazzy).
xtensor: [0.25.0]
rosdistro_sync: humble/2026-10-12
rosdistro_sync: humble/2026-11-16
12 changes: 6 additions & 6 deletions distros/humble/patch/ros2-foxglove-bridge.patch
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 64c1274..774140a 100644
index b15b6de..68b0154 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,6 +97,18 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarc
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(FOXGLOVE_SDK_PLATFORM "x86_64-unknown-linux-gnu")
set(FOXGLOVE_SDK_SHA "1a0d8e03a885f01ae7cfb08dc9076090ba2cf8a15b7f46dda11451e2e2758978")
set(FOXGLOVE_SDK_SHA "71bf8ded6907f2abb528b7844d9d441d82b93e0679c88724fc1144e6567be2d9")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
+ set(FOXGLOVE_SDK_PLATFORM "aarch64-apple-darwin")
+ set(FOXGLOVE_SDK_SHA "7b7a86a659a86544f23bed793b7913ad71c3f6c595233bbdb20d3968a3ce5a3a")
+ set(FOXGLOVE_SDK_SHA "74454dcedac00fab8f1dd5308f88b101f87d15bf67e99e53def8d5dd11d05a81")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ set(FOXGLOVE_SDK_PLATFORM "x86_64-apple-darwin")
+ set(FOXGLOVE_SDK_SHA "5bae49cac58fb423217e9214452c22faa95b51f5bda7c04469fb1649f8b74ce5")
+ set(FOXGLOVE_SDK_SHA "b3a521bdc2d2959dc1975b6f16b21472160544abb482a92a7597153c86e2a144")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
+ set(FOXGLOVE_SDK_PLATFORM "aarch64-pc-windows-msvc")
+ set(FOXGLOVE_SDK_SHA "8d067b5af329f808142a750e939799bfccb27926ff72b62da54e5280af002d3b")
+ set(FOXGLOVE_SDK_SHA "6d15cb73fac99dd3c6383ad7b926d040ada404fe7f9917828a3e9fdf96755915")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
+ set(FOXGLOVE_SDK_PLATFORM "x86_64-pc-windows-msvc")
+ set(FOXGLOVE_SDK_SHA "ea4db36121adb0ee61315442ea43603136c6910b4d82814688f507cd6f7fdd3b")
+ set(FOXGLOVE_SDK_SHA "1610c91833e7c9ee4cadf5d142df18ed458ac3053f0671fc758e7691c742e35b")
else()
message(FATAL_ERROR "Unsupported platform/architecture combination: ${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}")
endif()
Expand Down
14 changes: 7 additions & 7 deletions distros/humble/patch/ros2-libmavconn.win.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a5250e8..8c5d11a 100644
index d349d81..005f018 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(libmavconn)

+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
Expand All @@ -23,7 +23,7 @@ index a5250e8..8c5d11a 100644
# Allow GNU extensions (-std=gnu++20)
set(CMAKE_C_EXTENSIONS ON)
diff --git a/include/mavconn/thread_utils.hpp b/include/mavconn/thread_utils.hpp
index 584a15d..36f6fa3 100644
index f0678c8..2d53b4d 100644
--- a/include/mavconn/thread_utils.hpp
+++ b/include/mavconn/thread_utils.hpp
@@ -20,7 +20,9 @@
Expand All @@ -33,10 +33,10 @@ index 584a15d..36f6fa3 100644
+#ifndef _WIN32
#include <pthread.h>
+#endif
#include <sched.h>

#include <cstdio>
#include <sstream>
@@ -61,6 +63,12 @@ std::string format(const std::string & fmt, Args... args)
#include <array>
@@ -76,6 +78,12 @@ std::string format(const std::string & fmt, Args... args)
template<typename ... Args>
bool set_this_thread_name(const std::string & name, Args && ... args)
{
Expand All @@ -49,7 +49,7 @@ index 584a15d..36f6fa3 100644
auto new_name = format(name, std::forward<Args>(args)...);

#ifdef __APPLE__
@@ -69,6 +77,7 @@ bool set_this_thread_name(const std::string & name, Args && ... args)
@@ -84,6 +92,7 @@ bool set_this_thread_name(const std::string & name, Args && ... args)
pthread_t pth = pthread_self();
return pthread_setname_np(pth, new_name.c_str()) == 0;
#endif
Expand Down
12 changes: 5 additions & 7 deletions distros/humble/patch/ros2-mavlink.osx.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
diff --git a/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp b/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp
index a3956aa2..2abe2a5e 100644
index dd3bf89..5ea7a8a 100644
--- a/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp
+++ b/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp
@@ -4,7 +4,14 @@
#include <algorithm>
@@ -5,6 +5,13 @@
#ifdef FREEBSD
#include <sys/endian.h>
-#elif __APPLE__
+#elif defined(__APPLE__)
#elif defined(__APPLE__) && __APPLE__
+#include <libkern/OSByteOrder.h>
+#define htole16(x) OSSwapHostToLittleInt16(x)
+#define htole32(x) OSSwapHostToLittleInt32(x)
Expand All @@ -16,5 +14,5 @@ index a3956aa2..2abe2a5e 100644
+#define le32toh(x) OSSwapLittleToHostInt32(x)
+#define le64toh(x) OSSwapLittleToHostInt64(x)
#include <machine/endian.h>
#else
#include <endian.h>
#elif defined(_WIN32)
// Windows has no <endian.h>, and every Windows target (x86, x64, ARM64) is
52 changes: 26 additions & 26 deletions distros/humble/patch/ros2-mavlink.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 30c9811..abea531 100644
index 80a215b..e38592c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -77,7 +77,7 @@ macro(generateMavlink_v10 definitions)
Expand All @@ -24,32 +24,8 @@ index 30c9811..abea531 100644
DEPENDS ${definitionAbsPath} ${common_xml_path} ${mavgen_path}
)
add_custom_target(${definition}.xml-v2.0
diff --git a/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp b/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp
index a3956aa..91ce908 100644
--- a/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp
+++ b/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp
@@ -6,6 +6,19 @@
#include <sys/endian.h>
#elif __APPLE__
#include <machine/endian.h>
+#elif defined(_WIN32)
+// Windows has no <endian.h>, and every Windows target (x86, x64, ARM64) is
+// little-endian, so the little-endian <-> host conversions are no-ops.
+#include <cstdint>
+inline uint16_t htole16(uint16_t x) { return x; }
+inline uint32_t htole32(uint32_t x) { return x; }
+inline uint64_t htole64(uint64_t x) { return x; }
+inline uint16_t le16toh(uint16_t x) { return x; }
+inline uint32_t le32toh(uint32_t x) { return x; }
+inline uint64_t le64toh(uint64_t x) { return x; }
+// Also no POSIX ssize_t on MSVC.
+#include <cstddef>
+typedef ptrdiff_t ssize_t;
#else
#include <endian.h>
#endif
diff --git a/pymavlink/generator/CPP11/include_v2.0/message.hpp b/pymavlink/generator/CPP11/include_v2.0/message.hpp
index 4d6d424..c095ee7 100644
index 08cd62b..411ec10 100644
--- a/pymavlink/generator/CPP11/include_v2.0/message.hpp
+++ b/pymavlink/generator/CPP11/include_v2.0/message.hpp
@@ -1,6 +1,22 @@
Expand All @@ -75,3 +51,27 @@ index 4d6d424..c095ee7 100644
#include <array>
#include <cassert>
#include <cstring>
diff --git a/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp b/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp
index d325f0a..dd3bf89 100644
--- a/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp
+++ b/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp
@@ -6,6 +6,19 @@
#include <sys/endian.h>
#elif defined(__APPLE__) && __APPLE__
#include <machine/endian.h>
+#elif defined(_WIN32)
+// Windows has no <endian.h>, and every Windows target (x86, x64, ARM64) is
+// little-endian, so the little-endian <-> host conversions are no-ops.
+#include <cstdint>
+inline uint16_t htole16(uint16_t x) { return x; }
+inline uint32_t htole32(uint32_t x) { return x; }
+inline uint64_t htole64(uint64_t x) { return x; }
+inline uint16_t le16toh(uint16_t x) { return x; }
+inline uint32_t le32toh(uint32_t x) { return x; }
+inline uint64_t le64toh(uint64_t x) { return x; }
+// Also no POSIX ssize_t on MSVC.
+#include <cstddef>
+typedef ptrdiff_t ssize_t;
#else
#include <endian.h>
#endif
72 changes: 72 additions & 0 deletions distros/humble/patch/ros2-mola-launcher.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
diff --git a/src/MolaDLL_Loader.cpp b/src/MolaDLL_Loader.cpp
index a5ccf39..cb05408 100644
--- a/src/MolaDLL_Loader.cpp
+++ b/src/MolaDLL_Loader.cpp
@@ -24,7 +24,7 @@

#include <map>

-#if defined(__unix__)
+#if defined(__unix__) || defined(__APPLE__)
#include <dlfcn.h>
#endif

@@ -59,7 +59,9 @@ void internal_load_lib_modules(
{
MRPT_TRY_START

-#if defined(__unix__)
+#if defined(__APPLE__)
+#define DLL_EXT "dylib"
+#elif defined(__unix__)
#define DLL_EXT "so"
#else
#define DLL_EXT "dll"
@@ -79,11 +81,14 @@ void internal_load_lib_modules(
for (const auto& lib : lst)
{
if (lib.name.find("mola") == std::string::npos) continue; // skip
+ // ROS interface libraries (e.g. mola_msgs) are never MOLA modules, and the
+ // Python ones cannot be dlopen()ed from a non-Python process:
+ if (lib.name.find("__rosidl_") != std::string::npos) continue; // skip

// Already loaded?
if (loaded_lib_handled.count(lib.name) != 0) continue; // skip

-#if defined(__unix__)
+#if defined(__unix__) || defined(__APPLE__)
// Check if already loaded?
{
void* handle = dlopen(lib.wholePath.c_str(), RTLD_NOLOAD);
@@ -146,7 +151,7 @@ void internal_unload_lib_modules()
{
// printf("[mola-launcher] Unloading: %s\n",
// lib.second.lib_path.c_str());
-#if defined(__unix__)
+#if defined(__unix__) || defined(__APPLE__)
dlclose(lib.second.handle);
#else
FreeLibrary(lib.second.handle);
diff --git a/src/MolaLauncherApp.cpp b/src/MolaLauncherApp.cpp
index 841913c..85407a4 100644
--- a/src/MolaLauncherApp.cpp
+++ b/src/MolaLauncherApp.cpp
@@ -120,6 +120,18 @@ MolaLauncherApp::MolaLauncherApp() : mrpt::system::COutputLogger("MolaLauncherAp
// do not filter these ones by *directory* name, since *filenames* will be
// filtered later on:
from_env_var_to_list("LD_LIBRARY_PATH", lib_search_paths_);
+
+ // conda/RoboStack environments do not set LD_LIBRARY_PATH: also search
+ // <prefix>/lib (<prefix>/bin for Windows DLLs) for every prefix in AMENT_PREFIX_PATH.
+ {
+ std::vector<std::string> prefixes;
+ from_env_var_to_list("AMENT_PREFIX_PATH", prefixes);
+#if defined(_WIN32)
+ for (const auto& prefix : prefixes) safe_add_to_list(prefix + "/bin", lib_search_paths_);
+#else
+ for (const auto& prefix : prefixes) safe_add_to_list(prefix + "/lib", lib_search_paths_);
+#endif
+ }
}

MolaLauncherApp::~MolaLauncherApp()
105 changes: 105 additions & 0 deletions distros/humble/patch/ros2-mola-launcher.win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
diff --git a/apps/mola-cli.cpp b/apps/mola-cli.cpp
index 5a04f80..37a7042 100644
--- a/apps/mola-cli.cpp
+++ b/apps/mola-cli.cpp
@@ -24,7 +24,11 @@
#include <mrpt/core/exceptions.h>
#include <mrpt/rtti/CObject.h>
#include <mrpt/system/filesystem.h>
+#if defined(_WIN32)
+#include <io.h> // _write()
+#else
#include <unistd.h> // write()
+#endif

#if defined(MOLA_CLI_HAS_TBB)
#include <tbb/global_control.h>
@@ -53,7 +57,11 @@ void mola_signal_handler([[maybe_unused]] int s)
// raw write() to stderr. The actual shutdown (which logs, sleeps and joins
// threads) is done by the main thread as soon as spin() returns.
static const char msg[] = "\nTermination signal caught. Shutting down...\n";
+#if defined(_WIN32)
+ [[maybe_unused]] const auto n = ::_write(2, msg, sizeof(msg) - 1);
+#else
[[maybe_unused]] const auto n = ::write(STDERR_FILENO, msg, sizeof(msg) - 1);
+#endif

if (auto* app = theApp.load())
{
@@ -63,6 +71,11 @@ void mola_signal_handler([[maybe_unused]] int s)

void mola_install_signal_handler()
{
+#if defined(_WIN32)
+ // No sigaction() on Windows:
+ std::signal(SIGINT, &mola_signal_handler);
+ std::signal(SIGTERM, &mola_signal_handler);
+#else
struct sigaction sigIntHandler;

sigIntHandler.sa_handler = &mola_signal_handler;
@@ -76,6 +89,7 @@ void mola_install_signal_handler()
// the main MOLA loop keeps running, so the process never exits and lingers
// with its ROS 2 endpoints still advertised but no longer served.
sigaction(SIGTERM, &sigIntHandler, nullptr);
+#endif
}

// Default task for mola-cli: launching a SLAM system
diff --git a/src/MolaDLL_Loader.cpp b/src/MolaDLL_Loader.cpp
index cb05408..ec2d084 100644
--- a/src/MolaDLL_Loader.cpp
+++ b/src/MolaDLL_Loader.cpp
@@ -26,6 +26,11 @@

#if defined(__unix__) || defined(__APPLE__)
#include <dlfcn.h>
+#elif defined(_WIN32)
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif
+#include <windows.h> // LoadLibraryA(), FreeLibrary()
#endif

/** From internal_load_lib_modules() */
@@ -101,7 +106,7 @@ void internal_load_lib_modules(

void* handle = dlopen(lib.wholePath.c_str(), RTLD_LAZY);
#else
- HMODULE handle = LoadLibrary(lib.wholePath.c_str());
+ void* handle = LoadLibraryA(lib.wholePath.c_str());
#endif
if (handle == nullptr)
{
@@ -116,7 +121,8 @@ void internal_load_lib_modules(
}
#else
const std::string err =
- mrpt::format("LoadLibrary() failed, error code %lu", ::GetLastError());
+ mrpt::format(
+ "LoadLibrary() failed, error code %lu", static_cast<unsigned long>(::GetLastError()));
#endif
failed_lib_errors[lib.wholePath] = err;
app.logStr(
@@ -154,7 +160,7 @@ void internal_unload_lib_modules()
#if defined(__unix__) || defined(__APPLE__)
dlclose(lib.second.handle);
#else
- FreeLibrary(lib.second.handle);
+ FreeLibrary(static_cast<HMODULE>(lib.second.handle));
#endif
}
loaded_lib_handled.clear();
diff --git a/src/MolaLauncherApp.cpp b/src/MolaLauncherApp.cpp
index 85407a4..96229f3 100644
--- a/src/MolaLauncherApp.cpp
+++ b/src/MolaLauncherApp.cpp
@@ -100,7 +100,7 @@ std::string relative_to_abs_path(
if (f.is_relative())
{
f = fs::path(*basePath) / f;
- return f;
+ return f.string(); // no implicit conversion on Windows (wchar_t paths)
}
else
return path;
38 changes: 38 additions & 0 deletions distros/humble/patch/ros2-mrpt-common.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git a/cmake/mrpt_cmake_functions.cmake b/cmake/mrpt_cmake_functions.cmake
index 87ec9fe..6603aa4 100644
--- a/cmake/mrpt_cmake_functions.cmake
+++ b/cmake/mrpt_cmake_functions.cmake
@@ -79,6 +79,21 @@ if(NOT MSVC AND NOT XCODE_VERSION)
endif()
endif()

+# RoboStack: conda's CMAKE_ARGS pass the binutils as bare program names
+# (-DCMAKE_AR=<triplet>-ar, ...); MRPT's projects end up with them cached as paths
+# in the build directory, which don't exist (seen on linux-aarch64): static
+# libraries (bundled cloudini in mrpt_maps) and pybind11's strip step then fail.
+foreach(_mrpt_tool CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_NM CMAKE_OBJCOPY CMAKE_OBJDUMP CMAKE_READELF CMAKE_ADDR2LINE)
+ if(${_mrpt_tool} AND NOT EXISTS "${${_mrpt_tool}}")
+ get_filename_component(_mrpt_tool_name "${${_mrpt_tool}}" NAME)
+ find_program(_mrpt_tool_path NAMES "${_mrpt_tool_name}" NO_CACHE)
+ if(_mrpt_tool_path)
+ set(${_mrpt_tool} "${_mrpt_tool_path}" CACHE FILEPATH "" FORCE)
+ endif()
+ unset(_mrpt_tool_path)
+ endif()
+endforeach()
+
# Static library options:
set(DISABLE_MRPT_AUTO_CLASS_REGISTRATION OFF CACHE BOOL "Enable to reduce the footprint of MRPT statically libraries linked; caution: all deserialized classes must be registered by hand by the user!")
mark_as_advanced(DISABLE_MRPT_AUTO_CLASS_REGISTRATION)
@@ -495,7 +510,10 @@ function(handle_special_simd_flags lst_files FILE_PATTERN FLAGS_TO_ADD)
keep_matching_files_from_list(${FILE_PATTERN} _lst)
if(NOT "${_lst}" STREQUAL "")
#message(STATUS "Adding special flags ${FLAGS_TO_ADD} to ${_lst}")
- set_source_files_properties(${_lst} PROPERTIES COMPILE_FLAGS "${FLAGS_TO_ADD}")
+ # RoboStack: without the precompiled header, which is built without these flags (clang
+ # rejects a PCH built for other target features, e.g. -msse2 on osx-64)
+ set_source_files_properties(${_lst} PROPERTIES COMPILE_FLAGS "${FLAGS_TO_ADD}"
+ SKIP_PRECOMPILE_HEADERS ON)
endif()
endif()
endfunction()
Loading
Loading