From 7e74af8cbca48f001626e7bed30030d37f55c473 Mon Sep 17 00:00:00 2001 From: Lucas Walter Date: Fri, 20 Jan 2023 06:31:55 -0800 Subject: [PATCH 1/8] =?UTF-8?q?use=20latest=20C++=20instead=20of=2011=20to?= =?UTF-8?q?=20avoid=20'error:=20=E2=80=98shared=5Fmutex=E2=80=99=20in=20na?= =?UTF-8?q?mespace=20=E2=80=98std=E2=80=99=20does=20not=20name=20a=20type'?= =?UTF-8?q?=20error=20in=20C++17?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rosmon_core/CMakeLists.txt | 2 +- rqt_rosmon/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rosmon_core/CMakeLists.txt b/rosmon_core/CMakeLists.txt index 7441df6d..217c5747 100644 --- a/rosmon_core/CMakeLists.txt +++ b/rosmon_core/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(catkin REQUIRED COMPONENTS catkin_package() include_directories(${catkin_INCLUDE_DIRS}) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Werror") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") find_package(TinyXML REQUIRED) diff --git a/rqt_rosmon/CMakeLists.txt b/rqt_rosmon/CMakeLists.txt index 95bf11a3..67251695 100644 --- a/rqt_rosmon/CMakeLists.txt +++ b/rqt_rosmon/CMakeLists.txt @@ -13,7 +13,7 @@ find_package(catkin REQUIRED COMPONENTS catkin_package() include_directories(${catkin_INCLUDE_DIRS}) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Werror") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") if(${pluginlib_VERSION} VERSION_GREATER 1.11.1) message(STATUS "using new pluginlib headers with .hpp extensions") From 8261a737c19c7bd7dd779ef1208d6df40336466e Mon Sep 17 00:00:00 2001 From: Lucas Walter Date: Fri, 20 Jan 2023 06:52:02 -0800 Subject: [PATCH 2/8] Replace deprecated BackgroundColorRole with BackgroundRole --- rqt_rosmon/src/node_model.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rqt_rosmon/src/node_model.cpp b/rqt_rosmon/src/node_model.cpp index d166b25c..6d58a342 100644 --- a/rqt_rosmon/src/node_model.cpp +++ b/rqt_rosmon/src/node_model.cpp @@ -173,7 +173,7 @@ QVariant NodeModel::data(const QModelIndex& index, int role) const return int(Qt::AlignRight | Qt::AlignVCenter); } break; - case Qt::BackgroundColorRole: + case Qt::BackgroundRole: switch(entry.state) { case rosmon_msgs::NodeState::RUNNING: From 69e53a03357805fbe14c162eb9db15ad38c386c1 Mon Sep 17 00:00:00 2001 From: Lucas Walter Date: Fri, 20 Jan 2023 06:53:43 -0800 Subject: [PATCH 3/8] use boost::placeholders::_1 instead of deprecated _1 --- rosmon_core/src/main.cpp | 4 ++-- rosmon_core/src/monitor/monitor.cpp | 4 ++-- rosmon_core/src/ui.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rosmon_core/src/main.cpp b/rosmon_core/src/main.cpp index ae0e733c..cb25dd32 100644 --- a/rosmon_core/src/main.cpp +++ b/rosmon_core/src/main.cpp @@ -523,7 +523,7 @@ int main(int argc, char** argv) config->setNodeLogDir(nodeLogPath); rosmon::monitor::Monitor monitor(config, watcher); - monitor.logMessageSignal.connect(boost::bind(&rosmon::Logger::log, logger.get(), _1)); + monitor.logMessageSignal.connect(boost::bind(&rosmon::Logger::log, logger.get(), boost::placeholders::_1)); fmt::print("\n\n"); monitor.setParameters(); @@ -549,7 +549,7 @@ int main(int argc, char** argv) monitor.logMessageSignal.connect( boost::bind( logToStdout, - _1, + boost::placeholders::_1, get_max_node_name(monitor))); } diff --git a/rosmon_core/src/monitor/monitor.cpp b/rosmon_core/src/monitor/monitor.cpp index f422459e..7ab76243 100644 --- a/rosmon_core/src/monitor/monitor.cpp +++ b/rosmon_core/src/monitor/monitor.cpp @@ -46,7 +46,7 @@ Monitor::Monitor(launch::LaunchConfig::ConstPtr config, FDWatcher::Ptr watcher) if(launchNode->required()) { node->exitedSignal.connect( - boost::bind(&Monitor::handleRequiredNodeExit, this, _1) + boost::bind(&Monitor::handleRequiredNodeExit, this, boost::placeholders::_1) ); } @@ -59,7 +59,7 @@ Monitor::Monitor(launch::LaunchConfig::ConstPtr config, FDWatcher::Ptr watcher) m_statTimer = m_nh.createWallTimer( #endif ros::WallDuration(1.0), - boost::bind(&Monitor::updateStats, this, _1) + boost::bind(&Monitor::updateStats, this, boost::placeholders::_1) ); } diff --git a/rosmon_core/src/ui.cpp b/rosmon_core/src/ui.cpp index 8a3254c5..4a3cace6 100644 --- a/rosmon_core/src/ui.cpp +++ b/rosmon_core/src/ui.cpp @@ -40,7 +40,7 @@ UI::UI(monitor::Monitor* monitor, const FDWatcher::Ptr& fdWatcher) , m_selectedNode(-1) { std::atexit(cleanup); - m_monitor->logMessageSignal.connect(boost::bind(&UI::log, this, _1)); + m_monitor->logMessageSignal.connect(boost::bind(&UI::log, this, boost::placeholders::_1)); m_sizeTimer = ros::NodeHandle().createWallTimer(ros::WallDuration(2.0), boost::bind(&UI::checkWindowSize, this)); m_sizeTimer.start(); From fefefd227c8a72d4e91c362e269352193777c757 Mon Sep 17 00:00:00 2001 From: Lucas Walter Date: Fri, 5 May 2023 15:40:08 -0700 Subject: [PATCH 4/8] disabling install of env hooks because they cause source devel/setup.bash to never return --- rosmon_core/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rosmon_core/CMakeLists.txt b/rosmon_core/CMakeLists.txt index 217c5747..70629b74 100644 --- a/rosmon_core/CMakeLists.txt +++ b/rosmon_core/CMakeLists.txt @@ -177,10 +177,11 @@ if(CATKIN_ENABLE_TESTING) endif() # Version 1.6 (increment this comment to trigger a CMake update) -catkin_add_env_hooks(50-rosmon - SHELLS bash zsh - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env-hooks -) +# disabling for Ubuntu 22.04 and greater +# catkin_add_env_hooks(50-rosmon +# SHELLS bash zsh +# DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env-hooks +# ) install(TARGETS rosmon rosmon_launch_config _shim LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} From bb64e9be8128e4654a0c666924635ced9b44448c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20J=C3=BClg?= Date: Wed, 7 Jun 2023 16:02:16 +0200 Subject: [PATCH 5/8] return QBrush(QColor) as BackgroundRole --- rqt_rosmon/src/node_model.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rqt_rosmon/src/node_model.cpp b/rqt_rosmon/src/node_model.cpp index 6d58a342..d68a00f1 100644 --- a/rqt_rosmon/src/node_model.cpp +++ b/rqt_rosmon/src/node_model.cpp @@ -4,6 +4,7 @@ #include "node_model.h" #include +#include #include @@ -179,11 +180,11 @@ QVariant NodeModel::data(const QModelIndex& index, int role) const case rosmon_msgs::NodeState::RUNNING: return QVariant(); case rosmon_msgs::NodeState::IDLE: - return QColor(200, 200, 200); + return QBrush(QColor(200, 200, 200)); case rosmon_msgs::NodeState::CRASHED: - return QColor(255, 100, 100); + return QBrush(QColor(255, 100, 100)); case rosmon_msgs::NodeState::WAITING: - return QColor(255, 255, 128); + return QBrush(QColor(255, 255, 128)); } break; case SortRole: From eb0350fac0c7dead0bee7a5155106286da216c98 Mon Sep 17 00:00:00 2001 From: Lucas Walter Date: Wed, 17 Apr 2024 07:53:08 -0700 Subject: [PATCH 6/8] need to include boost mpl vector header --- rosmon_core/src/launch/substitution_python.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/rosmon_core/src/launch/substitution_python.cpp b/rosmon_core/src/launch/substitution_python.cpp index 274651ad..a2625cfa 100644 --- a/rosmon_core/src/launch/substitution_python.cpp +++ b/rosmon_core/src/launch/substitution_python.cpp @@ -13,7 +13,6 @@ #include #include - #include namespace py = boost::python; From 4ff0a3ea3d7fe3d74877873d2c416e68061f2212 Mon Sep 17 00:00:00 2001 From: Lucas Walter Date: Wed, 17 Apr 2024 07:56:11 -0700 Subject: [PATCH 7/8] replace deprecated leaf() with filename() --- rosmon_core/src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rosmon_core/src/main.cpp b/rosmon_core/src/main.cpp index cb25dd32..3bf34420 100644 --- a/rosmon_core/src/main.cpp +++ b/rosmon_core/src/main.cpp @@ -45,7 +45,7 @@ static fs::path findFile(const fs::path& base, const std::string& name) if(!p.empty()) return p; } - else if(it->path().leaf() == name) + else if(it->path().filename() == name) return *it; } From 493021536da48b7e5df677963af1fb03dd0e87aa Mon Sep 17 00:00:00 2001 From: Lucas Walter Date: Fri, 19 Apr 2024 12:51:25 -0700 Subject: [PATCH 8/8] use path stem instead of deprecated basename --- rosmon_core/src/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rosmon_core/src/main.cpp b/rosmon_core/src/main.cpp index 3bf34420..c0db50d3 100644 --- a/rosmon_core/src/main.cpp +++ b/rosmon_core/src/main.cpp @@ -370,15 +370,16 @@ int main(int argc, char** argv) if(envSyslog || logFile == "syslog") { + const auto log_path = fs::path(launchFilePath).stem().string(); // Try systemd journal first try { - logger.reset(new rosmon::SystemdLogger(fs::basename(launchFilePath))); + logger.reset(new rosmon::SystemdLogger(log_path)); } catch(rosmon::SystemdLogger::NotAvailable& e) { fmt::print(stderr, "Systemd Journal not available: {}\n", e.what()); - logger.reset(new rosmon::SyslogLogger(fs::basename(launchFilePath))); + logger.reset(new rosmon::SyslogLogger(log_path)); } } else