Skip to content

Commit

Permalink
fixes for windows compilation (#1330)
Browse files Browse the repository at this point in the history
Co-authored-by: SENAI-GilmarCorreia <[email protected]>
  • Loading branch information
SENAI-GilmarCorreia and SENAI-GilmarCorreia authored Oct 31, 2024
1 parent 7c89c17 commit fa42b5e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ double resolve_tolerance_source(const double default_value, const double goal_va
// * -1 - The tolerance is "erased".
// If there was a default, the joint will be allowed to move without restriction.
constexpr double ERASE_VALUE = -1.0;
auto is_erase_value = [](double value)
auto is_erase_value = [=](double value)
{ return fabs(value - ERASE_VALUE) < std::numeric_limits<float>::epsilon(); };

if (goal_value > 0.0)
Expand Down
10 changes: 10 additions & 0 deletions pid_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow -Werror=format)
endif()

if(WIN32)
add_compile_definitions(
# For math constants
_USE_MATH_DEFINES
# Minimize Windows namespace collision
NOMINMAX
WIN32_LEAN_AND_MEAN
)
endif()

set(THIS_PACKAGE_INCLUDE_DEPENDS
angles
control_msgs
Expand Down

0 comments on commit fa42b5e

Please sign in to comment.