From 4e0bed23066c4a7cc54257269b69e960dac8b1e0 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Sun, 16 Apr 2023 14:41:52 +0000 Subject: [PATCH 01/20] Adding initiator and request time to booking Signed-off-by: Aaron Chong --- rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp | 3 +++ rmf_task_ros2/src/rmf_task_ros2/Dispatcher.cpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp index b2459c7c0..da7590c25 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp @@ -421,6 +421,9 @@ void copy_booking_data( booking_json["id"] = booking.id(); booking_json["unix_millis_earliest_start_time"] = to_millis(booking.earliest_start_time().time_since_epoch()).count(); + booking_json["unix_millis_request_time"] = + to_millis(booking.request_time().time_since_epoch()).count(); + booking_json["initiator"] = booking.initiator(); // TODO(MXG): Add priority and labels } diff --git a/rmf_task_ros2/src/rmf_task_ros2/Dispatcher.cpp b/rmf_task_ros2/src/rmf_task_ros2/Dispatcher.cpp index a9269ef7b..bef0ec7e4 100644 --- a/rmf_task_ros2/src/rmf_task_ros2/Dispatcher.cpp +++ b/rmf_task_ros2/src/rmf_task_ros2/Dispatcher.cpp @@ -800,8 +800,10 @@ class Dispatcher::Implementation static const std::vector copy_fields = { "unix_millis_earliest_start_time", + "unix_millis_request_time", "priority", - "labels" + "labels", + "initiator", }; for (const auto& field : copy_fields) From 17e94ee3a421bc5d27e1e9a6b1a1ec577ce4f18e Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Mon, 8 May 2023 10:11:05 +0000 Subject: [PATCH 02/20] Use new booking and request API for EmergencyPullover and ResponsiveWait Signed-off-by: Aaron Chong --- .../rmf_fleet_adapter/events/EmergencyPullover.cpp | 12 +++++++++++- .../src/rmf_fleet_adapter/events/ResponsiveWait.cpp | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/events/EmergencyPullover.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/events/EmergencyPullover.cpp index 71e3a0c13..6ce58cb6b 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/events/EmergencyPullover.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/events/EmergencyPullover.cpp @@ -53,7 +53,17 @@ rmf_task::Task::ActivePtr EmergencyPullover::start( std::make_shared()), {}); const auto desc = builder.build("Emergency Pullover", ""); - const rmf_task::Request request(task_id, context->now(), nullptr, desc, true); + + const auto time_now = context->now(); + rmf_task::Task::ConstBookingPtr booking = + std::make_shared( + task_id, + time_now, + time_now, + nullptr, + context->requester_id(), + true); + const rmf_task::Request request(std::move(booking), desc); return activator.activate( context->make_get_state(), diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/events/ResponsiveWait.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/events/ResponsiveWait.cpp index 85d180baf..d4d552304 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/events/ResponsiveWait.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/events/ResponsiveWait.cpp @@ -70,7 +70,17 @@ rmf_task::Task::ActivePtr ResponsiveWait::start( ResponsiveWait::Description::make_indefinite(waiting_point)), {}); const auto desc = builder.build("Responsive Wait", ""); - const rmf_task::Request request(task_id, context->now(), nullptr, desc, true); + + const auto time_now = context->now(); + rmf_task::Task::ConstBookingPtr booking = + std::make_shared( + task_id, + time_now, + time_now, + nullptr, + context->requester_id(), + true); + const rmf_task::Request request(std::move(booking), desc); return context->task_activator()->activate( context->make_get_state(), From 53fd979fd8c192a347a1402c383629dd5735c2c2 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Mon, 8 May 2023 10:13:23 +0000 Subject: [PATCH 03/20] Using new booking and request API for FleetUpdateHandle Signed-off-by: Aaron Chong --- .../agv/FleetUpdateHandle.cpp | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp index 803dc3243..f3c00da69 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp @@ -238,6 +238,15 @@ std::shared_ptr FleetUpdateHandle::Implementation::convert( rmf_traffic::Time(std::chrono::milliseconds(t_it->get())); } + rmf_traffic::Time request_time = rmf_traffic_ros2::convert( + node->get_clock()->now()); + const auto r_it = request_msg.find("unix_millis_request_time"); + if (r_it != request_msg.end()) + { + request_time = + rmf_traffic::Time(std::chrono::milliseconds(r_it->get())); + } + // Note: make_low_priority() actually returns a nullptr. rmf_task::ConstPriorityPtr priority = rmf_task::BinaryPriorityScheme::make_low_priority(); @@ -279,12 +288,24 @@ std::shared_ptr FleetUpdateHandle::Implementation::convert( } } - const auto new_request = - std::make_shared( + std::string initiator; + const auto i_it = request_msg.find("initiator"); + if (i_it != request_msg.end()) + { + initiator = i_it->get(); + } + + rmf_task::Task::ConstBookingPtr booking = + std::make_shared( task_id, earliest_start_time, + request_time, priority, - deserialized_task.description); + initiator); + const auto new_request = + std::make_shared( + std::move(booking), + deserialized_task.description); return new_request; } From 045d4cce968b70a08724037a7746a3b48c9d9f2d Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Tue, 9 May 2023 05:36:53 +0000 Subject: [PATCH 04/20] Use requester instead of initiator, use new API Signed-off-by: Aaron Chong --- rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp | 7 +++++-- .../src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp | 8 ++++---- rmf_task_ros2/src/rmf_task_ros2/Dispatcher.cpp | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp index da7590c25..f5e5cdc6e 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp @@ -423,7 +423,7 @@ void copy_booking_data( to_millis(booking.earliest_start_time().time_since_epoch()).count(); booking_json["unix_millis_request_time"] = to_millis(booking.request_time().time_since_epoch()).count(); - booking_json["initiator"] = booking.initiator(); + booking_json["requester"] = booking.requester(); // TODO(MXG): Add priority and labels } @@ -1579,7 +1579,10 @@ void TaskManager::retreat_to_charger() { // Add a new charging task to the task queue const auto charging_request = rmf_task::requests::ChargeBattery::make( - current_state.time().value()); + current_state.time().value(), + rmf_traffic_ros2::convert(_context->node()->now()), + nullptr, + _context->requester_id()); const auto model = charging_request->description()->make_model( current_state.time().value(), parameters); diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp index f3c00da69..9f8721246 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp @@ -288,11 +288,11 @@ std::shared_ptr FleetUpdateHandle::Implementation::convert( } } - std::string initiator; - const auto i_it = request_msg.find("initiator"); + std::string requester; + const auto i_it = request_msg.find("requester"); if (i_it != request_msg.end()) { - initiator = i_it->get(); + requester = i_it->get(); } rmf_task::Task::ConstBookingPtr booking = @@ -301,7 +301,7 @@ std::shared_ptr FleetUpdateHandle::Implementation::convert( earliest_start_time, request_time, priority, - initiator); + requester); const auto new_request = std::make_shared( std::move(booking), diff --git a/rmf_task_ros2/src/rmf_task_ros2/Dispatcher.cpp b/rmf_task_ros2/src/rmf_task_ros2/Dispatcher.cpp index bef0ec7e4..07c973927 100644 --- a/rmf_task_ros2/src/rmf_task_ros2/Dispatcher.cpp +++ b/rmf_task_ros2/src/rmf_task_ros2/Dispatcher.cpp @@ -803,7 +803,7 @@ class Dispatcher::Implementation "unix_millis_request_time", "priority", "labels", - "initiator", + "requester", }; for (const auto& field : copy_fields) From dfdc46d67e7a0d40a0c6ee550ec18556aef1a0e6 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Tue, 9 May 2023 09:15:02 +0000 Subject: [PATCH 05/20] requester name for finishing task factories Signed-off-by: Aaron Chong --- rmf_fleet_adapter/src/full_control/main.cpp | 6 ++++-- rmf_fleet_adapter_python/src/adapter.cpp | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/rmf_fleet_adapter/src/full_control/main.cpp b/rmf_fleet_adapter/src/full_control/main.cpp index 295dd456e..eeb2b9b85 100644 --- a/rmf_fleet_adapter/src/full_control/main.cpp +++ b/rmf_fleet_adapter/src/full_control/main.cpp @@ -1237,7 +1237,8 @@ std::shared_ptr make_fleet( if (finishing_request_string == "charge") { finishing_request = - std::make_shared(); + std::make_shared( + std::string(node->get_name())); RCLCPP_INFO( node->get_logger(), "Fleet is configured to perform ChargeBattery as finishing request"); @@ -1245,7 +1246,8 @@ std::shared_ptr make_fleet( else if (finishing_request_string == "park") { finishing_request = - std::make_shared(); + std::make_shared( + std::string(node->get_name())); RCLCPP_INFO( node->get_logger(), "Fleet is configured to perform ParkRobot as finishing request"); diff --git a/rmf_fleet_adapter_python/src/adapter.cpp b/rmf_fleet_adapter_python/src/adapter.cpp index 80968a7cc..3d221e9ec 100644 --- a/rmf_fleet_adapter_python/src/adapter.cpp +++ b/rmf_fleet_adapter_python/src/adapter.cpp @@ -331,19 +331,22 @@ PYBIND11_MODULE(rmf_adapter, m) { double recharge_threshold, double recharge_soc, bool account_for_battery_drain, - const std::string& finishing_request_string = "nothing") + const std::string& finishing_request_string = "nothing", + const std::string& finishing_request_requester = "") { // Supported finishing_request_string: [charge, park, nothing] rmf_task::ConstRequestFactoryPtr finishing_request; if (finishing_request_string == "charge") { finishing_request = - std::make_shared(); + std::make_shared( + finishing_request_requester); } else if (finishing_request_string == "park") { finishing_request = - std::make_shared(); + std::make_shared( + finishing_request_requester); } else { @@ -367,7 +370,8 @@ PYBIND11_MODULE(rmf_adapter, m) { py::arg("recharge_threshold"), py::arg("recharge_soc"), py::arg("account_for_battery_drain"), - py::arg("finishing_request_string") = "nothing") + py::arg("finishing_request_string") = "nothing", + py::arg("finishing_request_requester") = "") .def("accept_delivery_requests", &agv::FleetUpdateHandle::accept_delivery_requests, "NOTE: deprecated, use consider_delivery_requests() instead") From ae5c3f6bc13d0593c04d872eda81a43e44e71304 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Wed, 31 May 2023 08:41:01 +0000 Subject: [PATCH 06/20] Using reverted constructors with nullopt default parameters Signed-off-by: Aaron Chong --- rmf_fleet_adapter/src/full_control/main.cpp | 1 + .../src/rmf_fleet_adapter/TaskManager.cpp | 19 ++++++++++++++----- .../agv/FleetUpdateHandle.cpp | 7 ++++--- .../events/EmergencyPullover.cpp | 4 ++-- .../events/ResponsiveWait.cpp | 4 ++-- rmf_fleet_adapter_python/src/adapter.cpp | 13 +++++++++---- 6 files changed, 32 insertions(+), 16 deletions(-) diff --git a/rmf_fleet_adapter/src/full_control/main.cpp b/rmf_fleet_adapter/src/full_control/main.cpp index eeb2b9b85..0d9aedd51 100644 --- a/rmf_fleet_adapter/src/full_control/main.cpp +++ b/rmf_fleet_adapter/src/full_control/main.cpp @@ -1247,6 +1247,7 @@ std::shared_ptr make_fleet( { finishing_request = std::make_shared( + std::nullopt, std::string(node->get_name())); RCLCPP_INFO( node->get_logger(), diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp index f5e5cdc6e..67114493a 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp @@ -421,9 +421,17 @@ void copy_booking_data( booking_json["id"] = booking.id(); booking_json["unix_millis_earliest_start_time"] = to_millis(booking.earliest_start_time().time_since_epoch()).count(); - booking_json["unix_millis_request_time"] = - to_millis(booking.request_time().time_since_epoch()).count(); - booking_json["requester"] = booking.requester(); + const auto requester = booking.requester(); + if (requester.has_value()) + { + booking_json["requester"] = requester.value(); + } + const auto request_time = booking.request_time(); + if (request_time.has_value()) + { + booking_json["unix_millis_request_time"] = + to_millis(request_time.value().time_since_epoch()).count(); + } // TODO(MXG): Add priority and labels } @@ -1580,9 +1588,10 @@ void TaskManager::retreat_to_charger() // Add a new charging task to the task queue const auto charging_request = rmf_task::requests::ChargeBattery::make( current_state.time().value(), - rmf_traffic_ros2::convert(_context->node()->now()), nullptr, - _context->requester_id()); + true, + _context->requester_id(), + rmf_traffic_ros2::convert(_context->node()->now())); const auto model = charging_request->description()->make_model( current_state.time().value(), parameters); diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp index 9f8721246..404794a54 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp @@ -288,7 +288,7 @@ std::shared_ptr FleetUpdateHandle::Implementation::convert( } } - std::string requester; + std::optional requester = std::nullopt; const auto i_it = request_msg.find("requester"); if (i_it != request_msg.end()) { @@ -299,9 +299,10 @@ std::shared_ptr FleetUpdateHandle::Implementation::convert( std::make_shared( task_id, earliest_start_time, - request_time, priority, - requester); + false, + std::move(requester), + request_time); const auto new_request = std::make_shared( std::move(booking), diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/events/EmergencyPullover.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/events/EmergencyPullover.cpp index 6ce58cb6b..2d51212f9 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/events/EmergencyPullover.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/events/EmergencyPullover.cpp @@ -59,10 +59,10 @@ rmf_task::Task::ActivePtr EmergencyPullover::start( std::make_shared( task_id, time_now, - time_now, nullptr, + true, context->requester_id(), - true); + time_now); const rmf_task::Request request(std::move(booking), desc); return activator.activate( diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/events/ResponsiveWait.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/events/ResponsiveWait.cpp index d4d552304..1a37e46c0 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/events/ResponsiveWait.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/events/ResponsiveWait.cpp @@ -76,10 +76,10 @@ rmf_task::Task::ActivePtr ResponsiveWait::start( std::make_shared( task_id, time_now, - time_now, nullptr, + true, context->requester_id(), - true); + time_now); const rmf_task::Request request(std::move(booking), desc); return context->task_activator()->activate( diff --git a/rmf_fleet_adapter_python/src/adapter.cpp b/rmf_fleet_adapter_python/src/adapter.cpp index 3d221e9ec..f9e0ae207 100644 --- a/rmf_fleet_adapter_python/src/adapter.cpp +++ b/rmf_fleet_adapter_python/src/adapter.cpp @@ -332,21 +332,26 @@ PYBIND11_MODULE(rmf_adapter, m) { double recharge_soc, bool account_for_battery_drain, const std::string& finishing_request_string = "nothing", - const std::string& finishing_request_requester = "") + const std::string& finishing_request_requester = std::string()) { // Supported finishing_request_string: [charge, park, nothing] rmf_task::ConstRequestFactoryPtr finishing_request; + std::optional requester = std::nullopt; + if (finishing_request_requester != std::string()) + { + requester = finishing_request_requester; + } if (finishing_request_string == "charge") { finishing_request = - std::make_shared( - finishing_request_requester); + std::make_shared(requester); } else if (finishing_request_string == "park") { finishing_request = std::make_shared( - finishing_request_requester); + std::nullopt, + requester); } else { From 1983c049183fad7712ff791594a2fbb90da8101d Mon Sep 17 00:00:00 2001 From: Yadu Date: Sat, 20 May 2023 07:08:14 -0700 Subject: [PATCH 07/20] Fix build failures on build farm (#274) * Fix style for rmf_fleet_adapter Signed-off-by: Yadunund * Make colcon test pass for rmf_traffic_ros2 Signed-off-by: Yadunund * Add rmf_fleet_adapter_python to build ci Signed-off-by: Yadunund --------- Signed-off-by: Yadunund --- .github/workflows/build.yaml | 4 ++-- rmf_fleet_adapter/CMakeLists.txt | 1 + .../rmf_rxcpp/include/rmf_rxcpp/RxJobs.hpp | 2 +- .../agv/internal_FleetUpdateHandle.hpp | 2 +- .../services/ProgressEvaluator.cpp | 10 ++++++++++ .../src/rmf_fleet_adapter/tasks/Clean.cpp | 4 ++++ .../src/rmf_fleet_adapter/tasks/Compose.cpp | 16 ++++++++++++++++ .../src/rmf_fleet_adapter/tasks/Delivery.cpp | 4 ++++ .../src/rmf_fleet_adapter/tasks/Patrol.cpp | 12 ++++++++++-- .../test/services/test_Negotiate.cpp | 2 +- rmf_task_ros2/CMakeLists.txt | 1 + rmf_traffic_ros2/CMakeLists.txt | 1 + .../rmf_traffic_ros2/schedule/MirrorManager.cpp | 4 ++-- .../rmf_traffic_ros2/schedule/Negotiation.cpp | 2 +- .../schedule/ParticipantRegistry.cpp | 2 +- 15 files changed, 56 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 28db20d01..332aa5add 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,9 +14,9 @@ jobs: uses: open-rmf/rmf_ci_templates/.github/workflows/reusable_build.yaml@main with: # NOTE: Avoid adding comments in the package lines, this can break some of the called scripts in github actions - # TODO(MXG): rmf_fleet_adapter_python tests are failing in the CI, and it seems to be related to https://github.com/ros2/launch/pull/592. Figure out how to fix this. packages: | rmf_fleet_adapter + rmf_fleet_adapter_python rmf_task_ros2 rmf_traffic_ros2 - rmf_websocket \ No newline at end of file + rmf_websocket diff --git a/rmf_fleet_adapter/CMakeLists.txt b/rmf_fleet_adapter/CMakeLists.txt index 554ce6fcf..57ff60fb6 100644 --- a/rmf_fleet_adapter/CMakeLists.txt +++ b/rmf_fleet_adapter/CMakeLists.txt @@ -57,6 +57,7 @@ if(BUILD_TESTING) ament_uncrustify( include src test rmf_rxcpp/include rmf_rxcpp/src rmf_rxcpp/test CONFIG_FILE ${uncrustify_config_file} + LANGUAGE C++ MAX_LINE_LENGTH 80 ) endif() diff --git a/rmf_fleet_adapter/rmf_rxcpp/include/rmf_rxcpp/RxJobs.hpp b/rmf_fleet_adapter/rmf_rxcpp/include/rmf_rxcpp/RxJobs.hpp index 078d04047..52f33492a 100644 --- a/rmf_fleet_adapter/rmf_rxcpp/include/rmf_rxcpp/RxJobs.hpp +++ b/rmf_fleet_adapter/rmf_rxcpp/include/rmf_rxcpp/RxJobs.hpp @@ -32,7 +32,7 @@ inline auto make_job(const std::shared_ptr& action) } template -inline auto merge_jobs(const Job0& o0, Jobs&& ... os) +inline auto merge_jobs(const Job0& o0, Jobs&&... os) { return o0.merge(rxcpp::serialize_event_loop(), os...); } diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/internal_FleetUpdateHandle.hpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/internal_FleetUpdateHandle.hpp index 66b71fcaa..56e8e5a7a 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/internal_FleetUpdateHandle.hpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/internal_FleetUpdateHandle.hpp @@ -326,7 +326,7 @@ class FleetUpdateHandle::Implementation std::unordered_set closed_lanes = {}; template - static std::shared_ptr make(Args&& ... args) + static std::shared_ptr make(Args&&... args) { auto handle = std::shared_ptr(new FleetUpdateHandle); handle->_pimpl = rmf_utils::make_unique_impl( diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/services/ProgressEvaluator.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/services/ProgressEvaluator.cpp index 79c3ae356..b784c33dc 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/services/ProgressEvaluator.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/services/ProgressEvaluator.cpp @@ -38,11 +38,15 @@ ProgressEvaluator::ProgressEvaluator( bool ProgressEvaluator::initialize(const Result& setup) { if (!setup.cost_estimate()) + { return false; + } const double cost = *setup.cost_estimate(); if (cost < best_estimate.cost) + { best_estimate = Info{cost, &setup}; + } return true; } @@ -62,11 +66,15 @@ bool ProgressEvaluator::evaluate(Result& progress) if (progress.success()) { if (cost < best_result.cost) + { best_result = Info{cost, &progress}; + } } if (cost < second_best_estimate.cost) + { second_best_estimate = Info{cost, &progress}; + } if (best_estimate.progress == &progress) { @@ -126,7 +134,9 @@ void ProgressEvaluator::discard(Result& progress) const double cost = progress.cost_estimate() ? *progress.cost_estimate() : std::numeric_limits::infinity(); if (best_discarded.progress || cost < best_discarded.cost) + { best_discarded = Info{cost, &progress}; + } ++finished_count; } diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Clean.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Clean.cpp index edace2b0f..e9c885a87 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Clean.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Clean.cpp @@ -290,7 +290,9 @@ void add_clean( agv::FleetUpdateHandle::Confirmation confirm; (*consider)(msg, confirm); if (!confirm.is_accepted()) + { return {nullptr, confirm.errors()}; + } // TODO(MXG): Validate the type of cleaning (vacuum, mopping, etc) /* *INDENT-OFF* */ @@ -310,7 +312,9 @@ void add_clean( { auto clean_task = deserialize_clean(msg); if (!clean_task.description) + { return {nullptr, std::move(clean_task.errors)}; + } /* *INDENT-OFF* */ return { diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Compose.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Compose.cpp index c272de0d0..b6b83c3a2 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Compose.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Compose.cpp @@ -58,7 +58,9 @@ void add_compose( // deserialize and use that. auto phase = p_it->second.deserializer(description_json); if (!phase.description) + { return {nullptr, std::move(phase.errors)}; + } return phase; } @@ -75,7 +77,9 @@ void add_compose( auto event = e_it->second.deserializer(description_json); if (!event.description) + { return {nullptr, std::move(event.errors)}; + } using rmf_task_sequence::phases::SimplePhase; /* *INDENT-OFF* */ @@ -103,7 +107,9 @@ void add_compose( -> agv::DeserializedTask { if (!(*consider)) + { return {nullptr, {"Not accepting composed requests"}}; + } rmf_task_sequence::Task::Builder builder; std::string category = "Composed Task"; @@ -122,7 +128,9 @@ void add_compose( { auto phase_activity = deser_activity(phase_json.at("activity")); if (!phase_activity.description) + { return {nullptr, std::move(phase_activity.errors)}; + } errors.insert( errors.end(), @@ -142,7 +150,9 @@ void add_compose( deser_activity(cancellation_activity_json); if (!cancellation_activity.description) + { return {nullptr, std::move(cancellation_activity.errors)}; + } cancel.push_back(cancellation_activity.description); errors.insert( @@ -164,7 +174,9 @@ void add_compose( agv::FleetUpdateHandle::Confirmation confirm; (*consider)(msg, confirm); if (!confirm.is_accepted()) + { return {nullptr, confirm.errors()}; + } /* *INDENT-OFF* */ return { @@ -210,7 +222,9 @@ void add_compose( auto event = e_it->second.deserializer(description_json); errors.insert(errors.end(), event.errors.begin(), event.errors.end()); if (!event.description) + { return {std::nullopt, std::move(errors)}; + } deps.push_back(event.description); } @@ -243,7 +257,9 @@ void add_compose( } if (!dependencies.description.has_value()) + { return {nullptr, std::move(dependencies.errors)}; + } /* *INDENT-OFF* */ return { diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Delivery.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Delivery.cpp index 8b5ea23b1..52a517c63 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Delivery.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Delivery.cpp @@ -229,7 +229,9 @@ make_deserializer( ](const nlohmann::json& msg) -> agv::DeserializedEvent { if (!consider || !(*consider)) + { return {nullptr, {"Not accepting delivery requests"}}; + } auto place = place_deser(msg.at("place")); if (!place.description.has_value()) @@ -272,7 +274,9 @@ make_deserializer( agv::FleetUpdateHandle::Confirmation confirm; (*consider)(msg, confirm); if (!confirm.is_accepted()) + { return {nullptr, confirm.errors()}; + } // TODO(MXG): Add a way for system integrators to specify a duration // estimate for the payload transfer diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Patrol.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Patrol.cpp index 765a8730c..75cefef9f 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Patrol.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/tasks/Patrol.cpp @@ -58,7 +58,9 @@ void add_patrol( auto place = place_deser(place_msg); if (!place.description.has_value()) + { return {nullptr, std::move(place.errors)}; + } const auto desc = GoToPlace::Description::make(std::move(*place.description)); @@ -74,16 +76,16 @@ void add_patrol( place.errors.end(), f.errors.begin(), f.errors.end()); if (!f.description.has_value()) + { return {nullptr, place.errors}; + } followed_by.push_back(*f.description); } desc->expected_next_destinations(std::move(followed_by)); } - /* *INDENT-OFF* */ return {desc, std::move(place.errors)}; - /* *INDENT-ON* */ }; deserialization.event->add( @@ -108,7 +110,9 @@ void add_patrol( ](const nlohmann::json& msg) -> agv::DeserializedTask { if (!(*consider)) + { return {nullptr, {"Not accepting patrol requests"}}; + } const auto& places_json = msg.at("places"); std::vector places; @@ -126,7 +130,9 @@ void add_patrol( } if (any_failure) + { return {nullptr, std::move(errors)}; + } agv::FleetUpdateHandle::Confirmation confirm; (*consider)(msg, confirm); @@ -134,7 +140,9 @@ void add_patrol( errors.end(), confirm.errors().begin(), confirm.errors().end()); if (!confirm.is_accepted()) + { return {nullptr, errors}; + } std::size_t rounds = 1; const auto& rounds_json_it = msg.find("rounds"); diff --git a/rmf_fleet_adapter/test/services/test_Negotiate.cpp b/rmf_fleet_adapter/test/services/test_Negotiate.cpp index 2386abb23..65f256a3a 100644 --- a/rmf_fleet_adapter/test/services/test_Negotiate.cpp +++ b/rmf_fleet_adapter/test/services/test_Negotiate.cpp @@ -578,7 +578,7 @@ class NegotiationRoom } template - static std::shared_ptr make(Args&& ... args) + static std::shared_ptr make(Args&&... args) { return std::make_shared(std::forward(args)...); } diff --git a/rmf_task_ros2/CMakeLists.txt b/rmf_task_ros2/CMakeLists.txt index 05a906954..48c9e4204 100644 --- a/rmf_task_ros2/CMakeLists.txt +++ b/rmf_task_ros2/CMakeLists.txt @@ -65,6 +65,7 @@ if(BUILD_TESTING) ament_uncrustify( ARGN include src test CONFIG_FILE ${uncrustify_config_file} + LANGUAGE C++ MAX_LINE_LENGTH 80 ) diff --git a/rmf_traffic_ros2/CMakeLists.txt b/rmf_traffic_ros2/CMakeLists.txt index e82287201..0eca56b92 100644 --- a/rmf_traffic_ros2/CMakeLists.txt +++ b/rmf_traffic_ros2/CMakeLists.txt @@ -50,6 +50,7 @@ if(BUILD_TESTING) ament_uncrustify( ARGN include src examples CONFIG_FILE ${uncrustify_config_file} + LANGUAGE C++ MAX_LINE_LENGTH 80 ) diff --git a/rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/MirrorManager.cpp b/rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/MirrorManager.cpp index 3da00b1ae..aa294ca25 100644 --- a/rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/MirrorManager.cpp +++ b/rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/MirrorManager.cpp @@ -650,7 +650,7 @@ class MirrorManager::Implementation } template - static MirrorManager make(Args&& ... args) + static MirrorManager make(Args&&... args) { MirrorManager mgr; mgr._pimpl = rmf_utils::make_unique_impl( @@ -875,7 +875,7 @@ class MirrorManagerFuture::Implementation } template - static MirrorManagerFuture make(Args&& ... args) + static MirrorManagerFuture make(Args&&... args) { MirrorManagerFuture mmf; mmf._pimpl = rmf_utils::make_unique_impl( diff --git a/rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/Negotiation.cpp b/rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/Negotiation.cpp index 74f44ebff..80fe47c26 100644 --- a/rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/Negotiation.cpp +++ b/rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/Negotiation.cpp @@ -81,7 +81,7 @@ class Negotiation::Implementation template static std::shared_ptr make( - Args&& ... args) + Args&&... args) { auto responder = std::make_shared(std::forward(args)...); rclcpp::Node& node = responder->impl->node; diff --git a/rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/ParticipantRegistry.cpp b/rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/ParticipantRegistry.cpp index 6cd43901c..0aa2939b5 100644 --- a/rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/ParticipantRegistry.cpp +++ b/rmf_traffic_ros2/src/rmf_traffic_ros2/schedule/ParticipantRegistry.cpp @@ -42,7 +42,7 @@ struct UniqueIdHasher { std::size_t operator()(UniqueId id) const { - return std::hash{} (id.name + id.owner); + return std::hash{}(id.name + id.owner); } }; From 4be4530965ecc992e2cae3cd98e2725ab6855a96 Mon Sep 17 00:00:00 2001 From: Yadu Date: Sat, 20 May 2023 08:56:37 -0700 Subject: [PATCH 08/20] Update changelogs and bump patch (#275) Signed-off-by: Yadunund --- rmf_fleet_adapter/CHANGELOG.md | 5 +++++ rmf_fleet_adapter/package.xml | 2 +- rmf_fleet_adapter_python/CHANGELOG.md | 3 +++ rmf_fleet_adapter_python/package.xml | 2 +- rmf_task_ros2/CHANGELOG.md | 5 +++++ rmf_task_ros2/package.xml | 2 +- rmf_traffic_ros2/CHANGELOG.md | 5 +++++ rmf_traffic_ros2/package.xml | 2 +- rmf_websocket/CHANGELOG.md | 3 +++ rmf_websocket/package.xml | 2 +- 10 files changed, 26 insertions(+), 5 deletions(-) diff --git a/rmf_fleet_adapter/CHANGELOG.md b/rmf_fleet_adapter/CHANGELOG.md index 730cf3766..d9fe4fc34 100644 --- a/rmf_fleet_adapter/CHANGELOG.md +++ b/rmf_fleet_adapter/CHANGELOG.md @@ -1,5 +1,10 @@ ## Changelog for package rmf_fleet_adapter +2.1.5 (2023-05-20) +------------------ +* Reformat code to meet expectations of uncrustify-0.72.0: [#274](https://github.com/open-rmf/rmf_ros2/issues/274) +* Contributors: Yadunund + 2.1.4 (2023-04-27) ------------------ diff --git a/rmf_fleet_adapter/package.xml b/rmf_fleet_adapter/package.xml index 53a1817ae..37b0e5867 100644 --- a/rmf_fleet_adapter/package.xml +++ b/rmf_fleet_adapter/package.xml @@ -2,7 +2,7 @@ rmf_fleet_adapter - 2.1.4 + 2.1.5 Fleet Adapter package for RMF fleets. Grey Aaron diff --git a/rmf_fleet_adapter_python/CHANGELOG.md b/rmf_fleet_adapter_python/CHANGELOG.md index c511db862..0886055ad 100644 --- a/rmf_fleet_adapter_python/CHANGELOG.md +++ b/rmf_fleet_adapter_python/CHANGELOG.md @@ -1,5 +1,8 @@ ## Changelog for package rmf_fleet_adapter_python +2.1.5 (2023-05-20) +------------------ + 2.1.4 (2023-04-27) ------------------ diff --git a/rmf_fleet_adapter_python/package.xml b/rmf_fleet_adapter_python/package.xml index 002f982d1..176c953cc 100644 --- a/rmf_fleet_adapter_python/package.xml +++ b/rmf_fleet_adapter_python/package.xml @@ -2,7 +2,7 @@ rmf_fleet_adapter_python - 2.1.4 + 2.1.5 Python bindings for the rmf_fleet_adapter methylDragon Marco A. Gutiérrez diff --git a/rmf_task_ros2/CHANGELOG.md b/rmf_task_ros2/CHANGELOG.md index 33fbdc551..da1138294 100644 --- a/rmf_task_ros2/CHANGELOG.md +++ b/rmf_task_ros2/CHANGELOG.md @@ -1,5 +1,10 @@ ## Changelog for package rmf_task_ros2 +2.1.5 (2023-05-20) +------------------ +* Reformat code to meet expectations of uncrustify-0.72.0: [#274](https://github.com/open-rmf/rmf_ros2/issues/274) +* Contributors: Yadunund + 2.1.4 (2023-04-27) ------------------ diff --git a/rmf_task_ros2/package.xml b/rmf_task_ros2/package.xml index ac2ba7c93..9e71f824d 100644 --- a/rmf_task_ros2/package.xml +++ b/rmf_task_ros2/package.xml @@ -2,7 +2,7 @@ rmf_task_ros2 - 2.1.4 + 2.1.5 A package managing the dispatching of tasks in RMF system. Yadunund Marco A. Gutiérrez diff --git a/rmf_traffic_ros2/CHANGELOG.md b/rmf_traffic_ros2/CHANGELOG.md index 56e73ff21..089d84192 100644 --- a/rmf_traffic_ros2/CHANGELOG.md +++ b/rmf_traffic_ros2/CHANGELOG.md @@ -1,5 +1,10 @@ ## Changelog for package rmf_traffic_ros2 +2.1.5 (2023-05-20) +------------------ +* Reformat code to meet expectations of uncrustify-0.72.0: [#274](https://github.com/open-rmf/rmf_ros2/issues/274) +* Contributors: Yadunund + 2.1.4 (2023-04-27) ------------------ diff --git a/rmf_traffic_ros2/package.xml b/rmf_traffic_ros2/package.xml index 96f311cce..d0591a92b 100644 --- a/rmf_traffic_ros2/package.xml +++ b/rmf_traffic_ros2/package.xml @@ -2,7 +2,7 @@ rmf_traffic_ros2 - 2.1.4 + 2.1.5 A package containing messages used by the RMF traffic management system. Grey Marco A. Gutiérrez diff --git a/rmf_websocket/CHANGELOG.md b/rmf_websocket/CHANGELOG.md index 6113c8a5f..050cbb038 100644 --- a/rmf_websocket/CHANGELOG.md +++ b/rmf_websocket/CHANGELOG.md @@ -1,5 +1,8 @@ ## Changelog for package rmf_websocket +2.1.5 (2023-05-20) +------------------ + 2.1.4 (2023-04-27) ------------------ diff --git a/rmf_websocket/package.xml b/rmf_websocket/package.xml index d35233ee3..9654e84a8 100644 --- a/rmf_websocket/package.xml +++ b/rmf_websocket/package.xml @@ -2,7 +2,7 @@ rmf_websocket - 2.1.4 + 2.1.5 A package managing the websocket api endpoints in RMF system. Yadunund Marco A. Gutiérrez From 5ae2b3911c703aff04d20145b50237ed7d1f06c3 Mon Sep 17 00:00:00 2001 From: Yadu Date: Tue, 23 May 2023 02:35:47 -0700 Subject: [PATCH 09/20] Switch to rst changelogs (#276) Signed-off-by: Yadunund --- rmf_fleet_adapter/CHANGELOG.md | 107 ----------------- rmf_fleet_adapter/CHANGELOG.rst | 109 ++++++++++++++++++ .../{CHANGELOG.md => CHANGELOG.rst} | 28 ++--- rmf_task_ros2/CHANGELOG.md | 43 ------- rmf_task_ros2/CHANGELOG.rst | 45 ++++++++ rmf_traffic_ros2/CHANGELOG.md | 72 ------------ rmf_traffic_ros2/CHANGELOG.rst | 74 ++++++++++++ rmf_websocket/{CHANGELOG.md => CHANGELOG.rst} | 4 +- 8 files changed, 246 insertions(+), 236 deletions(-) delete mode 100644 rmf_fleet_adapter/CHANGELOG.md create mode 100644 rmf_fleet_adapter/CHANGELOG.rst rename rmf_fleet_adapter_python/{CHANGELOG.md => CHANGELOG.rst} (62%) delete mode 100644 rmf_task_ros2/CHANGELOG.md create mode 100644 rmf_task_ros2/CHANGELOG.rst delete mode 100644 rmf_traffic_ros2/CHANGELOG.md create mode 100644 rmf_traffic_ros2/CHANGELOG.rst rename rmf_websocket/{CHANGELOG.md => CHANGELOG.rst} (82%) diff --git a/rmf_fleet_adapter/CHANGELOG.md b/rmf_fleet_adapter/CHANGELOG.md deleted file mode 100644 index d9fe4fc34..000000000 --- a/rmf_fleet_adapter/CHANGELOG.md +++ /dev/null @@ -1,107 +0,0 @@ -## Changelog for package rmf_fleet_adapter - -2.1.5 (2023-05-20) ------------------- -* Reformat code to meet expectations of uncrustify-0.72.0: [#274](https://github.com/open-rmf/rmf_ros2/issues/274) -* Contributors: Yadunund - -2.1.4 (2023-04-27) ------------------- - -2.1.3 (2023-04-26) ------------------- -* Fix emergency response for waiting robots: [#253](https://github.com/open-rmf/rmf_ros2/pull/253) -* Properly cleanup emergency pullover task: [#258](https://github.com/open-rmf/rmf_ros2/pull/258) -* Fix priority assignment when parsing tasks: [#265](https://github.com/open-rmf/rmf_ros2/issues/265) -* Link Threads to fix build errors on certain platforms: [#204](https://github.com/open-rmf/rmf_ros2/issues/204) -* Contributors: decada-robotics, Luca Della Vedova, Grey, Yadunund - -2.1.2 (2022-10-10) ------------------- - -2.1.0 (2022-10-03) ------------------- -* Add API to update speed limits for lanes: [#217](https://github.com/open-rmf/rmf_ros2/pull/217) -* Make async behaviors more robust: [#228](https://github.com/open-rmf/rmf_ros2/pull/228) -* Allow fleet adapters to change schedule participant profiles: [#229](https://github.com/open-rmf/rmf_ros2/pull/229) -* Allow robots to be decommissioned from the task dispatch system: [#233](https://github.com/open-rmf/rmf_ros2/pull/233) -* Allow manual toggling of stubborn negotiation: [#196](https://github.com/open-rmf/rmf_ros2/pull/196) -* Allow users to specify a custom update listener: [#198](https://github.com/open-rmf/rmf_ros2/pull/198) -* Introduce `WaitUntil` activity and use it in the `ResponsiveWait`: [#199](https://github.com/open-rmf/rmf_ros2/pull/199) -* Better support for patrol behaviors: [#205](https://github.com/open-rmf/rmf_ros2/pull/205) -* Allow `ResponsiveWait` to be enabled and disabled: [#209](https://github.com/open-rmf/rmf_ros2/pull/209) -* Publish the navigation graph of the fleet adapter: [#207](https://github.com/open-rmf/rmf_ros2/pull/207) -* Allow robot status to be overridden by the user: [#191](https://github.com/open-rmf/rmf_ros2/pull/191) -* Add API to report status for `perform_action`: [#190](https://github.com/open-rmf/rmf_ros2/pull/190) -* Add APIs for cancelling and killing tasks from the `RobotUpdateHandle`: [#205](https://github.com/open-rmf/rmf_ros2/pull/205) -* Add a WaitUntil event and use it for ResponsiveWait: [#199](https://github.com/open-rmf/rmf_ros2/pull/199) - -2.0.0 (2022-03-18) ------------------- -* Update to traffic dependency system: [#188](https://github.com/open-rmf/rmf_ros2/pull/188) - -1.5.0 (2022-02-14) ------------------- -* Support flexible task definitions [#168](https://github.com/open-rmf/rmf_ros2/pull/168) -* Add lane speed limit to graph parsing function [#124](https://github.com/open-rmf/rmf_ros2/pull/124) -* Support for geojson graphs [#142](https://github.com/open-rmf/rmf_ros2/pull/142) - -1.4.0 (2021-09-01) ------------------- -* Add read_only_blockade adapter: [#110](https://github.com/open-rmf/rmf_ros2/pull/110) -* Accommodate finishing tasks: [#108](https://github.com/open-rmf/rmf_ros2/pull/108) -* Check if lane request's fleet_name is equal to the fleet's fleet_name: [#95](https://github.com/open-rmf/rmf_ros2/pull/95) -* Find nearest waypoint among starts: [#98](https://github.com/open-rmf/rmf_ros2/pull/98) - -1.3.0 (2021-06-07) ------------------- -* Add API for opening and closing lanes: [#15](https://github.com/open-rmf/rmf_ros2/pull/15) - * Added `open_lanes` and `close_lanes` CLI tools for issuing requests -* Allow Traffic Light APIs to update the location of a robot while it is idle: [#270](https://github.com/osrf/rmf_core/pull/270) -* Allow TrafficLight and EasyTrafficLight API to update battery level: [#263](https://github.com/osrf/rmf_core/pull/263) -* Migrating to a task dispatcher framework: [#217](https://github.com/osrf/rmf_core/pull/217) - * The `rmf_fleet_adapter::agv` component interacts with a dispatcher node over topics with `rmf_task` prefix as specified in `rmf_fleet_adapter/StandardNames.hpp` - * Support for executing tasks at specified timepoints - * Support for `Loop`, `Delivery`, `Clean` and `ChargeBattery` tasks -* Introduce ResponsiveWait: [#308](https://github.com/osrf/rmf_core/pull/308) - * The new ResponsiveWait task phase can be used to have idle/waiting robots respond to schedule conflicts - * Idle robots (robots that do not have an assigned task) will automatically enter ResponsiveWait mode - - -1.2.0 (2021-01-05) ------------------- -* Automatically publish fleet states from the fleet adapter API: [#232](https://github.com/osrf/rmf_core/pull/232) -* Easy Traffic Light API: [#226](https://github.com/osrf/rmf_core/pull/226) -* Gridlock-proof Traffic Light Implementation: [#226](https://github.com/osrf/rmf_core/pull/226) - -1.1.0 (2020-09-24) ------------------- -* Traffic Light API: [#147](https://github.com/osrf/rmf_core/pull/147) [#176](https://github.com/osrf/rmf_core/pull/176) [#180](https://github.com/osrf/rmf_core/pull/180) -* Allow fleet adapters to adjust the maximum delay: [#148](https://github.com/osrf/rmf_core/pull/148) -* Full Control Fleet Adapters respond to emergency alarm topic: [#162](https://github.com/osrf/rmf_core/pull/162) -* Migrating to ROS2 Foxy: [#133](https://github.com/osrf/rmf_core/pull/133) -* Contributors: Chen Bainian, Grey, Kevin_Skywalker, Marco A. Gutiérrez, Rushyendra Maganty, Yadu - -1.0.2 (2020-07-27) ------------------- -* Always respond to negotiations: [#138](https://github.com/osrf/rmf_core/pull/138) - -1.0.1 (2020-07-20) ------------------- -* Interrupt dangling negotiation planning efforts to reduce memory usage: [#130](https://github.com/osrf/rmf_core/pull/130/) -* Trim the amount of system memory that is committed to a fleet adapter after each task: [#130](https://github.com/osrf/rmf_core/pull/130/) - -1.0.0 (2020-06-23) ------------------- -* Provides `rmf_fleet_adapter` library - * The `rmf_fleet_adapter::agv` component can be used to develop a custom "Full Control" fleet adapter - * `rmf_fleet_adapter/StandardNames.hpp` specifies topic names that are used for RMF integration -* Provides a prototype `read_only` fleet adapter implementation - * This will be deprecated in the future in favor of a C++ API - * To use this fleet adapter, you must implement a "read-only fleet driver" to talk to the fleet adapter using `rmf_fleet_msgs` -* Provides a deprecated `full_control` fleet adapter implementation - * This is made to be backwards compatible with "full-control fleet drivers" that were developed in the early stages of RMF - * New users should prefer to implement their own fleet adapter using the `rmf_fleet_adapter::agv` API -* Uses rxcpp to make the fleet adapters reactive and multi-threaded -* Has a known memory leak issue which will be resolved in a later release -* Contributors: Aaron Chong, Charayaphan Nakorn Boon Han, Marco A. Gutiérrez, Grey, Yadu, Yadunund, koonpeng, methylDragon diff --git a/rmf_fleet_adapter/CHANGELOG.rst b/rmf_fleet_adapter/CHANGELOG.rst new file mode 100644 index 000000000..8b27ba611 --- /dev/null +++ b/rmf_fleet_adapter/CHANGELOG.rst @@ -0,0 +1,109 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package rmf_fleet_adapter +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +2.1.5 (2023-05-20) +------------------ +* Reformat code to meet expectations of uncrustify-0.72.0: (`#274 `_) +* Contributors: Yadunund + +2.1.4 (2023-04-27) +------------------ + +2.1.3 (2023-04-26) +------------------ +* Fix emergency response for waiting robots: (`#253 `_) +* Properly cleanup emergency pullover task: (`#258 `_) +* Fix priority assignment when parsing tasks: (`#265 `_) +* Link Threads to fix build errors on certain platforms: (`#204 `_) +* Contributors: decada-robotics, Luca Della Vedova, Grey, Yadunund + +2.1.2 (2022-10-10) +------------------ + +2.1.0 (2022-10-03) +------------------ +* Add API to update speed limits for lanes: (`#217 `_) +* Make async behaviors more robust: (`#228 `_) +* Allow fleet adapters to change schedule participant profiles: (`#229 `_) +* Allow robots to be decommissioned from the task dispatch system: (`#233 `_) +* Allow manual toggling of stubborn negotiation: (`#196 `_) +* Allow users to specify a custom update listener: (`#198 `_) +* Introduce `WaitUntil` activity and use it in the `ResponsiveWait`: (`#199 `_) +* Better support for patrol behaviors: (`#205 `_) +* Allow `ResponsiveWait` to be enabled and disabled: (`#209 `_) +* Publish the navigation graph of the fleet adapter: (`#207 `_) +* Allow robot status to be overridden by the user: (`#191 `_) +* Add API to report status for `perform_action`: (`#190 `_) +* Add APIs for cancelling and killing tasks from the `RobotUpdateHandle`: (`#205 `_) +* Add a WaitUntil event and use it for ResponsiveWait: (`#199 `_) + +2.0.0 (2022-03-18) +------------------ +* Update to traffic dependency system: (`#188 `_) + +1.5.0 (2022-02-14) +------------------ +* Support flexible task definitions (`#168 `_) +* Add lane speed limit to graph parsing function (`#124 `_) +* Support for geojson graphs (`#142 `_) + +1.4.0 (2021-09-01) +------------------ +* Add read_only_blockade adapter: (`#110 `_) +* Accommodate finishing tasks: (`#108 `_) +* Check if lane request's fleet_name is equal to the fleet's fleet_name: (`#95 `_) +* Find nearest waypoint among starts: (`#98 `_) + +1.3.0 (2021-06-07) +------------------ +* Add API for opening and closing lanes: (`#15 `_) + * Added `open_lanes` and `close_lanes` CLI tools for issuing requests +* Allow Traffic Light APIs to update the location of a robot while it is idle: (`#270 `_) +* Allow TrafficLight and EasyTrafficLight API to update battery level: (`#263 `_) +* Migrating to a task dispatcher framework: (`#21 `_) + * The `rmf_fleet_adapter::agv` component interacts with a dispatcher node over topics with `rmf_task` prefix as specified in `rmf_fleet_adapter/StandardNames.hpp` + * Support for executing tasks at specified timepoints + * Support for `Loop`, `Delivery`, `Clean` and `ChargeBattery` tasks +* Introduce ResponsiveWait: (`#308 `_) + * The new ResponsiveWait task phase can be used to have idle/waiting robots respond to schedule conflicts + * Idle robots (robots that do not have an assigned task) will automatically enter ResponsiveWait mode + + +1.2.0 (2021-01-05) +------------------ +* Automatically publish fleet states from the fleet adapter API: (`#232 `_) +* Easy Traffic Light API: (`#226 `_) +* Gridlock-proof Traffic Light Implementation: (`#226 `_) + +1.1.0 (2020-09-24) +------------------ +* Traffic Light API: (`#147 `_) +* Allow fleet adapters to adjust the maximum delay: (`#148 `_) +* Full Control Fleet Adapters respond to emergency alarm topic: (`#162 `_) +* Migrating to ROS2 Foxy: (`#133 `_) +* Contributors: Chen Bainian, Grey, Kevin_Skywalker, Marco A. Gutiérrez, Rushyendra Maganty, Yadu + +1.0.2 (2020-07-27) +------------------ +* Always respond to negotiations: (`#138 `_) + +1.0.1 (2020-07-20) +------------------ +* Interrupt dangling negotiation planning efforts to reduce memory usage: (`#130 `_) +* Trim the amount of system memory that is committed to a fleet adapter after each task: (`#130 `_) + +1.0.0 (2020-06-23) +------------------ +* Provides `rmf_fleet_adapter` library + * The `rmf_fleet_adapter::agv` component can be used to develop a custom "Full Control" fleet adapter + * `rmf_fleet_adapter/StandardNames.hpp` specifies topic names that are used for RMF integration +* Provides a prototype `read_only` fleet adapter implementation + * This will be deprecated in the future in favor of a C++ API + * To use this fleet adapter, you must implement a "read-only fleet driver" to talk to the fleet adapter using `rmf_fleet_msgs` +* Provides a deprecated `full_control` fleet adapter implementation + * This is made to be backwards compatible with "full-control fleet drivers" that were developed in the early stages of RMF + * New users should prefer to implement their own fleet adapter using the `rmf_fleet_adapter::agv` API +* Uses rxcpp to make the fleet adapters reactive and multi-threaded +* Has a known memory leak issue which will be resolved in a later release +* Contributors: Aaron Chong, Charayaphan Nakorn Boon Han, Marco A. Gutiérrez, Grey, Yadu, Yadunund, koonpeng, methylDragon diff --git a/rmf_fleet_adapter_python/CHANGELOG.md b/rmf_fleet_adapter_python/CHANGELOG.rst similarity index 62% rename from rmf_fleet_adapter_python/CHANGELOG.md rename to rmf_fleet_adapter_python/CHANGELOG.rst index 0886055ad..ba16afbec 100644 --- a/rmf_fleet_adapter_python/CHANGELOG.md +++ b/rmf_fleet_adapter_python/CHANGELOG.rst @@ -1,4 +1,6 @@ -## Changelog for package rmf_fleet_adapter_python +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package rmf_fleet_adapter_python +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2.1.5 (2023-05-20) ------------------ @@ -14,16 +16,16 @@ 2.1.0 (2022-10-03) ------------------ -* Make async behaviors more robust: [#228](https://github.com/open-rmf/rmf_ros2/pull/228) -* Allow fleet adapters to change schedule participant profiles: [#229](https://github.com/open-rmf/rmf_ros2/pull/229) -* Allow robots to be decommissioned from the task dispatch system: [#233](https://github.com/open-rmf/rmf_ros2/pull/233) -* Allow manual toggling of stubborn negotiation: [#196](https://github.com/open-rmf/rmf_ros2/pull/196) -* Allow users to specify a custom update listener: [#198](https://github.com/open-rmf/rmf_ros2/pull/198) -* Fix various segfaults related to pybind: [#205](https://github.com/open-rmf/rmf_ros2/pull/205) -* Allow `ResponsiveWait` to be enabled and disabled: [#209](https://github.com/open-rmf/rmf_ros2/pull/209) -* Allow robot status to be overridden by the user: [#191](https://github.com/open-rmf/rmf_ros2/pull/191) -* Add API to report status for `perform_action`: [#190](https://github.com/open-rmf/rmf_ros2/pull/190) -* Changes for humble compatibility: [#215](https://github.com/open-rmf/rmf_ros2/issues/215) +* Make async behaviors more robust: (`#228 `_) +* Allow fleet adapters to change schedule participant profiles: (`#229 `_) +* Allow robots to be decommissioned from the task dispatch system: (`#233 `_) +* Allow manual toggling of stubborn negotiation: (`#196 `_) +* Allow users to specify a custom update listener: (`#198 `_) +* Fix various segfaults related to pybind: (`#205 `_) +* Allow `ResponsiveWait` to be enabled and disabled: (`#209 `_) +* Allow robot status to be overridden by the user: (`#191 `_) +* Add API to report status for `perform_action`: (`#190 `_) +* Changes for humble compatibility: (`#215 `_) 2.0.0 (2022-03-18) ------------------ @@ -31,8 +33,8 @@ No changes yet 1.5.0 (2022-02-14) ------------------ -* Support flexible task definitions [#168](https://github.com/open-rmf/rmf_ros2/pull/168) -* Add lane speed limit to graph parsing function [#124](https://github.com/open-rmf/rmf_ros2/pull/124) +* Support flexible task definitions (`#168 `_) +* Add lane speed limit to graph parsing function (`#124 `_) 1.3.0 (2021-06-07) ------------------ diff --git a/rmf_task_ros2/CHANGELOG.md b/rmf_task_ros2/CHANGELOG.md deleted file mode 100644 index da1138294..000000000 --- a/rmf_task_ros2/CHANGELOG.md +++ /dev/null @@ -1,43 +0,0 @@ -## Changelog for package rmf_task_ros2 - -2.1.5 (2023-05-20) ------------------- -* Reformat code to meet expectations of uncrustify-0.72.0: [#274](https://github.com/open-rmf/rmf_ros2/issues/274) -* Contributors: Yadunund - -2.1.4 (2023-04-27) ------------------- - -2.1.3 (2023-04-26) ------------------- -* Link Threads to fix build errors on certain platforms: [#204](https://github.com/open-rmf/rmf_ros2/issues/204) -* Contributors: decada-robotics, Grey - -2.1.2 (2022-10-10) ------------------- -* Add find_package for vendored project. - The vendor package for nlohmann_json_schema_validator was previously - exporting dependency info for that package, however that is not the - recommended workflow for vendor packages which are ideally as - transparent as possible. -* Contributors: Steven! Ragnarök - - -2.1.0 (2022-10-03) ------------------- -* Change default task auction evaluator to `QuickestFinishEvaluator`: [#211](https://github.com/open-rmf/rmf_ros2/pull/211) -* ws broadcast client in dispatcher node [#212](https://github.com/open-rmf/rmf_ros2/pull/212) -* create unique task_id with timestamp [#223](https://github.com/open-rmf/rmf_ros2/pull/223) -* Changes for humble compatibility: [#215](https://github.com/open-rmf/rmf_ros2/issues/215) - -2.0.0 (2022-03-18) ------------------- -No changes yet - -1.5.0 (2022-02-14) ------------------- -* Support flexible task definitions [#168](https://github.com/open-rmf/rmf_ros2/pull/168) - -1.3.0 (2021-01-13) ------------------- -* Introduce dispatcher node to facilitate dispatching of tasks: [#217](https://github.com/osrf/rmf_core/pull/217) diff --git a/rmf_task_ros2/CHANGELOG.rst b/rmf_task_ros2/CHANGELOG.rst new file mode 100644 index 000000000..3a2b7d622 --- /dev/null +++ b/rmf_task_ros2/CHANGELOG.rst @@ -0,0 +1,45 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package rmf_task_ros2 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +2.1.5 (2023-05-20) +------------------ +* Reformat code to meet expectations of uncrustify-0.72.0: (`#274 `_) +* Contributors: Yadunund + +2.1.4 (2023-04-27) +------------------ + +2.1.3 (2023-04-26) +------------------ +* Link Threads to fix build errors on certain platforms: (`#204 `_) +* Contributors: decada-robotics, Grey + +2.1.2 (2022-10-10) +------------------ +* Add find_package for vendored project. + The vendor package for nlohmann_json_schema_validator was previously + exporting dependency info for that package, however that is not the + recommended workflow for vendor packages which are ideally as + transparent as possible. +* Contributors: Steven! Ragnarök + + +2.1.0 (2022-10-03) +------------------ +* Change default task auction evaluator to `QuickestFinishEvaluator`: (`#211 `_) +* ws broadcast client in dispatcher node (`#212 `_) +* create unique task_id with timestamp (`#223 `_) +* Changes for humble compatibility: (`#215 `_) + +2.0.0 (2022-03-18) +------------------ +No changes yet + +1.5.0 (2022-02-14) +------------------ +* Support flexible task definitions (`#168 `_) + +1.3.0 (2021-01-13) +------------------ +* Introduce dispatcher node to facilitate dispatching of tasks: (`#217 `_) diff --git a/rmf_traffic_ros2/CHANGELOG.md b/rmf_traffic_ros2/CHANGELOG.md deleted file mode 100644 index 089d84192..000000000 --- a/rmf_traffic_ros2/CHANGELOG.md +++ /dev/null @@ -1,72 +0,0 @@ -## Changelog for package rmf_traffic_ros2 - -2.1.5 (2023-05-20) ------------------- -* Reformat code to meet expectations of uncrustify-0.72.0: [#274](https://github.com/open-rmf/rmf_ros2/issues/274) -* Contributors: Yadunund - -2.1.4 (2023-04-27) ------------------- - -2.1.3 (2023-04-26) ------------------- - -2.1.2 (2022-10-10) ------------------- - -2.1.0 (2022-10-03) ------------------- -* Make async behaviors more robust: [#228](https://github.com/open-rmf/rmf_ros2/pull/228) -* Make schedule failover more robust: [#232](https://github.com/open-rmf/rmf_ros2/pull/232) -* Ignore conflicts between any plans that have a dependency: [#205](https://github.com/open-rmf/rmf_ros2/pull/205) -* Add support for docking in lanes with entry events: [#226](https://github.com/open-rmf/rmf_ros2/pull/226) -* Add message conversion functions for the navigation graph: [#207](https://github.com/open-rmf/rmf_ros2/pull/207) -* Changes for humble compatibility: [#215](https://github.com/open-rmf/rmf_ros2/issues/215) - -2.0.0 (2022-03-18) ------------------- -* Update to the traffic dependency system: [#188](https://github.com/open-rmf/rmf_ros2/pull/188) - -1.5.0 (2022-02-14) ------------------- -* Allow participants to sync up with remote databases when discrepancies arise [#145](https://github.com/open-rmf/rmf_ros2/pull/142) -* Support for geojson graphs [#142](https://github.com/open-rmf/rmf_ros2/pull/142) - -1.4.0 (2021-09-01) ------------------- -* Make traffic schedule updates more efficient: [#86](https://github.com/open-rmf/rmf_ros2/pull/86) -* Add redundancy to the traffic schedule node: [#61](https://github.com/open-rmf/rmf_ros2/pull/61) - -1.3.0 (2021-06-07) ------------------- -* Use topics to update schedule mirrors: [#17](https://github.com/open-rmf/rmf_ros2/pull/17) -* Allow participant descriptions to update: [#17](https://github.com/open-rmf/rmf_ros2/pull/17) -* Add persistence to Traffic Schedule Participant IDs: [#242](https://github.com/osrf/rmf_core/pull/242) - -1.2.0 (2021-01-05) ------------------- -* Adding distributed blockade system hooks: [#226](https://github.com/osrf/rmf_core/pull/226) - -1.1.0 (2020-09-24) ------------------- -* Add a schedule node factory to the public API: [#147](https://github.com/osrf/rmf_core/pull/147) -* Allow the Negotiation class to accept callbacks for Table updates: [#140](https://github.com/osrf/rmf_core/pull/140/) -* Allow the Negotiation class to provide views for existing Tables: [#140](https://github.com/osrf/rmf_core/pull/140/) -* Allow the Negotiation class to store up to a certain number of completed negotiations: [#140](https://github.com/osrf/rmf_core/pull/140/) -* Migrating to ROS2 Foxy: [#133](https://github.com/osrf/rmf_core/pull/133) -* Contributors: Aaron Chong, Grey, Yadu, ddengster - -1.0.2 (2020-07-27) ------------------- -* Always respond to negotiations: [#138](https://github.com/osrf/rmf_core/pull/138) - -1.0.0 (2020-06-23) ------------------- -* Provides `rmf_traffic_ros2` library which offers utilities to wrap `rmf_traffic` into `ros2` APIs - * `rmf_traffic_ros2::convert(T)` functions convert between `rmf_traffic` API data structures and `rmf_traffic_msgs` message structures - * `rmf_traffic_ros2::schedule` utilities help to connect `rmf_traffic` objects across distributed ROS2 systems - * `MirrorManager` - Object that maintains a `rmf_traffic::schedule::Mirror` across ROS2 connections - * `Writer` - Factory for `rmf_traffic::schedule::Participant` objects that can talk to a database across ROS2 connections - * `Negotiation` - Object that manages a set of traffic negotiations across ROS2 connections -* `rmf_traffic_schedule` - a ROS2 node that manages a traffic schedule service and judges the outcomes of traffic negotiations -* Contributors: Aaron Chong, Grey, Marco A. Gutiérrez, Morgan Quigley, Yadu, Yadunund, koonpeng diff --git a/rmf_traffic_ros2/CHANGELOG.rst b/rmf_traffic_ros2/CHANGELOG.rst new file mode 100644 index 000000000..dbd82bd8b --- /dev/null +++ b/rmf_traffic_ros2/CHANGELOG.rst @@ -0,0 +1,74 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package rmf_traffic_ros2 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +2.1.5 (2023-05-20) +------------------ +* Reformat code to meet expectations of uncrustify-0.72.0: (`#274 `_) +* Contributors: Yadunund + +2.1.4 (2023-04-27) +------------------ + +2.1.3 (2023-04-26) +------------------ + +2.1.2 (2022-10-10) +------------------ + +2.1.0 (2022-10-03) +------------------ +* Make async behaviors more robust: (`#228 `_) +* Make schedule failover more robust: (`#232 `_) +* Ignore conflicts between any plans that have a dependency: (`#205 `_) +* Add support for docking in lanes with entry events: (`#226 `_) +* Add message conversion functions for the navigation graph: (`#207 `_) +* Changes for humble compatibility: (`#215 `_) + +2.0.0 (2022-03-18) +------------------ +* Update to the traffic dependency system: (`#188 `_) + +1.5.0 (2022-02-14) +------------------ +* Allow participants to sync up with remote databases when discrepancies arise (`#145 `_) +* Support for geojson graphs (`#142 `_) + +1.4.0 (2021-09-01) +------------------ +* Make traffic schedule updates more efficient: (`#86 `_) +* Add redundancy to the traffic schedule node: (`#61 `_) + +1.3.0 (2021-06-07) +------------------ +* Use topics to update schedule mirrors: (`#17 `_) +* Allow participant descriptions to update: (`#17 `_) +* Add persistence to Traffic Schedule Participant IDs: (`#242 `_) + +1.2.0 (2021-01-05) +------------------ +* Adding distributed blockade system hooks: (`#22 `_) + +1.1.0 (2020-09-24) +------------------ +* Add a schedule node factory to the public API: (`#147 `_) +* Allow the Negotiation class to accept callbacks for Table updates: (`#140 `_) +* Allow the Negotiation class to provide views for existing Tables: (`#140 `_) +* Allow the Negotiation class to store up to a certain number of completed negotiations: (`#140 `_) +* Migrating to ROS2 Foxy: (`#133 `_) +* Contributors: Aaron Chong, Grey, Yadu, ddengster + +1.0.2 (2020-07-27) +------------------ +* Always respond to negotiations: (`#138 `_) + +1.0.0 (2020-06-23) +------------------ +* Provides `rmf_traffic_ros2` library which offers utilities to wrap `rmf_traffic` into `ros2` APIs + * `rmf_traffic_ros2::convert(T)` functions convert between `rmf_traffic` API data structures and `rmf_traffic_msgs` message structures + * `rmf_traffic_ros2::schedule` utilities help to connect `rmf_traffic` objects across distributed ROS2 systems + * `MirrorManager` - Object that maintains a `rmf_traffic::schedule::Mirror` across ROS2 connections + * `Writer` - Factory for `rmf_traffic::schedule::Participant` objects that can talk to a database across ROS2 connections + * `Negotiation` - Object that manages a set of traffic negotiations across ROS2 connections +* `rmf_traffic_schedule` - a ROS2 node that manages a traffic schedule service and judges the outcomes of traffic negotiations +* Contributors: Aaron Chong, Grey, Marco A. Gutiérrez, Morgan Quigley, Yadu, Yadunund, koonpeng diff --git a/rmf_websocket/CHANGELOG.md b/rmf_websocket/CHANGELOG.rst similarity index 82% rename from rmf_websocket/CHANGELOG.md rename to rmf_websocket/CHANGELOG.rst index 050cbb038..c0a28e130 100644 --- a/rmf_websocket/CHANGELOG.md +++ b/rmf_websocket/CHANGELOG.rst @@ -1,4 +1,6 @@ -## Changelog for package rmf_websocket +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package rmf_websocket +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2.1.5 (2023-05-20) ------------------ From 9a38ff6b78f97487082326a3e3afb679777390a8 Mon Sep 17 00:00:00 2001 From: Grey Date: Tue, 23 May 2023 12:14:46 +0100 Subject: [PATCH 10/20] Put the action finished callback in a schedule instead of triggering immediately (#273) * Put the action finished callback in a schedule instead of triggering immediately Signed-off-by: Michael X. Grey * Style Signed-off-by: Yadunund * Update CHANGELOG Signed-off-by: Michael X. Grey * Move changelog entry into forthcoming Signed-off-by: Yadunund --------- Signed-off-by: Michael X. Grey Signed-off-by: Yadunund Co-authored-by: Yadunund --- rmf_fleet_adapter/CHANGELOG.rst | 9 +++++++-- .../rmf_fleet_adapter/agv/RobotUpdateHandle.cpp | 17 ++++++++++++----- .../agv/internal_RobotUpdateHandle.hpp | 3 +++ .../rmf_fleet_adapter/events/PerformAction.cpp | 2 +- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/rmf_fleet_adapter/CHANGELOG.rst b/rmf_fleet_adapter/CHANGELOG.rst index 8b27ba611..286f6e400 100644 --- a/rmf_fleet_adapter/CHANGELOG.rst +++ b/rmf_fleet_adapter/CHANGELOG.rst @@ -2,9 +2,14 @@ Changelog for package rmf_fleet_adapter ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Fix race condition related to the ``finished`` callback of ``perform_action`` events: (`#273 `_) +* Contributors: Grey + 2.1.5 (2023-05-20) ------------------ -* Reformat code to meet expectations of uncrustify-0.72.0: (`#274 `_) +* Reformat code to meet expectations of uncrustify-0.72.0: (`#274 `_) * Contributors: Yadunund 2.1.4 (2023-04-27) @@ -14,7 +19,7 @@ Changelog for package rmf_fleet_adapter ------------------ * Fix emergency response for waiting robots: (`#253 `_) * Properly cleanup emergency pullover task: (`#258 `_) -* Fix priority assignment when parsing tasks: (`#265 `_) +* Fix priority assignment when parsing tasks: (`#265 `_) * Link Threads to fix build errors on certain platforms: (`#204 `_) * Contributors: decada-robotics, Luca Della Vedova, Grey, Yadunund diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/RobotUpdateHandle.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/RobotUpdateHandle.cpp index ebea16013..4ad01f33c 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/RobotUpdateHandle.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/RobotUpdateHandle.cpp @@ -859,11 +859,18 @@ void RobotUpdateHandle::ActionExecution::blocked( //============================================================================== void RobotUpdateHandle::ActionExecution::finished() { - if (!_pimpl->data->finished) - return; - - _pimpl->data->finished(); - _pimpl->data->finished = nullptr; + if (_pimpl->data) + { + _pimpl->data->worker.schedule( + [data = _pimpl->data](const rxcpp::schedulers::schedulable&) + { + if (data->finished) + { + data->finished(); + data->finished = nullptr; + } + }); + } } //============================================================================== diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/internal_RobotUpdateHandle.hpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/internal_RobotUpdateHandle.hpp index dedcff43a..557de5cdd 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/internal_RobotUpdateHandle.hpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/internal_RobotUpdateHandle.hpp @@ -37,6 +37,7 @@ class RobotUpdateHandle::ActionExecution::Implementation struct Data { + rxcpp::schedulers::worker worker; std::function finished; std::shared_ptr state; std::optional remaining_time; @@ -44,10 +45,12 @@ class RobotUpdateHandle::ActionExecution::Implementation // TODO: Consider adding a mutex to lock read/write Data( + rxcpp::schedulers::worker worker_, std::function finished_, std::shared_ptr state_, std::optional remaining_time_ = std::nullopt) { + worker = std::move(worker_); finished = std::move(finished_); state = std::move(state_); remaining_time = remaining_time_; diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/events/PerformAction.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/events/PerformAction.cpp index a52ea216c..c7c1fc0f3 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/events/PerformAction.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/events/PerformAction.cpp @@ -260,7 +260,7 @@ void PerformAction::Active::_execute_action() }; auto data = std::make_shared( - std::move(finished), _state, std::nullopt); + _context->worker(), std::move(finished), _state, std::nullopt); _execution_data = data; auto action_execution = From 5bb4b9e85e23d2835e23d04078ed8c8f0510cfa3 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Thu, 1 Jun 2023 09:08:17 +0000 Subject: [PATCH 11/20] Revert changes to constructing finish request factories Signed-off-by: Aaron Chong --- rmf_fleet_adapter/src/full_control/main.cpp | 7 ++----- rmf_fleet_adapter_python/src/adapter.cpp | 17 ++++------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/rmf_fleet_adapter/src/full_control/main.cpp b/rmf_fleet_adapter/src/full_control/main.cpp index 0d9aedd51..295dd456e 100644 --- a/rmf_fleet_adapter/src/full_control/main.cpp +++ b/rmf_fleet_adapter/src/full_control/main.cpp @@ -1237,8 +1237,7 @@ std::shared_ptr make_fleet( if (finishing_request_string == "charge") { finishing_request = - std::make_shared( - std::string(node->get_name())); + std::make_shared(); RCLCPP_INFO( node->get_logger(), "Fleet is configured to perform ChargeBattery as finishing request"); @@ -1246,9 +1245,7 @@ std::shared_ptr make_fleet( else if (finishing_request_string == "park") { finishing_request = - std::make_shared( - std::nullopt, - std::string(node->get_name())); + std::make_shared(); RCLCPP_INFO( node->get_logger(), "Fleet is configured to perform ParkRobot as finishing request"); diff --git a/rmf_fleet_adapter_python/src/adapter.cpp b/rmf_fleet_adapter_python/src/adapter.cpp index f9e0ae207..ea9aa954e 100644 --- a/rmf_fleet_adapter_python/src/adapter.cpp +++ b/rmf_fleet_adapter_python/src/adapter.cpp @@ -331,27 +331,19 @@ PYBIND11_MODULE(rmf_adapter, m) { double recharge_threshold, double recharge_soc, bool account_for_battery_drain, - const std::string& finishing_request_string = "nothing", - const std::string& finishing_request_requester = std::string()) + const std::string& finishing_request_string = "nothing") { // Supported finishing_request_string: [charge, park, nothing] rmf_task::ConstRequestFactoryPtr finishing_request; - std::optional requester = std::nullopt; - if (finishing_request_requester != std::string()) - { - requester = finishing_request_requester; - } if (finishing_request_string == "charge") { finishing_request = - std::make_shared(requester); + std::make_shared(); } else if (finishing_request_string == "park") { finishing_request = - std::make_shared( - std::nullopt, - requester); + std::make_shared(); } else { @@ -375,8 +367,7 @@ PYBIND11_MODULE(rmf_adapter, m) { py::arg("recharge_threshold"), py::arg("recharge_soc"), py::arg("account_for_battery_drain"), - py::arg("finishing_request_string") = "nothing", - py::arg("finishing_request_requester") = "") + py::arg("finishing_request_string") = "nothing") .def("accept_delivery_requests", &agv::FleetUpdateHandle::accept_delivery_requests, "NOTE: deprecated, use consider_delivery_requests() instead") From 5d36fc6ed159645f1f204c6f264badd6a103c891 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Thu, 1 Jun 2023 09:22:57 +0000 Subject: [PATCH 12/20] Using overloaded TaskPlanner constructor to pass in name of fleet update handle Signed-off-by: Aaron Chong --- .../src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp index 404794a54..2ae2d865a 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp @@ -2066,7 +2066,7 @@ bool FleetUpdateHandle::set_task_planner_params( // automatic retreat. Hence, we also update them whenever the // task planner here is updated. self->_pimpl->task_planner = std::make_shared( - std::move(task_config), std::move(options)); + std::move(task_config), std::move(options), self->_pimpl->name); for (const auto& t : self->_pimpl->task_managers) t.first->task_planner(self->_pimpl->task_planner); From ffd138e3a61928d6590a287507b1d829aad8e4d4 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Mon, 12 Jun 2023 14:56:22 +0000 Subject: [PATCH 13/20] Using overloaded rmf_task make functions Signed-off-by: Aaron Chong --- .../src/rmf_fleet_adapter/TaskManager.cpp | 6 +++--- .../agv/FleetUpdateHandle.cpp | 19 ++++++++++++------- .../events/EmergencyPullover.cpp | 4 ++-- .../events/ResponsiveWait.cpp | 4 ++-- rmf_fleet_adapter_python/src/adapter.cpp | 16 ++++++++++------ 5 files changed, 29 insertions(+), 20 deletions(-) diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp index 67114493a..a9e64d415 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/TaskManager.cpp @@ -1588,10 +1588,10 @@ void TaskManager::retreat_to_charger() // Add a new charging task to the task queue const auto charging_request = rmf_task::requests::ChargeBattery::make( current_state.time().value(), - nullptr, - true, _context->requester_id(), - rmf_traffic_ros2::convert(_context->node()->now())); + rmf_traffic_ros2::convert(_context->node()->now()), + nullptr, + true); const auto model = charging_request->description()->make_model( current_state.time().value(), parameters); diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp index 2ae2d865a..b1c923b53 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp @@ -295,14 +295,19 @@ std::shared_ptr FleetUpdateHandle::Implementation::convert( requester = i_it->get(); } - rmf_task::Task::ConstBookingPtr booking = + rmf_task::Task::ConstBookingPtr booking = requester.has_value() ? std::make_shared( - task_id, - earliest_start_time, - priority, - false, - std::move(requester), - request_time); + task_id, + earliest_start_time, + priority, + requester.value(), + request_time, + false) : + std::make_shared( + task_id, + earliest_start_time, + priority, + false); const auto new_request = std::make_shared( std::move(booking), diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/events/EmergencyPullover.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/events/EmergencyPullover.cpp index 2d51212f9..d64f29ef2 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/events/EmergencyPullover.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/events/EmergencyPullover.cpp @@ -60,9 +60,9 @@ rmf_task::Task::ActivePtr EmergencyPullover::start( task_id, time_now, nullptr, - true, context->requester_id(), - time_now); + time_now, + true); const rmf_task::Request request(std::move(booking), desc); return activator.activate( diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/events/ResponsiveWait.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/events/ResponsiveWait.cpp index 1a37e46c0..079e921ed 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/events/ResponsiveWait.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/events/ResponsiveWait.cpp @@ -77,9 +77,9 @@ rmf_task::Task::ActivePtr ResponsiveWait::start( task_id, time_now, nullptr, - true, context->requester_id(), - time_now); + time_now, + true); const rmf_task::Request request(std::move(booking), desc); return context->task_activator()->activate( diff --git a/rmf_fleet_adapter_python/src/adapter.cpp b/rmf_fleet_adapter_python/src/adapter.cpp index ea9aa954e..7f5db106c 100644 --- a/rmf_fleet_adapter_python/src/adapter.cpp +++ b/rmf_fleet_adapter_python/src/adapter.cpp @@ -331,19 +331,22 @@ PYBIND11_MODULE(rmf_adapter, m) { double recharge_threshold, double recharge_soc, bool account_for_battery_drain, - const std::string& finishing_request_string = "nothing") + const std::string& finishing_request_string = "nothing", + const std::string& requester = std::string()) { // Supported finishing_request_string: [charge, park, nothing] rmf_task::ConstRequestFactoryPtr finishing_request; if (finishing_request_string == "charge") { - finishing_request = - std::make_shared(); + finishing_request = requester == std::string() ? + std::make_shared() : + std::make_shared(requester); } else if (finishing_request_string == "park") { - finishing_request = - std::make_shared(); + finishing_request = requester == std::string() ? + std::make_shared() : + std::make_shared(requester); } else { @@ -367,7 +370,8 @@ PYBIND11_MODULE(rmf_adapter, m) { py::arg("recharge_threshold"), py::arg("recharge_soc"), py::arg("account_for_battery_drain"), - py::arg("finishing_request_string") = "nothing") + py::arg("finishing_request_string") = "nothing", + py::arg("requester") = "") .def("accept_delivery_requests", &agv::FleetUpdateHandle::accept_delivery_requests, "NOTE: deprecated, use consider_delivery_requests() instead") From 15b5211c49cbfce6cf7e36b4ddd622485e88e0c6 Mon Sep 17 00:00:00 2001 From: Yadunund Date: Tue, 6 Jun 2023 18:56:09 +0800 Subject: [PATCH 14/20] Update changelogs Signed-off-by: Yadunund --- rmf_fleet_adapter/CHANGELOG.rst | 81 +++++++++++++------------- rmf_fleet_adapter_python/CHANGELOG.rst | 55 +++++++++-------- rmf_task_ros2/CHANGELOG.rst | 21 ++++--- rmf_traffic_ros2/CHANGELOG.rst | 39 +++++++------ rmf_websocket/CHANGELOG.rst | 5 ++ 5 files changed, 111 insertions(+), 90 deletions(-) diff --git a/rmf_fleet_adapter/CHANGELOG.rst b/rmf_fleet_adapter/CHANGELOG.rst index 286f6e400..3005e5138 100644 --- a/rmf_fleet_adapter/CHANGELOG.rst +++ b/rmf_fleet_adapter/CHANGELOG.rst @@ -5,11 +5,12 @@ Changelog for package rmf_fleet_adapter Forthcoming ----------- * Fix race condition related to the ``finished`` callback of ``perform_action`` events: (`#273 `_) -* Contributors: Grey +* Switch to rst changelogs (`#276 `_) +* Contributors: Grey, Yadunund 2.1.5 (2023-05-20) ------------------ -* Reformat code to meet expectations of uncrustify-0.72.0: (`#274 `_) +* Reformat code to meet expectations of uncrustify-0.72.0: (`#274 `_) * Contributors: Yadunund 2.1.4 (2023-04-27) @@ -17,10 +18,10 @@ Forthcoming 2.1.3 (2023-04-26) ------------------ -* Fix emergency response for waiting robots: (`#253 `_) -* Properly cleanup emergency pullover task: (`#258 `_) -* Fix priority assignment when parsing tasks: (`#265 `_) -* Link Threads to fix build errors on certain platforms: (`#204 `_) +* Fix emergency response for waiting robots: (`#253 `_) +* Properly cleanup emergency pullover task: (`#258 `_) +* Fix priority assignment when parsing tasks: (`#265 `_) +* Link Threads to fix build errors on certain platforms: (`#204 `_) * Contributors: decada-robotics, Luca Della Vedova, Grey, Yadunund 2.1.2 (2022-10-10) @@ -28,70 +29,70 @@ Forthcoming 2.1.0 (2022-10-03) ------------------ -* Add API to update speed limits for lanes: (`#217 `_) -* Make async behaviors more robust: (`#228 `_) -* Allow fleet adapters to change schedule participant profiles: (`#229 `_) -* Allow robots to be decommissioned from the task dispatch system: (`#233 `_) -* Allow manual toggling of stubborn negotiation: (`#196 `_) -* Allow users to specify a custom update listener: (`#198 `_) -* Introduce `WaitUntil` activity and use it in the `ResponsiveWait`: (`#199 `_) -* Better support for patrol behaviors: (`#205 `_) -* Allow `ResponsiveWait` to be enabled and disabled: (`#209 `_) -* Publish the navigation graph of the fleet adapter: (`#207 `_) -* Allow robot status to be overridden by the user: (`#191 `_) -* Add API to report status for `perform_action`: (`#190 `_) -* Add APIs for cancelling and killing tasks from the `RobotUpdateHandle`: (`#205 `_) -* Add a WaitUntil event and use it for ResponsiveWait: (`#199 `_) +* Add API to update speed limits for lanes: (`#217 `_) +* Make async behaviors more robust: (`#228 `_) +* Allow fleet adapters to change schedule participant profiles: (`#229 `_) +* Allow robots to be decommissioned from the task dispatch system: (`#233 `_) +* Allow manual toggling of stubborn negotiation: (`#196 `_) +* Allow users to specify a custom update listener: (`#198 `_) +* Introduce `WaitUntil` activity and use it in the `ResponsiveWait`: (`#199 `_) +* Better support for patrol behaviors: (`#205 `_) +* Allow `ResponsiveWait` to be enabled and disabled: (`#209 `_) +* Publish the navigation graph of the fleet adapter: (`#207 `_) +* Allow robot status to be overridden by the user: (`#191 `_) +* Add API to report status for `perform_action`: (`#190 `_) +* Add APIs for cancelling and killing tasks from the `RobotUpdateHandle`: (`#205 `_) +* Add a WaitUntil event and use it for ResponsiveWait: (`#199 `_) 2.0.0 (2022-03-18) ------------------ -* Update to traffic dependency system: (`#188 `_) +* Update to traffic dependency system: (`#188 `_) 1.5.0 (2022-02-14) ------------------ -* Support flexible task definitions (`#168 `_) -* Add lane speed limit to graph parsing function (`#124 `_) -* Support for geojson graphs (`#142 `_) +* Support flexible task definitions (`#168 `_) +* Add lane speed limit to graph parsing function (`#124 `_) +* Support for geojson graphs (`#142 `_) 1.4.0 (2021-09-01) ------------------ -* Add read_only_blockade adapter: (`#110 `_) -* Accommodate finishing tasks: (`#108 `_) -* Check if lane request's fleet_name is equal to the fleet's fleet_name: (`#95 `_) -* Find nearest waypoint among starts: (`#98 `_) +* Add read_only_blockade adapter: (`#110 `_) +* Accommodate finishing tasks: (`#108 `_) +* Check if lane request's fleet_name is equal to the fleet's fleet_name: (`#95 `_) +* Find nearest waypoint among starts: (`#98 `_) 1.3.0 (2021-06-07) ------------------ -* Add API for opening and closing lanes: (`#15 `_) +* Add API for opening and closing lanes: (`#15 `_) * Added `open_lanes` and `close_lanes` CLI tools for issuing requests -* Allow Traffic Light APIs to update the location of a robot while it is idle: (`#270 `_) -* Allow TrafficLight and EasyTrafficLight API to update battery level: (`#263 `_) +* Allow Traffic Light APIs to update the location of a robot while it is idle: (`#270 `_) +* Allow TrafficLight and EasyTrafficLight API to update battery level: (`#263 `_) * Migrating to a task dispatcher framework: (`#21 `_) * The `rmf_fleet_adapter::agv` component interacts with a dispatcher node over topics with `rmf_task` prefix as specified in `rmf_fleet_adapter/StandardNames.hpp` * Support for executing tasks at specified timepoints * Support for `Loop`, `Delivery`, `Clean` and `ChargeBattery` tasks -* Introduce ResponsiveWait: (`#308 `_) +* Introduce ResponsiveWait: (`#308 `_) * The new ResponsiveWait task phase can be used to have idle/waiting robots respond to schedule conflicts * Idle robots (robots that do not have an assigned task) will automatically enter ResponsiveWait mode 1.2.0 (2021-01-05) ------------------ -* Automatically publish fleet states from the fleet adapter API: (`#232 `_) -* Easy Traffic Light API: (`#226 `_) -* Gridlock-proof Traffic Light Implementation: (`#226 `_) +* Automatically publish fleet states from the fleet adapter API: (`#232 `_) +* Easy Traffic Light API: (`#226 `_) +* Gridlock-proof Traffic Light Implementation: (`#226 `_) 1.1.0 (2020-09-24) ------------------ -* Traffic Light API: (`#147 `_) -* Allow fleet adapters to adjust the maximum delay: (`#148 `_) -* Full Control Fleet Adapters respond to emergency alarm topic: (`#162 `_) -* Migrating to ROS2 Foxy: (`#133 `_) +* Traffic Light API: (`#147 `_) (`#176 `_) (`#180 `_) +* Allow fleet adapters to adjust the maximum delay: (`#148 `_) +* Full Control Fleet Adapters respond to emergency alarm topic: (`#162 `_) +* Migrating to ROS2 Foxy: (`#133 `_) * Contributors: Chen Bainian, Grey, Kevin_Skywalker, Marco A. Gutiérrez, Rushyendra Maganty, Yadu 1.0.2 (2020-07-27) ------------------ -* Always respond to negotiations: (`#138 `_) +* Always respond to negotiations: (`#138 `_) 1.0.1 (2020-07-20) ------------------ diff --git a/rmf_fleet_adapter_python/CHANGELOG.rst b/rmf_fleet_adapter_python/CHANGELOG.rst index ba16afbec..50b4c5d61 100644 --- a/rmf_fleet_adapter_python/CHANGELOG.rst +++ b/rmf_fleet_adapter_python/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog for package rmf_fleet_adapter_python ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Switch to rst changelogs (`#276 `_) +* Contributors: Yadunund + 2.1.5 (2023-05-20) ------------------ @@ -16,16 +21,16 @@ Changelog for package rmf_fleet_adapter_python 2.1.0 (2022-10-03) ------------------ -* Make async behaviors more robust: (`#228 `_) -* Allow fleet adapters to change schedule participant profiles: (`#229 `_) -* Allow robots to be decommissioned from the task dispatch system: (`#233 `_) -* Allow manual toggling of stubborn negotiation: (`#196 `_) -* Allow users to specify a custom update listener: (`#198 `_) -* Fix various segfaults related to pybind: (`#205 `_) -* Allow `ResponsiveWait` to be enabled and disabled: (`#209 `_) -* Allow robot status to be overridden by the user: (`#191 `_) -* Add API to report status for `perform_action`: (`#190 `_) -* Changes for humble compatibility: (`#215 `_) +* Make async behaviors more robust: (`#228 `_) +* Allow fleet adapters to change schedule participant profiles: (`#229 `_) +* Allow robots to be decommissioned from the task dispatch system: (`#233 `_) +* Allow manual toggling of stubborn negotiation: (`#196 `_) +* Allow users to specify a custom update listener: (`#198 `_) +* Fix various segfaults related to pybind: (`#205 `_) +* Allow `ResponsiveWait` to be enabled and disabled: (`#209 `_) +* Allow robot status to be overridden by the user: (`#191 `_) +* Add API to report status for `perform_action`: (`#190 `_) +* Changes for humble compatibility: (`#215 `_) 2.0.0 (2022-03-18) ------------------ @@ -33,23 +38,23 @@ No changes yet 1.5.0 (2022-02-14) ------------------ -* Support flexible task definitions (`#168 `_) -* Add lane speed limit to graph parsing function (`#124 `_) +* Support flexible task definitions (`#168 `_) +* Add lane speed limit to graph parsing function (`#124 `_) 1.3.0 (2021-06-07) ------------------ -* Modifications to support refactor of rmf_task (`#51 `_) -* Fix symlink-install compilation (`#32 `_) -* Updated package.xml (`#26 `_) -* Fix/rmf task ros2 cleanup (`#21 `_) -* Feature/python binding planner (`#11 `_) -* Adding reference_internal tag to function bindings that return raw pointers (`#6 `_) -* Feature/add unstable participant api (`#11 `_) -* Feature/add simple docs (`#9 `_) -* Support apis for task dispatcher (`#10 `_) -* differentiate functions to prevent overloading (`#8 `_) -* support ez traffic light (`#7 `_) -* Update/release 1.1 (`#6 `_) +* Modifications to support refactor of rmf_task (`#51 `_) +* Fix symlink-install compilation (`#32 `_) +* Updated package.xml (`#26 `_) +* Fix/rmf task ros2 cleanup (`#21 `_) +* Feature/python binding planner (`#11 `_) +* Adding reference_internal tag to function bindings that return raw pointers (`#6 `_) +* Feature/add unstable participant api (`#11 `_) +* Feature/add simple docs (`#9 `_) +* Support apis for task dispatcher (`#10 `_) +* differentiate functions to prevent overloading (`#8 `_) +* support ez traffic light (`#7 `_) +* Update/release 1.1 (`#6 `_) * Implement binding for Duration optional * Make integration test even stricter * Add reference capture for posterity @@ -59,5 +64,5 @@ No changes yet * Bind optional constructors and delivery msg interfaces * Bind compute_plan_starts * Add update_position overload -* Implement Python Bindings for rmf_fleet_adapter (`#1 `_) +* Implement Python Bindings for rmf_fleet_adapter (`#1 `_) * Contributors: Aaron Chong, Charayaphan Nakorn Boon Han, Geoffrey Biggs, Grey, Marco A. Gutiérrez, Yadu, methylDragon, youliang diff --git a/rmf_task_ros2/CHANGELOG.rst b/rmf_task_ros2/CHANGELOG.rst index 3a2b7d622..24b3bceb0 100644 --- a/rmf_task_ros2/CHANGELOG.rst +++ b/rmf_task_ros2/CHANGELOG.rst @@ -2,9 +2,14 @@ Changelog for package rmf_task_ros2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Switch to rst changelogs (`#276 `_) +* Contributors: Yadunund + 2.1.5 (2023-05-20) ------------------ -* Reformat code to meet expectations of uncrustify-0.72.0: (`#274 `_) +* Reformat code to meet expectations of uncrustify-0.72.0: (`#274 `_) * Contributors: Yadunund 2.1.4 (2023-04-27) @@ -12,7 +17,7 @@ Changelog for package rmf_task_ros2 2.1.3 (2023-04-26) ------------------ -* Link Threads to fix build errors on certain platforms: (`#204 `_) +* Link Threads to fix build errors on certain platforms: (`#204 `_) * Contributors: decada-robotics, Grey 2.1.2 (2022-10-10) @@ -27,10 +32,10 @@ Changelog for package rmf_task_ros2 2.1.0 (2022-10-03) ------------------ -* Change default task auction evaluator to `QuickestFinishEvaluator`: (`#211 `_) -* ws broadcast client in dispatcher node (`#212 `_) -* create unique task_id with timestamp (`#223 `_) -* Changes for humble compatibility: (`#215 `_) +* Change default task auction evaluator to `QuickestFinishEvaluator`: (`#211 `_) +* ws broadcast client in dispatcher node (`#212 `_) +* create unique task_id with timestamp (`#223 `_) +* Changes for humble compatibility: (`#215 `_) 2.0.0 (2022-03-18) ------------------ @@ -38,8 +43,8 @@ No changes yet 1.5.0 (2022-02-14) ------------------ -* Support flexible task definitions (`#168 `_) +* Support flexible task definitions (`#168 `_) 1.3.0 (2021-01-13) ------------------ -* Introduce dispatcher node to facilitate dispatching of tasks: (`#217 `_) +* Introduce dispatcher node to facilitate dispatching of tasks: (`#217 `_) diff --git a/rmf_traffic_ros2/CHANGELOG.rst b/rmf_traffic_ros2/CHANGELOG.rst index dbd82bd8b..483a60b61 100644 --- a/rmf_traffic_ros2/CHANGELOG.rst +++ b/rmf_traffic_ros2/CHANGELOG.rst @@ -2,9 +2,14 @@ Changelog for package rmf_traffic_ros2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Switch to rst changelogs (`#276 `_) +* Contributors: Yadunund + 2.1.5 (2023-05-20) ------------------ -* Reformat code to meet expectations of uncrustify-0.72.0: (`#274 `_) +* Reformat code to meet expectations of uncrustify-0.72.0: (`#274 `_) * Contributors: Yadunund 2.1.4 (2023-04-27) @@ -18,32 +23,32 @@ Changelog for package rmf_traffic_ros2 2.1.0 (2022-10-03) ------------------ -* Make async behaviors more robust: (`#228 `_) -* Make schedule failover more robust: (`#232 `_) -* Ignore conflicts between any plans that have a dependency: (`#205 `_) -* Add support for docking in lanes with entry events: (`#226 `_) -* Add message conversion functions for the navigation graph: (`#207 `_) -* Changes for humble compatibility: (`#215 `_) +* Make async behaviors more robust: (`#228 `_) +* Make schedule failover more robust: (`#232 `_) +* Ignore conflicts between any plans that have a dependency: (`#205 `_) +* Add support for docking in lanes with entry events: (`#226 `_) +* Add message conversion functions for the navigation graph: (`#207 `_) +* Changes for humble compatibility: (`#215 `_) 2.0.0 (2022-03-18) ------------------ -* Update to the traffic dependency system: (`#188 `_) +* Update to the traffic dependency system: (`#188 `_) 1.5.0 (2022-02-14) ------------------ -* Allow participants to sync up with remote databases when discrepancies arise (`#145 `_) -* Support for geojson graphs (`#142 `_) +* Allow participants to sync up with remote databases when discrepancies arise (`#145 `_) +* Support for geojson graphs (`#142 `_) 1.4.0 (2021-09-01) ------------------ -* Make traffic schedule updates more efficient: (`#86 `_) -* Add redundancy to the traffic schedule node: (`#61 `_) +* Make traffic schedule updates more efficient: (`#86 `_) +* Add redundancy to the traffic schedule node: (`#61 `_) 1.3.0 (2021-06-07) ------------------ -* Use topics to update schedule mirrors: (`#17 `_) -* Allow participant descriptions to update: (`#17 `_) -* Add persistence to Traffic Schedule Participant IDs: (`#242 `_) +* Use topics to update schedule mirrors: (`#17 `_) +* Allow participant descriptions to update: (`#17 `_) +* Add persistence to Traffic Schedule Participant IDs: (`#242 `_) 1.2.0 (2021-01-05) ------------------ @@ -51,7 +56,7 @@ Changelog for package rmf_traffic_ros2 1.1.0 (2020-09-24) ------------------ -* Add a schedule node factory to the public API: (`#147 `_) +* Add a schedule node factory to the public API: (`#147 `_) * Allow the Negotiation class to accept callbacks for Table updates: (`#140 `_) * Allow the Negotiation class to provide views for existing Tables: (`#140 `_) * Allow the Negotiation class to store up to a certain number of completed negotiations: (`#140 `_) @@ -60,7 +65,7 @@ Changelog for package rmf_traffic_ros2 1.0.2 (2020-07-27) ------------------ -* Always respond to negotiations: (`#138 `_) +* Always respond to negotiations: (`#138 `_) 1.0.0 (2020-06-23) ------------------ diff --git a/rmf_websocket/CHANGELOG.rst b/rmf_websocket/CHANGELOG.rst index c0a28e130..024d860fe 100644 --- a/rmf_websocket/CHANGELOG.rst +++ b/rmf_websocket/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog for package rmf_websocket ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Switch to rst changelogs (`#276 `_) +* Contributors: Yadunund + 2.1.5 (2023-05-20) ------------------ From dd53deb5db8ae21da3e69a49909172bc0259a9da Mon Sep 17 00:00:00 2001 From: Yadunund Date: Tue, 6 Jun 2023 18:58:19 +0800 Subject: [PATCH 15/20] 2.2.0 --- rmf_fleet_adapter/CHANGELOG.rst | 4 ++-- rmf_fleet_adapter/package.xml | 2 +- rmf_fleet_adapter_python/CHANGELOG.rst | 4 ++-- rmf_fleet_adapter_python/package.xml | 2 +- rmf_task_ros2/CHANGELOG.rst | 4 ++-- rmf_task_ros2/package.xml | 2 +- rmf_traffic_ros2/CHANGELOG.rst | 4 ++-- rmf_traffic_ros2/package.xml | 2 +- rmf_websocket/CHANGELOG.rst | 4 ++-- rmf_websocket/package.xml | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/rmf_fleet_adapter/CHANGELOG.rst b/rmf_fleet_adapter/CHANGELOG.rst index 3005e5138..e197dc81b 100644 --- a/rmf_fleet_adapter/CHANGELOG.rst +++ b/rmf_fleet_adapter/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package rmf_fleet_adapter ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +2.2.0 (2023-06-06) +------------------ * Fix race condition related to the ``finished`` callback of ``perform_action`` events: (`#273 `_) * Switch to rst changelogs (`#276 `_) * Contributors: Grey, Yadunund diff --git a/rmf_fleet_adapter/package.xml b/rmf_fleet_adapter/package.xml index 37b0e5867..36efd5600 100644 --- a/rmf_fleet_adapter/package.xml +++ b/rmf_fleet_adapter/package.xml @@ -2,7 +2,7 @@ rmf_fleet_adapter - 2.1.5 + 2.2.0 Fleet Adapter package for RMF fleets. Grey Aaron diff --git a/rmf_fleet_adapter_python/CHANGELOG.rst b/rmf_fleet_adapter_python/CHANGELOG.rst index 50b4c5d61..29bb5ba40 100644 --- a/rmf_fleet_adapter_python/CHANGELOG.rst +++ b/rmf_fleet_adapter_python/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package rmf_fleet_adapter_python ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +2.2.0 (2023-06-06) +------------------ * Switch to rst changelogs (`#276 `_) * Contributors: Yadunund diff --git a/rmf_fleet_adapter_python/package.xml b/rmf_fleet_adapter_python/package.xml index 176c953cc..1ecd5176d 100644 --- a/rmf_fleet_adapter_python/package.xml +++ b/rmf_fleet_adapter_python/package.xml @@ -2,7 +2,7 @@ rmf_fleet_adapter_python - 2.1.5 + 2.2.0 Python bindings for the rmf_fleet_adapter methylDragon Marco A. Gutiérrez diff --git a/rmf_task_ros2/CHANGELOG.rst b/rmf_task_ros2/CHANGELOG.rst index 24b3bceb0..413aeb79c 100644 --- a/rmf_task_ros2/CHANGELOG.rst +++ b/rmf_task_ros2/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package rmf_task_ros2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +2.2.0 (2023-06-06) +------------------ * Switch to rst changelogs (`#276 `_) * Contributors: Yadunund diff --git a/rmf_task_ros2/package.xml b/rmf_task_ros2/package.xml index 9e71f824d..ed77dfe1b 100644 --- a/rmf_task_ros2/package.xml +++ b/rmf_task_ros2/package.xml @@ -2,7 +2,7 @@ rmf_task_ros2 - 2.1.5 + 2.2.0 A package managing the dispatching of tasks in RMF system. Yadunund Marco A. Gutiérrez diff --git a/rmf_traffic_ros2/CHANGELOG.rst b/rmf_traffic_ros2/CHANGELOG.rst index 483a60b61..b9959ffe6 100644 --- a/rmf_traffic_ros2/CHANGELOG.rst +++ b/rmf_traffic_ros2/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package rmf_traffic_ros2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +2.2.0 (2023-06-06) +------------------ * Switch to rst changelogs (`#276 `_) * Contributors: Yadunund diff --git a/rmf_traffic_ros2/package.xml b/rmf_traffic_ros2/package.xml index d0591a92b..665f9da03 100644 --- a/rmf_traffic_ros2/package.xml +++ b/rmf_traffic_ros2/package.xml @@ -2,7 +2,7 @@ rmf_traffic_ros2 - 2.1.5 + 2.2.0 A package containing messages used by the RMF traffic management system. Grey Marco A. Gutiérrez diff --git a/rmf_websocket/CHANGELOG.rst b/rmf_websocket/CHANGELOG.rst index 024d860fe..31fb520e6 100644 --- a/rmf_websocket/CHANGELOG.rst +++ b/rmf_websocket/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package rmf_websocket ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +2.2.0 (2023-06-06) +------------------ * Switch to rst changelogs (`#276 `_) * Contributors: Yadunund diff --git a/rmf_websocket/package.xml b/rmf_websocket/package.xml index 9654e84a8..3aa714f94 100644 --- a/rmf_websocket/package.xml +++ b/rmf_websocket/package.xml @@ -2,7 +2,7 @@ rmf_websocket - 2.1.5 + 2.2.0 A package managing the websocket api endpoints in RMF system. Yadunund Marco A. Gutiérrez From 3087b99c9bb5e25b3f70aafa4f6ffbe95dd25d60 Mon Sep 17 00:00:00 2001 From: Yadu Date: Wed, 7 Jun 2023 23:53:23 -0700 Subject: [PATCH 16/20] Bump 2.3.0 (#282) Signed-off-by: Yadunund --- rmf_fleet_adapter/CHANGELOG.rst | 3 +++ rmf_fleet_adapter/package.xml | 2 +- rmf_fleet_adapter_python/CHANGELOG.rst | 3 +++ rmf_fleet_adapter_python/package.xml | 2 +- rmf_task_ros2/CHANGELOG.rst | 3 +++ rmf_task_ros2/package.xml | 2 +- rmf_traffic_ros2/CHANGELOG.rst | 3 +++ rmf_traffic_ros2/package.xml | 2 +- rmf_websocket/CHANGELOG.rst | 3 +++ rmf_websocket/package.xml | 2 +- 10 files changed, 20 insertions(+), 5 deletions(-) diff --git a/rmf_fleet_adapter/CHANGELOG.rst b/rmf_fleet_adapter/CHANGELOG.rst index e197dc81b..b36d4a087 100644 --- a/rmf_fleet_adapter/CHANGELOG.rst +++ b/rmf_fleet_adapter/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package rmf_fleet_adapter ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2.3.0 (2023-06-08) +------------------ + 2.2.0 (2023-06-06) ------------------ * Fix race condition related to the ``finished`` callback of ``perform_action`` events: (`#273 `_) diff --git a/rmf_fleet_adapter/package.xml b/rmf_fleet_adapter/package.xml index 36efd5600..4208ea4cd 100644 --- a/rmf_fleet_adapter/package.xml +++ b/rmf_fleet_adapter/package.xml @@ -2,7 +2,7 @@ rmf_fleet_adapter - 2.2.0 + 2.3.0 Fleet Adapter package for RMF fleets. Grey Aaron diff --git a/rmf_fleet_adapter_python/CHANGELOG.rst b/rmf_fleet_adapter_python/CHANGELOG.rst index 29bb5ba40..c542bfb53 100644 --- a/rmf_fleet_adapter_python/CHANGELOG.rst +++ b/rmf_fleet_adapter_python/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package rmf_fleet_adapter_python ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2.3.0 (2023-06-08) +------------------ + 2.2.0 (2023-06-06) ------------------ * Switch to rst changelogs (`#276 `_) diff --git a/rmf_fleet_adapter_python/package.xml b/rmf_fleet_adapter_python/package.xml index 1ecd5176d..52da5a4ae 100644 --- a/rmf_fleet_adapter_python/package.xml +++ b/rmf_fleet_adapter_python/package.xml @@ -2,7 +2,7 @@ rmf_fleet_adapter_python - 2.2.0 + 2.3.0 Python bindings for the rmf_fleet_adapter methylDragon Marco A. Gutiérrez diff --git a/rmf_task_ros2/CHANGELOG.rst b/rmf_task_ros2/CHANGELOG.rst index 413aeb79c..c17aee4ca 100644 --- a/rmf_task_ros2/CHANGELOG.rst +++ b/rmf_task_ros2/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package rmf_task_ros2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2.3.0 (2023-06-08) +------------------ + 2.2.0 (2023-06-06) ------------------ * Switch to rst changelogs (`#276 `_) diff --git a/rmf_task_ros2/package.xml b/rmf_task_ros2/package.xml index ed77dfe1b..03fc3e167 100644 --- a/rmf_task_ros2/package.xml +++ b/rmf_task_ros2/package.xml @@ -2,7 +2,7 @@ rmf_task_ros2 - 2.2.0 + 2.3.0 A package managing the dispatching of tasks in RMF system. Yadunund Marco A. Gutiérrez diff --git a/rmf_traffic_ros2/CHANGELOG.rst b/rmf_traffic_ros2/CHANGELOG.rst index b9959ffe6..d3ac88dd1 100644 --- a/rmf_traffic_ros2/CHANGELOG.rst +++ b/rmf_traffic_ros2/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package rmf_traffic_ros2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2.3.0 (2023-06-08) +------------------ + 2.2.0 (2023-06-06) ------------------ * Switch to rst changelogs (`#276 `_) diff --git a/rmf_traffic_ros2/package.xml b/rmf_traffic_ros2/package.xml index 665f9da03..c85338c41 100644 --- a/rmf_traffic_ros2/package.xml +++ b/rmf_traffic_ros2/package.xml @@ -2,7 +2,7 @@ rmf_traffic_ros2 - 2.2.0 + 2.3.0 A package containing messages used by the RMF traffic management system. Grey Marco A. Gutiérrez diff --git a/rmf_websocket/CHANGELOG.rst b/rmf_websocket/CHANGELOG.rst index 31fb520e6..c62eca82e 100644 --- a/rmf_websocket/CHANGELOG.rst +++ b/rmf_websocket/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package rmf_websocket ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2.3.0 (2023-06-08) +------------------ + 2.2.0 (2023-06-06) ------------------ * Switch to rst changelogs (`#276 `_) diff --git a/rmf_websocket/package.xml b/rmf_websocket/package.xml index 3aa714f94..c68f25c2f 100644 --- a/rmf_websocket/package.xml +++ b/rmf_websocket/package.xml @@ -2,7 +2,7 @@ rmf_websocket - 2.2.0 + 2.3.0 A package managing the websocket api endpoints in RMF system. Yadunund Marco A. Gutiérrez From 1187646b0dcefe051d5e8bdc0c5ba3ed3e65d160 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Fri, 16 Jun 2023 05:25:07 +0000 Subject: [PATCH 17/20] Use new booking and request API, updated legacy FullControl fleet adapter Signed-off-by: Aaron Chong --- rmf_fleet_adapter/src/full_control/main.cpp | 14 +++++++-- .../agv/FleetUpdateHandle.cpp | 29 +++++++++---------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/rmf_fleet_adapter/src/full_control/main.cpp b/rmf_fleet_adapter/src/full_control/main.cpp index 295dd456e..312240345 100644 --- a/rmf_fleet_adapter/src/full_control/main.cpp +++ b/rmf_fleet_adapter/src/full_control/main.cpp @@ -1234,10 +1234,18 @@ std::shared_ptr make_fleet( const std::string finishing_request_string = node->declare_parameter("finishing_request", "nothing"); rmf_task::ConstRequestFactoryPtr finishing_request = nullptr; + auto get_time = + []() + { + return std::chrono::steady_clock::now(); + }; + if (finishing_request_string == "charge") { finishing_request = - std::make_shared(); + std::make_shared( + std::string(node->get_name()), + std::move(get_time)); RCLCPP_INFO( node->get_logger(), "Fleet is configured to perform ChargeBattery as finishing request"); @@ -1245,7 +1253,9 @@ std::shared_ptr make_fleet( else if (finishing_request_string == "park") { finishing_request = - std::make_shared(); + std::make_shared( + std::string(node->get_name()), + std::move(get_time)); RCLCPP_INFO( node->get_logger(), "Fleet is configured to perform ParkRobot as finishing request"); diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp index b1c923b53..a9210811b 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp @@ -297,21 +297,20 @@ std::shared_ptr FleetUpdateHandle::Implementation::convert( rmf_task::Task::ConstBookingPtr booking = requester.has_value() ? std::make_shared( - task_id, - earliest_start_time, - priority, - requester.value(), - request_time, - false) : + task_id, + earliest_start_time, + priority, + requester.value(), + request_time, + false) : std::make_shared( - task_id, - earliest_start_time, - priority, - false); - const auto new_request = - std::make_shared( - std::move(booking), - deserialized_task.description); + task_id, + earliest_start_time, + priority, + false); + const auto new_request = std::make_shared( + std::move(booking), + deserialized_task.description); return new_request; } @@ -2071,7 +2070,7 @@ bool FleetUpdateHandle::set_task_planner_params( // automatic retreat. Hence, we also update them whenever the // task planner here is updated. self->_pimpl->task_planner = std::make_shared( - std::move(task_config), std::move(options), self->_pimpl->name); + self->_pimpl->name, std::move(task_config), std::move(options)); for (const auto& t : self->_pimpl->task_managers) t.first->task_planner(self->_pimpl->task_planner); From 64bae7aa9237b0590707d29b269c9758a8cca593 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Fri, 16 Jun 2023 05:39:08 +0000 Subject: [PATCH 18/20] Added node as parameter to pybinded set_task_planner_params, to pass planner_id and time functor to finishing task factory Signed-off-by: Aaron Chong --- rmf_fleet_adapter_python/src/adapter.cpp | 39 ++++++++++++++++-------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/rmf_fleet_adapter_python/src/adapter.cpp b/rmf_fleet_adapter_python/src/adapter.cpp index 7f5db106c..edf345b8c 100644 --- a/rmf_fleet_adapter_python/src/adapter.cpp +++ b/rmf_fleet_adapter_python/src/adapter.cpp @@ -4,6 +4,7 @@ #include #include #include "pybind11_json/pybind11_json.hpp" +#include #include #include "rmf_traffic_ros2/Time.hpp" @@ -332,25 +333,37 @@ PYBIND11_MODULE(rmf_adapter, m) { double recharge_soc, bool account_for_battery_drain, const std::string& finishing_request_string = "nothing", - const std::string& requester = std::string()) + std::shared_ptr node = nullptr) { + std::function time_now = nullptr; + std::optional planner_id = std::nullopt; + if (node) + { + time_now = [n = std::weak_ptr(node)]() + { + const auto node = n.lock(); + if (!node) + { + return std::chrono::steady_clock::now(); + } + return rmf_traffic_ros2::convert(node->now()); + }; + planner_id = node->get_name(); + } + // Supported finishing_request_string: [charge, park, nothing] - rmf_task::ConstRequestFactoryPtr finishing_request; + rmf_task::ConstRequestFactoryPtr finishing_request = nullptr; if (finishing_request_string == "charge") { - finishing_request = requester == std::string() ? - std::make_shared() : - std::make_shared(requester); + finishing_request = planner_id.has_value() && time_now ? + std::make_shared(planner_id.value(), std::move(time_now)) : + std::make_shared(); } else if (finishing_request_string == "park") { - finishing_request = requester == std::string() ? - std::make_shared() : - std::make_shared(requester); - } - else - { - finishing_request = nullptr; + finishing_request = planner_id.has_value() && time_now ? + std::make_shared(planner_id.value(), std::move(time_now)) : + std::make_shared(); } return self.set_task_planner_params( @@ -371,7 +384,7 @@ PYBIND11_MODULE(rmf_adapter, m) { py::arg("recharge_soc"), py::arg("account_for_battery_drain"), py::arg("finishing_request_string") = "nothing", - py::arg("requester") = "") + py::arg("node") = nullptr) .def("accept_delivery_requests", &agv::FleetUpdateHandle::accept_delivery_requests, "NOTE: deprecated, use consider_delivery_requests() instead") From e820b6a2d4ad7817c9984b65a755bab886c9c446 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Mon, 19 Jun 2023 03:24:33 +0000 Subject: [PATCH 19/20] Using system_clock instead of steady_clock Signed-off-by: Aaron Chong --- rmf_fleet_adapter/src/full_control/main.cpp | 13 ++++++++++--- rmf_fleet_adapter_python/src/adapter.cpp | 4 +++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/rmf_fleet_adapter/src/full_control/main.cpp b/rmf_fleet_adapter/src/full_control/main.cpp index 312240345..e979212fd 100644 --- a/rmf_fleet_adapter/src/full_control/main.cpp +++ b/rmf_fleet_adapter/src/full_control/main.cpp @@ -1234,10 +1234,17 @@ std::shared_ptr make_fleet( const std::string finishing_request_string = node->declare_parameter("finishing_request", "nothing"); rmf_task::ConstRequestFactoryPtr finishing_request = nullptr; - auto get_time = - []() + std::function get_time = + [n = std::weak_ptr(node)]() { - return std::chrono::steady_clock::now(); + const auto node = n.lock(); + if (!node) + { + const auto time_since_epoch = + std::chrono::system_clock::now().time_since_epoch(); + return rmf_traffic::Time(time_since_epoch); + } + return rmf_traffic_ros2::convert(node->now()); }; if (finishing_request_string == "charge") diff --git a/rmf_fleet_adapter_python/src/adapter.cpp b/rmf_fleet_adapter_python/src/adapter.cpp index edf345b8c..0a468688e 100644 --- a/rmf_fleet_adapter_python/src/adapter.cpp +++ b/rmf_fleet_adapter_python/src/adapter.cpp @@ -344,7 +344,9 @@ PYBIND11_MODULE(rmf_adapter, m) { const auto node = n.lock(); if (!node) { - return std::chrono::steady_clock::now(); + const auto time_since_epoch = + std::chrono::system_clock::now().time_since_epoch(); + return rmf_traffic::Time(time_since_epoch); } return rmf_traffic_ros2::convert(node->now()); }; From 6956c0e26712c374a5a73ba93d6d8f5efdfee4d7 Mon Sep 17 00:00:00 2001 From: "Michael X. Grey" Date: Mon, 3 Jul 2023 12:26:39 +0800 Subject: [PATCH 20/20] Remove the need to pass a node into the set_task_planner_params python binding Signed-off-by: Michael X. Grey --- .../rmf_fleet_adapter/agv/FleetUpdateHandle.hpp | 9 +++++++++ .../src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp | 12 ++++++++++++ rmf_fleet_adapter_python/src/adapter.cpp | 9 ++++----- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/rmf_fleet_adapter/include/rmf_fleet_adapter/agv/FleetUpdateHandle.hpp b/rmf_fleet_adapter/include/rmf_fleet_adapter/agv/FleetUpdateHandle.hpp index 2863e34d0..b3b0b6942 100644 --- a/rmf_fleet_adapter/include/rmf_fleet_adapter/agv/FleetUpdateHandle.hpp +++ b/rmf_fleet_adapter/include/rmf_fleet_adapter/agv/FleetUpdateHandle.hpp @@ -35,6 +35,8 @@ #include #include +#include + namespace rmf_fleet_adapter { namespace agv { @@ -367,6 +369,13 @@ class FleetUpdateHandle : public std::enable_shared_from_this FleetUpdateHandle& set_update_listener( std::function listener); + /// Get the rclcpp::Node that this fleet update handle will be using for + /// communication. + std::shared_ptr node(); + + /// const-qualified node() + std::shared_ptr node() const; + // Do not allow moving FleetUpdateHandle(FleetUpdateHandle&&) = delete; FleetUpdateHandle& operator=(FleetUpdateHandle&&) = delete; diff --git a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp index a9210811b..eb40d6e2c 100644 --- a/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp +++ b/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp @@ -2021,6 +2021,18 @@ FleetUpdateHandle& FleetUpdateHandle::set_update_listener( return *this; } +//============================================================================== +std::shared_ptr FleetUpdateHandle::node() +{ + return _pimpl->node; +} + +//============================================================================== +std::shared_ptr FleetUpdateHandle::node() const +{ + return _pimpl->node; +} + //============================================================================== bool FleetUpdateHandle::set_task_planner_params( std::shared_ptr battery_system, diff --git a/rmf_fleet_adapter_python/src/adapter.cpp b/rmf_fleet_adapter_python/src/adapter.cpp index 0a468688e..f0aace9f9 100644 --- a/rmf_fleet_adapter_python/src/adapter.cpp +++ b/rmf_fleet_adapter_python/src/adapter.cpp @@ -332,14 +332,14 @@ PYBIND11_MODULE(rmf_adapter, m) { double recharge_threshold, double recharge_soc, bool account_for_battery_drain, - const std::string& finishing_request_string = "nothing", - std::shared_ptr node = nullptr) + const std::string& finishing_request_string = "nothing") { std::function time_now = nullptr; std::optional planner_id = std::nullopt; + const auto node = self.node(); if (node) { - time_now = [n = std::weak_ptr(node)]() + time_now = [n = node->weak_from_this()]() { const auto node = n.lock(); if (!node) @@ -385,8 +385,7 @@ PYBIND11_MODULE(rmf_adapter, m) { py::arg("recharge_threshold"), py::arg("recharge_soc"), py::arg("account_for_battery_drain"), - py::arg("finishing_request_string") = "nothing", - py::arg("node") = nullptr) + py::arg("finishing_request_string") = "nothing") .def("accept_delivery_requests", &agv::FleetUpdateHandle::accept_delivery_requests, "NOTE: deprecated, use consider_delivery_requests() instead")