Skip to content

Commit

Permalink
Cleaning up old distro support and removing build warnigns
Browse files Browse the repository at this point in the history
  • Loading branch information
danthony06 committed Sep 20, 2023
1 parent cdf1521 commit 54e36bc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 46 deletions.
16 changes: 1 addition & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.10)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
endif()

if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_ID MATCHES "Clang")
Expand All @@ -12,7 +12,6 @@ project(swri_console)

### ROS PACKAGES ###
find_package(ament_cmake REQUIRED)
# find_package(rosbag_storage REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rcl_interfaces REQUIRED)

Expand All @@ -23,13 +22,6 @@ find_package(Qt5Widgets REQUIRED)

find_package(Boost COMPONENTS thread REQUIRED)

### Compile flag to support different versions of ROS ###
if($ENV{ROS_DISTRO} STRGREATER "foxy")
set(USE_NEW_QOS_DEFN 1)
else()
set(USE_NEW_QOS_DEFN 0)
endif()

set(CMAKE_INCLUDE_CURRENT_DIR ON)

include_directories(include)
Expand All @@ -38,7 +30,6 @@ set(UI_FILES
ui/console_window.ui)
set(HEADER_FILES
include/swri_console/bag_reader.h
include/swri_console/defines.h
include/swri_console/console_master.h
include/swri_console/console_window.h
include/swri_console/log_database.h
Expand Down Expand Up @@ -66,11 +57,6 @@ qt5_wrap_cpp(SRC_FILES ${HEADER_FILES})

add_executable(swri_console ${HEADER_FILES} ${SRC_FILES} ${RCC_SRCS} src/main.cpp)

target_compile_definitions(swri_console
PRIVATE
USE_NEW_QOS_DEFN=${USE_NEW_QOS_DEFN}
)

target_link_libraries(swri_console
Qt5::Core
Qt5::Gui
Expand Down
14 changes: 0 additions & 14 deletions include/swri_console/defines.h

This file was deleted.

19 changes: 13 additions & 6 deletions src/console_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include <swri_console/log_database_proxy_model.h>
#include <swri_console/node_list_model.h>
#include <swri_console/settings_keys.h>
#include <swri_console/defines.h>

#include <QColorDialog>
#include <QRegExp>
Expand All @@ -65,6 +64,14 @@

using namespace Qt;

namespace log_level_mask {
static constexpr uint8_t DEBUG = 1 << 0;
static constexpr uint8_t INFO = 1 << 1;
static constexpr uint8_t WARN = 1 << 2;
static constexpr uint8_t ERROR = 1 << 3;
static constexpr uint8_t FATAL = 1 << 4;
};

namespace swri_console {

ConsoleWindow::ConsoleWindow(LogDatabase *db)
Expand Down Expand Up @@ -286,19 +293,19 @@ void ConsoleWindow::setSeverityFilter()
uint8_t mask = 0;

if (ui.checkDebug->isChecked()) {
mask |= LogLevelMask::DEBUG;
mask |= log_level_mask::DEBUG;
}
if (ui.checkInfo->isChecked()) {
mask |= LogLevelMask::INFO;
mask |= log_level_mask::INFO;
}
if (ui.checkWarn->isChecked()) {
mask |= LogLevelMask::WARN;
mask |= log_level_mask::WARN;
}
if (ui.checkError->isChecked()) {
mask |= LogLevelMask::ERROR;
mask |= log_level_mask::ERROR;
}
if (ui.checkFatal->isChecked()) {
mask |= LogLevelMask::FATAL;
mask |= log_level_mask::FATAL;
}

QSettings settings;
Expand Down
11 changes: 0 additions & 11 deletions src/ros_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,7 @@ void RosThread::emptyLogQueue(rcl_interfaces::msg::Log::ConstSharedPtr msg)

rclcpp::QoS RosThread::getQos()
{
#if USE_NEW_QOS_DEFN == 0
// Foxy does not have a rosout QoS profile, so we copy the initialization from
// rclc/logging_rosout.c
auto qos_profile = rmw_qos_profile_default;
qos_profile.depth = 1000;
qos_profile.durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL;
qos_profile.lifespan.sec = 10;
qos_profile.lifespan.nsec = 0;
return rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(qos_profile));
#else
// Humble and on can use the same QoS as the standard rosout config
return rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rcl_qos_profile_rosout_default));
#endif
}
}

0 comments on commit 54e36bc

Please sign in to comment.