From 8ecadbc0bcf74d2c6253729247356b8ea5baf1cd Mon Sep 17 00:00:00 2001 From: Yadunund Date: Tue, 24 Jan 2023 02:09:37 +0800 Subject: [PATCH 1/3] Fix build with apple clang Signed-off-by: Yadunund --- rmf_traffic/CMakeLists.txt | 2 +- .../include/rmf_traffic/schedule/Database.hpp | 6 ++--- .../include/rmf_traffic/schedule/Mirror.hpp | 4 ++-- .../src/rmf_traffic/schedule/Database.cpp | 6 ++--- .../src/rmf_traffic/schedule/Mirror.cpp | 6 ++--- .../test/unit/schedule/test_Spacetime.cpp | 24 +++++++++---------- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/rmf_traffic/CMakeLists.txt b/rmf_traffic/CMakeLists.txt index c243afc4..7ab2de6d 100644 --- a/rmf_traffic/CMakeLists.txt +++ b/rmf_traffic/CMakeLists.txt @@ -10,7 +10,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) + add_compile_options(-Wall -Wextra -Wpedantic -Woverloaded-virtual) endif() if(NOT CMAKE_BUILD_TYPE) diff --git a/rmf_traffic/include/rmf_traffic/schedule/Database.hpp b/rmf_traffic/include/rmf_traffic/schedule/Database.hpp index 6318012f..2d27b4b1 100644 --- a/rmf_traffic/include/rmf_traffic/schedule/Database.hpp +++ b/rmf_traffic/include/rmf_traffic/schedule/Database.hpp @@ -113,7 +113,7 @@ class Database : public ItineraryViewer, public Writer, public Snappable // Documentation inherited from Viewer std::shared_ptr get_participant( - std::size_t participant_id) const final; + ParticipantId participant_id) const final; // Documentation inherited from Viewer Version latest_version() const; @@ -125,11 +125,11 @@ class Database : public ItineraryViewer, public Writer, public Snappable // Documentation inherited from ItineraryViewer std::optional get_itinerary( - std::size_t participant_id) const final; + ParticipantId participant_id) const final; // Documentation inherited from ItineraryViewer std::optional get_current_plan_id( - std::size_t participant_id) const final; + ParticipantId participant_id) const final; // Documentation inherited from ItineraryViewer const std::vector* get_current_progress( diff --git a/rmf_traffic/include/rmf_traffic/schedule/Mirror.hpp b/rmf_traffic/include/rmf_traffic/schedule/Mirror.hpp index 14c3c9e5..f6a6108d 100644 --- a/rmf_traffic/include/rmf_traffic/schedule/Mirror.hpp +++ b/rmf_traffic/include/rmf_traffic/schedule/Mirror.hpp @@ -51,11 +51,11 @@ class Mirror : public ItineraryViewer, public Snappable // Documentation inherited from Viewer std::shared_ptr get_participant( - std::size_t participant_id) const final; + ParticipantId participant_id) const final; // Documentation inherited from Viewer std::optional get_itinerary( - std::size_t participant_id) const final; + ParticipantId participant_id) const final; // Documentation inherited from Viewer std::optional latest_version() const; diff --git a/rmf_traffic/src/rmf_traffic/schedule/Database.cpp b/rmf_traffic/src/rmf_traffic/schedule/Database.cpp index 35db7448..c65dab21 100644 --- a/rmf_traffic/src/rmf_traffic/schedule/Database.cpp +++ b/rmf_traffic/src/rmf_traffic/schedule/Database.cpp @@ -1303,7 +1303,7 @@ const std::unordered_set& Database::participant_ids() const //============================================================================== std::shared_ptr Database::get_participant( - std::size_t participant_id) const + ParticipantId participant_id) const { const auto state_it = _pimpl->descriptions.find(participant_id); if (state_it == _pimpl->descriptions.end()) @@ -1320,7 +1320,7 @@ Version Database::latest_version() const //============================================================================== std::optional Database::get_itinerary( - const std::size_t participant_id) const + const ParticipantId participant_id) const { const auto state_it = _pimpl->states.find(participant_id); if (state_it == _pimpl->states.end()) @@ -1345,7 +1345,7 @@ std::optional Database::get_itinerary( //============================================================================== std::optional Database::get_current_plan_id( - const std::size_t participant_id) const + const ParticipantId participant_id) const { const auto state_it = _pimpl->states.find(participant_id); if (state_it == _pimpl->states.end()) diff --git a/rmf_traffic/src/rmf_traffic/schedule/Mirror.cpp b/rmf_traffic/src/rmf_traffic/schedule/Mirror.cpp index 4c1d7105..e84006a0 100644 --- a/rmf_traffic/src/rmf_traffic/schedule/Mirror.cpp +++ b/rmf_traffic/src/rmf_traffic/schedule/Mirror.cpp @@ -255,7 +255,7 @@ const std::unordered_set& Mirror::participant_ids() const //============================================================================== std::shared_ptr Mirror::get_participant( - std::size_t participant_id) const + ParticipantId participant_id) const { const auto p = _pimpl->descriptions.find(participant_id); if (p == _pimpl->descriptions.end()) @@ -272,7 +272,7 @@ std::optional Mirror::latest_version() const //============================================================================== std::optional Mirror::get_itinerary( - const std::size_t participant_id) const + const ParticipantId participant_id) const { const auto p = _pimpl->states.find(participant_id); if (p == _pimpl->states.end()) @@ -297,7 +297,7 @@ std::optional Mirror::get_itinerary( //============================================================================== std::optional Mirror::get_current_plan_id( - const std::size_t participant_id) const + const ParticipantId participant_id) const { const auto p = _pimpl->states.find(participant_id); if (p == _pimpl->states.end()) diff --git a/rmf_traffic/test/unit/schedule/test_Spacetime.cpp b/rmf_traffic/test/unit/schedule/test_Spacetime.cpp index e96cfb62..140ac524 100644 --- a/rmf_traffic/test/unit/schedule/test_Spacetime.cpp +++ b/rmf_traffic/test/unit/schedule/test_Spacetime.cpp @@ -41,8 +41,8 @@ SCENARIO("Testing intersection of spacetime with trajectories") const auto region_box_shape = rmf_traffic::geometry::make_final_convex< rmf_traffic::geometry::Box>(10.0, 1.0); - std::chrono::_V2::steady_clock::time_point lower_time_bound = time; - std::chrono::_V2::steady_clock::time_point upper_time_bound = time+10s; + std::chrono::steady_clock::time_point lower_time_bound = time; + std::chrono::steady_clock::time_point upper_time_bound = time+10s; rmf_traffic::internal::Spacetime region = { &lower_time_bound, @@ -117,8 +117,8 @@ SCENARIO("Testing intersction of various spacetimes and trajectories") using namespace std::chrono_literals; auto time = std::chrono::steady_clock::now(); Eigen::Isometry2d tf = Eigen::Isometry2d::Identity(); - std::chrono::_V2::steady_clock::time_point lower_time_bound; - std::chrono::_V2::steady_clock::time_point upper_time_bound; + std::chrono::steady_clock::time_point lower_time_bound; + std::chrono::steady_clock::time_point upper_time_bound; const auto region_box_shape = rmf_traffic::geometry::make_final_convex< rmf_traffic::geometry::Box>(10.0, 1.0); @@ -1210,8 +1210,8 @@ SCENARIO("Testing intersection of curved trajectory with various spacetimes") GIVEN("spacetime that encompasses the trajectory in space and time") { //creating space to create spacetime - std::chrono::_V2::steady_clock::time_point lower_time_bound = time; - std::chrono::_V2::steady_clock::time_point upper_time_bound = time+10s; + std::chrono::steady_clock::time_point lower_time_bound = time; + std::chrono::steady_clock::time_point upper_time_bound = time+10s; Eigen::Isometry2d tf = Eigen::Isometry2d::Identity(); rmf_traffic::internal::Spacetime region = { @@ -1227,8 +1227,8 @@ SCENARIO("Testing intersection of curved trajectory with various spacetimes") GIVEN("spacetime that encompasses the trajectory in space but not time") { //creating space to create spacetime - std::chrono::_V2::steady_clock::time_point lower_time_bound = time+20s; - std::chrono::_V2::steady_clock::time_point upper_time_bound = time+30s; + std::chrono::steady_clock::time_point lower_time_bound = time+20s; + std::chrono::steady_clock::time_point upper_time_bound = time+30s; Eigen::Isometry2d tf = Eigen::Isometry2d::Identity(); rmf_traffic::internal::Spacetime region = { @@ -1244,8 +1244,8 @@ SCENARIO("Testing intersection of curved trajectory with various spacetimes") GIVEN("spacetime that partially intersects the trajectory in space and time") { //creating space to create spacetime - std::chrono::_V2::steady_clock::time_point lower_time_bound = time; - std::chrono::_V2::steady_clock::time_point upper_time_bound = time+10s; + std::chrono::steady_clock::time_point lower_time_bound = time; + std::chrono::steady_clock::time_point upper_time_bound = time+10s; Eigen::Isometry2d tf = Eigen::Isometry2d::Identity(); rmf_traffic::internal::Spacetime region = { @@ -1263,8 +1263,8 @@ SCENARIO("Testing intersection of curved trajectory with various spacetimes") SCENARIO("Testing multi-waypoint trajectories with various spacetimes") { using namespace std::chrono_literals; - std::chrono::_V2::steady_clock::time_point lower_time_bound; - std::chrono::_V2::steady_clock::time_point upper_time_bound; + std::chrono::steady_clock::time_point lower_time_bound; + std::chrono::steady_clock::time_point upper_time_bound; const auto small_circle_shape = rmf_traffic::geometry::make_final_convex< rmf_traffic::geometry::Circle>(0.5); From 0e61feaa9a562e462475db0c709708541e008338 Mon Sep 17 00:00:00 2001 From: Yadunund Date: Wed, 25 Jan 2023 20:19:30 +0800 Subject: [PATCH 2/3] Remove warning flag Signed-off-by: Yadunund --- rmf_traffic/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmf_traffic/CMakeLists.txt b/rmf_traffic/CMakeLists.txt index 7ab2de6d..c243afc4 100644 --- a/rmf_traffic/CMakeLists.txt +++ b/rmf_traffic/CMakeLists.txt @@ -10,7 +10,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic -Woverloaded-virtual) + add_compile_options(-Wall -Wextra -Wpedantic) endif() if(NOT CMAKE_BUILD_TYPE) From 2cd027f45b6a7153519b228239d147caf864c067 Mon Sep 17 00:00:00 2001 From: Luca Della Vedova Date: Fri, 31 May 2024 20:49:11 +0200 Subject: [PATCH 3/3] Empty commit to trigger CI Signed-off-by: Luca Della Vedova