Skip to content

Commit

Permalink
fixes for windows compilation (#1330) (#1333)
Browse files Browse the repository at this point in the history
Co-authored-by: SENAI-GilmarCorreia <gilmar.correia@sp.senai.br>
(cherry picked from commit fa42b5e)

Co-authored-by: Gilmar Correia <gilmar.jeronimo@sp.senai.br>
  • Loading branch information
mergify[bot] and SENAI-GilmarCorreia authored Oct 31, 2024
1 parent e3c21e5 commit 54e72a2
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 @@ -136,7 +136,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)
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 54e72a2

Please sign in to comment.