Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build in Ubuntu 22.04/24.04 #173

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
11 changes: 6 additions & 5 deletions rosmon_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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}
Expand Down
1 change: 0 additions & 1 deletion rosmon_core/src/launch/substitution_python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <boost/python/import.hpp>

#include <boost/lexical_cast.hpp>

#include <boost/mpl/vector.hpp>

namespace py = boost::python;
Expand Down
11 changes: 6 additions & 5 deletions rosmon_core/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -523,7 +524,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();
Expand All @@ -549,7 +550,7 @@ int main(int argc, char** argv)
monitor.logMessageSignal.connect(
boost::bind(
logToStdout,
_1,
boost::placeholders::_1,
get_max_node_name(monitor)));
}

Expand Down
4 changes: 2 additions & 2 deletions rosmon_core/src/monitor/monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
}

Expand All @@ -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)
);
}

Expand Down
2 changes: 1 addition & 1 deletion rosmon_core/src/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion rqt_rosmon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 5 additions & 4 deletions rqt_rosmon/src/node_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "node_model.h"

#include <QColor>
#include <QBrush>

#include <ros/node_handle.h>

Expand Down Expand Up @@ -173,17 +174,17 @@ QVariant NodeModel::data(const QModelIndex& index, int role) const
return int(Qt::AlignRight | Qt::AlignVCenter);
}
break;
case Qt::BackgroundColorRole:
case Qt::BackgroundRole:
lucasw marked this conversation as resolved.
Show resolved Hide resolved
switch(entry.state)
{
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:
Expand Down