Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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
19 changes: 18 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,30 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

if(WIN32)
add_compile_definitions(
# For math constants
# https://docs.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=vs-2019
_USE_MATH_DEFINES
# Minimize Windows namespace collision
NOMINMAX
WIN32_LEAN_AND_MEAN
)
# set the same behavior for windows as it is on linux
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()

##############################################################################
# Find dependencies
##############################################################################

find_package(ament_cmake REQUIRED)
find_package(pluginlib REQUIRED)
find_package(rclcpp REQUIRED)

if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()
find_package(Boost QUIET COMPONENTS headers)
if(NOT Boost_headers_FOUND)
find_package(Boost REQUIRED)
Expand Down Expand Up @@ -206,8 +223,8 @@ if(BUILD_TESTING)
set(_resource "$<TARGET_FILE:${test_plugin_target}>")
set(_output "${test_prefix}/lib/$<TARGET_FILE_NAME:${test_plugin_target}>")
add_custom_command(TARGET ${test_plugin_target}
POST_BUILD
COMMENT "Copying target ${test_plugin_target} for testing"
DEPENDS "${_resource}"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${_resource}"
"${_output}"
Expand Down
3 changes: 2 additions & 1 deletion include/filters/filter_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ class FilterBase
params_interface_->declare_parameter(param_name, default_parameter_value, desc);
}

value_out = params_interface_->get_parameter(param_name).get_parameter_value().get<PT>();
value_out =
static_cast<PT>(params_interface_->get_parameter(param_name).get_parameter_value().get<PT>());
// TODO(sloretz) seems to be no way to tell if parameter was initialized or not
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion include/filters/median.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ bool MedianFilter<T>::update(const T & data_in, T & data_out)
for (size_t row = 0; row < length; ++row) {
temp_storage_[row] = (*data_storage_)[row];
}
data_out = median(&temp_storage_[0], length);
data_out = median(&temp_storage_[0], static_cast<int>(length));

return true;
}
Expand Down
3 changes: 1 addition & 2 deletions test/test_realtime_circular_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@
*/

#include <gtest/gtest.h>
#include <sys/time.h>

#include <vector>
#include <utility>

#include "filters/realtime_circular_buffer.hpp"

TEST(RealtimeCircularBuffer, InitializationScalar)
Expand Down