From 1878c8277a917ab4382e11948e3976be3eb53ad4 Mon Sep 17 00:00:00 2001
From: Christoph Pohl <christoph.pohl@kit.edu>
Date: Sat, 23 Dec 2023 13:26:59 +0100
Subject: [PATCH] Fix missing c++2b compile option under gcc 8

---
 .../ArticulatedObjectLocalizerExample.cpp                       | 2 +-
 .../components/ArticulatedObjectLocalizerExample/CMakeLists.txt | 1 -
 .../RobotAPI/components/DynamicObstacleManager/CMakeLists.txt   | 1 -
 .../DynamicObstacleManager/DynamicObstacleManager.cpp           | 2 +-
 .../armem/client/VirtualRobotWriterExample/CMakeLists.txt       | 1 -
 .../VirtualRobotWriterExample/VirtualRobotWriterExample.cpp     | 2 +-
 6 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/source/RobotAPI/components/ArticulatedObjectLocalizerExample/ArticulatedObjectLocalizerExample.cpp b/source/RobotAPI/components/ArticulatedObjectLocalizerExample/ArticulatedObjectLocalizerExample.cpp
index e5762482e..35f546692 100644
--- a/source/RobotAPI/components/ArticulatedObjectLocalizerExample/ArticulatedObjectLocalizerExample.cpp
+++ b/source/RobotAPI/components/ArticulatedObjectLocalizerExample/ArticulatedObjectLocalizerExample.cpp
@@ -176,7 +176,7 @@ namespace armarx::articulated_object
         const float t = static_cast<float>((now - start).toSecondsDouble());
 
         // move joints at certain frequency
-        const float k = (1 + std::sin(t / (M_2_PIf32))) / 2; // in [0,1]
+        const float k = (1 + std::sin(t / (M_2_PI))) / 2; // in [0,1]
 
         auto jointValues = articulatedObject->getJointValues();
 
diff --git a/source/RobotAPI/components/ArticulatedObjectLocalizerExample/CMakeLists.txt b/source/RobotAPI/components/ArticulatedObjectLocalizerExample/CMakeLists.txt
index bac8435fc..e92a5b368 100644
--- a/source/RobotAPI/components/ArticulatedObjectLocalizerExample/CMakeLists.txt
+++ b/source/RobotAPI/components/ArticulatedObjectLocalizerExample/CMakeLists.txt
@@ -17,7 +17,6 @@ armarx_add_component(
 
 # Add unit tests
 add_subdirectory(test)
-target_compile_options("${LIB_NAME}" PRIVATE -std=c++2b)
 
 # Generate the application
 armarx_generate_and_add_component_executable(
diff --git a/source/RobotAPI/components/DynamicObstacleManager/CMakeLists.txt b/source/RobotAPI/components/DynamicObstacleManager/CMakeLists.txt
index da370a54d..7136f05db 100644
--- a/source/RobotAPI/components/DynamicObstacleManager/CMakeLists.txt
+++ b/source/RobotAPI/components/DynamicObstacleManager/CMakeLists.txt
@@ -40,7 +40,6 @@ set(HEADERS
 
 
 armarx_add_component("${SOURCES}" "${HEADERS}")
-target_compile_options("DynamicObstacleManager" PRIVATE -std=c++2b)
 
 armarx_generate_and_add_component_executable()
 
diff --git a/source/RobotAPI/components/DynamicObstacleManager/DynamicObstacleManager.cpp b/source/RobotAPI/components/DynamicObstacleManager/DynamicObstacleManager.cpp
index 61497d62d..5d077bca2 100644
--- a/source/RobotAPI/components/DynamicObstacleManager/DynamicObstacleManager.cpp
+++ b/source/RobotAPI/components/DynamicObstacleManager/DynamicObstacleManager.cpp
@@ -260,7 +260,7 @@ namespace armarx
         std::shared_lock<std::shared_mutex> l{m_managed_obstacles_mutex};
 
         const Eigen::Vector2f diff = goal - agentPosition;
-        const Eigen::Vector2f orthogonal_normalized = Eigen::Vector2f(Eigen::Rotation2Df(M_PI_2f32) * diff).normalized();
+        const Eigen::Vector2f orthogonal_normalized = Eigen::Vector2f(Eigen::Rotation2Df(M_PI_2) * diff).normalized();
 
         const float sample_step = 5; // in [mm], sample step size towards goal.
         const float distance_to_goal = diff.norm() + safetyRadius;
diff --git a/source/RobotAPI/components/armem/client/VirtualRobotWriterExample/CMakeLists.txt b/source/RobotAPI/components/armem/client/VirtualRobotWriterExample/CMakeLists.txt
index 025c71bf7..678a03c3a 100644
--- a/source/RobotAPI/components/armem/client/VirtualRobotWriterExample/CMakeLists.txt
+++ b/source/RobotAPI/components/armem/client/VirtualRobotWriterExample/CMakeLists.txt
@@ -15,7 +15,6 @@ armarx_add_component(
         VirtualRobotWriterExample.h
 )
 
-target_compile_options("${LIB_NAME}" PRIVATE -std=c++2b)
 
 # Generate the application
 armarx_generate_and_add_component_executable(
diff --git a/source/RobotAPI/components/armem/client/VirtualRobotWriterExample/VirtualRobotWriterExample.cpp b/source/RobotAPI/components/armem/client/VirtualRobotWriterExample/VirtualRobotWriterExample.cpp
index d2a7eff51..675d2dae9 100644
--- a/source/RobotAPI/components/armem/client/VirtualRobotWriterExample/VirtualRobotWriterExample.cpp
+++ b/source/RobotAPI/components/armem/client/VirtualRobotWriterExample/VirtualRobotWriterExample.cpp
@@ -133,7 +133,7 @@ namespace armarx::virtual_robot_writer_example
         const float t = float((now - start).toSecondsDouble());
 
         // move joints at certain frequency
-        const float m = (1 + std::sin(t / (M_2_PIf32 * 10))) / 2; // in [0,1]
+        const float m = (1 + std::sin(t / (M_2_PI * 10))) / 2; // in [0,1]
 
         auto jointValues = robot->getJointValues();
         for (auto& [k, v] : jointValues)
-- 
GitLab