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 .github/workflows/testpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
Expand Down
14 changes: 6 additions & 8 deletions conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
numpy:
- 1.26
- 2
libprotobuf:
- 5.29.3
- 6.31.1
protobuf:
- 5.29.3
- 6.31.1
spdlog:
- 1.15
pugixml:
- '1.15'
libopencv:
- 4.11.0
- 4.12.0
libxml2:
- 2.13.*
graphviz:
Expand Down Expand Up @@ -56,11 +56,9 @@ cxx_compiler_version: # [unix]
- 18 # [osx]

libzenohc:
- 1.4.0
- 1.5.1
libzenohcxx:
- 1.4.0
libcap:
- 2.71
- 1.5.1

libhwloc:
- 2.11.2
Expand Down
26 changes: 0 additions & 26 deletions patch/ros-jazzy-apriltag-detector-mit.win.patch

This file was deleted.

27 changes: 0 additions & 27 deletions patch/ros-jazzy-apriltag-detector-umich.win.patch

This file was deleted.

26 changes: 0 additions & 26 deletions patch/ros-jazzy-apriltag-detector.win.patch

This file was deleted.

24 changes: 0 additions & 24 deletions patch/ros-jazzy-apriltag-draw.win.patch

This file was deleted.

15 changes: 0 additions & 15 deletions patch/ros-jazzy-apriltag-tools.win.patch

This file was deleted.

43 changes: 0 additions & 43 deletions patch/ros-jazzy-control-toolbox.patch

This file was deleted.

58 changes: 14 additions & 44 deletions patch/ros-jazzy-ffmpeg-encoder-decoder.unix.patch
Original file line number Diff line number Diff line change
@@ -1,50 +1,20 @@
diff --git a/include/ffmpeg_encoder_decoder/decoder.hpp b/include/ffmpeg_encoder_decoder/decoder.hpp
index 0e2521c..94625e5 100644
--- a/include/ffmpeg_encoder_decoder/decoder.hpp
+++ b/include/ffmpeg_encoder_decoder/decoder.hpp
@@ -81,7 +81,7 @@ private:
AVFrame * colorFrame_{NULL};
SwsContext * swsContext_{NULL};
enum AVPixelFormat hwPixFormat_;
- AVPacket packet_;
+ // AVPacket packet_;
AVBufferRef * hwDeviceContext_{NULL};
};
} // namespace ffmpeg_encoder_decoder
diff --git a/src/decoder.cpp b/src/decoder.cpp
index 5458f21..a2762aa 100644
--- a/src/decoder.cpp
+++ b/src/decoder.cpp
@@ -256,7 +256,7 @@ bool Decoder::decodePacket(
image->header.stamp = it->second;
ptsToStamp_.erase(it);
#ifdef USE_AV_FLAGS
- callback_(image, decodedFrame_->flags || AV_FRAME_FLAG_KEY); // deliver callback
+ callback_(image, decodedFrame_->flags | AV_FRAME_FLAG_KEY); // deliver callback
#else
callback_(image, decodedFrame_->key_frame); // deliver callback
#endif
diff --git a/src/encoder.cpp b/src/encoder.cpp
index ed6ca85..0aa3412 100644
index 80f1de4..fc485b4 100644
--- a/src/encoder.cpp
+++ b/src/encoder.cpp
@@ -211,11 +211,19 @@ void Encoder::doOpenCodec(int width, int height)
setAVOption("tune", tune_);
setAVOption("delay", delay_);
setAVOption("crf", crf_);
@@ -259,9 +259,15 @@ void Encoder::doOpenCodec(int width, int height, const std::string & origEncodin
setAVOption(kv.first, kv.second);
ss << " " << kv.first << "=" << kv.second;
}
+#ifdef __APPLE__
+ RCLCPP_DEBUG(
+ logger_,
+ "codec: %10s, profile: %10s, preset: %10s,"
+ " bit_rate: %10lld qmax: %2d",
+ encoder_.c_str(), profile_.c_str(), preset_.c_str(), bitRate_, qmax_);
+ RCLCPP_INFO(
+ logger_, "codec: %10s, bit_rate: %10lld qmax: %2d options: %s", encoder_.c_str(), bitRate_,
+ qmax_, ss.str().c_str());
+#else
RCLCPP_DEBUG(
logger_,
"codec: %10s, profile: %10s, preset: %10s,"
" bit_rate: %10ld qmax: %2d",
encoder_.c_str(), profile_.c_str(), preset_.c_str(), bitRate_, qmax_);
RCLCPP_INFO(
logger_, "codec: %10s, bit_rate: %10ld qmax: %2d options: %s", encoder_.c_str(), bitRate_,
qmax_, ss.str().c_str());
+#endif

err = avcodec_open2(codecContext_, codec, NULL);
utils::check_for_err("cannot open codec", err);
RCLCPP_INFO_STREAM(
logger_, "cv_bridge_target_format: "
<< cvBridgeTargetFormat_
83 changes: 0 additions & 83 deletions patch/ros-jazzy-realtime-tools.osx.patch
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b3fcf87..7e5c654 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,7 +46,7 @@ target_include_directories(realtime_tools PUBLIC
$<INSTALL_INTERFACE:include/realtime_tools>
)
target_link_libraries(realtime_tools PUBLIC rclcpp::rclcpp rclcpp_action::rclcpp_action rcpputils::rcpputils Threads::Threads Boost::boost)
-if(UNIX)
+if(UNIX AND NOT APPLE)
target_link_libraries(realtime_tools PUBLIC cap)
endif()

@@ -60,7 +60,7 @@ target_include_directories(thread_priority PUBLIC
$<INSTALL_INTERFACE:include/realtime_tools>
)
target_link_libraries(thread_priority PUBLIC rclcpp::rclcpp rclcpp_action::rclcpp_action rcpputils::rcpputils Threads::Threads)
-if(UNIX)
+if(UNIX AND NOT APPLE)
target_link_libraries(thread_priority PUBLIC cap)
endif()

diff --git a/include/realtime_tools/realtime_thread_safe_box.hpp b/include/realtime_tools/realtime_thread_safe_box.hpp
index a1eb9c9..1ec73e9 100644
--- a/include/realtime_tools/realtime_thread_safe_box.hpp
Expand All @@ -33,64 +11,3 @@ index a1eb9c9..1ec73e9 100644
#include "realtime_tools/mutex.hpp"
#define DEFAULT_MUTEX realtime_tools::prio_inherit_mutex
#define RECURSIVE_MUTEX realtime_tools::prio_inherit_recursive_mutex
diff --git a/src/realtime_helpers.cpp b/src/realtime_helpers.cpp
index 9dbbfdf..10c3066 100644
--- a/src/realtime_helpers.cpp
+++ b/src/realtime_helpers.cpp
@@ -32,13 +32,16 @@
#include <windows.h>
#else
#include <sched.h>
-#include <sys/capability.h>
#include <sys/mman.h>
#include <sys/utsname.h>

#include <unistd.h>
#endif

+#if defined(__unix__)
+#include <sys/capability.h>
+#endif
+
#include <cstring>
#include <fstream>
#include <iostream>
@@ -75,6 +78,19 @@ bool configure_sched_fifo(int priority)
#ifdef _WIN32
HANDLE thread = GetCurrentThread();
return SetThreadPriority(thread, priority);
+#elif defined(__APPLE__)
+ pthread_t thread = pthread_self();
+ struct sched_param schedp;
+ memset(&schedp, 0, sizeof(schedp));
+ schedp.sched_priority = priority;
+
+ int policy = SCHED_FIFO;
+ if (pthread_setschedparam(thread, policy, &schedp) == 0) {
+ return true;
+ } else {
+ // Optionally log strerror(errno) for debugging
+ return false;
+ }
#else
struct sched_param schedp;
memset(&schedp, 0, sizeof(schedp));
@@ -94,6 +110,8 @@ std::pair<bool, std::string> lock_memory()
{
#ifdef _WIN32
return {false, "Memory locking is not supported on Windows."};
+#elif defined(__APPLE__)
+ return {false, "Memory locking is not supported on MacOS."};
#else
auto is_capable = [](cap_value_t v) -> bool {
bool rc = false;
@@ -146,6 +164,9 @@ std::pair<bool, std::string> set_thread_affinity(
#ifdef _WIN32
message = "Thread affinity is not supported on Windows.";
return std::make_pair(false, message);
+#elif defined(__APPLE__)
+ message = "Memory locking is not supported on MacOS.";
+ return std::make_pair(false, message);
#else
auto set_affinity_result_message = [](int result, std::string & msg) -> bool {
if (result == 0) {
Loading
Loading