Skip to content
Snippets Groups Projects
Commit 95de0515 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

[ros.cpp] Add macOS Support - Remove executor namespace for Humble

parent f9c0760a
No related branches found
No related tags found
No related merge requests found
...@@ -7,14 +7,24 @@ ...@@ -7,14 +7,24 @@
* @date 2019-05-22 * @date 2019-05-22
*/ */
/// Standard includes
#include <deque> #include <deque>
#include <atomic> #include <atomic>
#include <fstream> #include <fstream>
#include <chrono> #include <chrono>
#include <thread> #include <thread>
/// ROS2 includes
#include <rclcpp/executor.hpp>
/// Dynamic Bridge include
#include "dynamic_graph_bridge/ros.hpp" #include "dynamic_graph_bridge/ros.hpp"
#ifdef __APPLE__
#include <mach-o/dyld.h>
#include <sys/param.h>
#endif
namespace dynamic_graph_bridge namespace dynamic_graph_bridge
{ {
/* /*
...@@ -49,7 +59,7 @@ static GlobalListOfRosNodeType GLOBAL_LIST_OF_ROS_NODE; ...@@ -49,7 +59,7 @@ static GlobalListOfRosNodeType GLOBAL_LIST_OF_ROS_NODE;
class Executor class Executor
{ {
public: public:
Executor() : ros_executor_(rclcpp::executor::ExecutorArgs(), 4) Executor() : ros_executor_(rclcpp::ExecutorOptions(), 4)
{ {
is_thread_running_ = false; is_thread_running_ = false;
is_spinning_ = false; is_spinning_ = false;
...@@ -189,7 +199,7 @@ ExecutorPtr EXECUTOR = nullptr; ...@@ -189,7 +199,7 @@ ExecutorPtr EXECUTOR = nullptr;
/** /**
* @brief Private function that allow us to get the current executable name. * @brief Private function that allow us to get the current executable name.
* *
* @return std::string the current executable name. * @Return std::string the current executable name.
*/ */
std::string executable_name() std::string executable_name()
{ {
...@@ -206,6 +216,11 @@ std::string executable_name() ...@@ -206,6 +216,11 @@ std::string executable_name()
GetModuleFileNameA(nullptr, buf, MAX_PATH); GetModuleFileNameA(nullptr, buf, MAX_PATH);
return buf; return buf;
#elif defined(__APPLE__)
uint32_t buf_length=MAXPATHLEN;
char buf[MAXPATHLEN];
_NSGetExecutablePath(buf,&buf_length);
return buf;
#else #else
static_assert(false, "unrecognized platform"); static_assert(false, "unrecognized platform");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment