Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ namespace executors
* executor.spin();
* executor.remove_node(node);
*/
class EventsExecutor : public rclcpp::Executor
class
[[deprecated(
"rclcpp::experimental::executors::EventsExecutor is deprecated and will be removed in "
"m-turtle. use rclcpp::executors::EventsCBGExecutor in single-threaded mode instead")]]
EventsExecutor : public rclcpp::Executor
{
public:
RCLCPP_SMART_PTR_DEFINITIONS(EventsExecutor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@
#include <utility>
#include <vector>

#include "rcpputils/compile_warnings.hpp"
#include "rcpputils/scope_exit.hpp"

using namespace std::chrono_literals;

// Disable deprecation warnings while maintaining the EventsExecutor
RCPPUTILS_DEPRECATION_WARNING_OFF_START

using rclcpp::experimental::executors::EventsExecutor;

EventsExecutor::EventsExecutor(
Expand Down Expand Up @@ -454,3 +458,5 @@ EventsExecutor::add_notify_waitable_to_collection(
{this->notify_waitable_, weak_group_ptr}
});
}

RCPPUTILS_DEPRECATION_WARNING_OFF_STOP
7 changes: 7 additions & 0 deletions rclcpp/test/rclcpp/executors/executor_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@
#include <string>
#include <type_traits>

#include "rcpputils/compile_warnings.hpp"

#include "rclcpp/executors/events_cbg_executor/events_cbg_executor.hpp"
#include "rclcpp/experimental/executors/events_executor/events_executor.hpp"
#include "rclcpp/executors/single_threaded_executor.hpp"
#include "rclcpp/executors/multi_threaded_executor.hpp"

// Disable deprecation warnings while maintaining the EventsExecutor
RCPPUTILS_DEPRECATION_WARNING_OFF_START

using ExecutorTypes =
::testing::Types<
rclcpp::executors::SingleThreadedExecutor,
Expand Down Expand Up @@ -65,4 +70,6 @@ using StandardExecutors =
rclcpp::executors::EventsCBGExecutor,
rclcpp::experimental::executors::EventsExecutor>;

RCPPUTILS_DEPRECATION_WARNING_OFF_STOP

#endif // RCLCPP__EXECUTORS__EXECUTOR_TYPES_HPP_
7 changes: 7 additions & 0 deletions rclcpp/test/rclcpp/executors/test_events_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@
#include "rclcpp/experimental/executors/events_executor/events_executor.hpp"
#include "rclcpp/node.hpp"

#include "rcpputils/compile_warnings.hpp"

#include "test_msgs/srv/empty.hpp"
#include "test_msgs/msg/empty.hpp"

// Disable deprecation warnings while maintaining the EventsExecutor
RCPPUTILS_DEPRECATION_WARNING_OFF_START

using namespace std::chrono_literals;

using rclcpp::experimental::executors::EventsExecutor;
Expand Down Expand Up @@ -672,3 +677,5 @@ TEST_F(TestEventsExecutor, keep_all_transient_local_receives_cached_message)
"rmw_subscription_set_on_new_message_callback where unread_count "
"is incorrectly clipped to depth=0 for KEEP_ALL history.";
}

RCPPUTILS_DEPRECATION_WARNING_OFF_STOP
6 changes: 6 additions & 0 deletions rclcpp/test/rclcpp/executors/test_executors_warmup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <type_traits>
#include <utility>

#include "rcpputils/compile_warnings.hpp"

#include "rclcpp/rclcpp.hpp"

#include "test_msgs/msg/empty.hpp"
Expand Down Expand Up @@ -146,11 +148,13 @@ TYPED_TEST(TestExecutorsWarmup, spin_some_doesnt_require_warmup)
// TODO(alsora): currently only the events-executor passes this test.
// Enable single-threaded and multi-threaded executors
// when https://github.com/ros2/rclcpp/pull/2595 gets merged
RCPPUTILS_DEPRECATION_WARNING_OFF_START
if (
!std::is_same<ExecutorType, rclcpp::experimental::executors::EventsExecutor>())
{
GTEST_SKIP();
}
RCPPUTILS_DEPRECATION_WARNING_OFF_STOP

ExecutorType executor;

Expand Down Expand Up @@ -191,11 +195,13 @@ TYPED_TEST(TestExecutorsWarmup, spin_some_doesnt_require_warmup_with_cbgroup)
// TODO(alsora): currently only the events-executor passes this test.
// Enable single-threaded and multi-threaded executors
// when https://github.com/ros2/rclcpp/pull/2595 gets merged
RCPPUTILS_DEPRECATION_WARNING_OFF_START
if (
!std::is_same<ExecutorType, rclcpp::experimental::executors::EventsExecutor>())
{
GTEST_SKIP();
}
RCPPUTILS_DEPRECATION_WARNING_OFF_STOP

ExecutorType executor;

Expand Down
4 changes: 2 additions & 2 deletions rclcpp_action/test/test_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ TEST_F(TestServer, goals_expired_with_events_executor)
rclcpp::ExecutorOptions opts;
opts.context = node->get_node_base_interface()->get_context();

rclcpp::experimental::executors::EventsExecutor executor(opts);
rclcpp::executors::EventsCBGExecutor executor(opts, 1);
executor.add_node(node);
const std::vector<GoalUUID> uuids{
{{1, 2, 3, 40, 5, 6, 70, 8, 9, 1, 11, 120, 13, 140, 15, 160}},
Expand Down Expand Up @@ -1132,7 +1132,7 @@ TEST_F(TestServer, goals_expired_with_events_executor)
// Wait for the result request to be received
ASSERT_EQ(
rclcpp::FutureReturnCode::SUCCESS,
executor.spin_until_future_complete(future));
executor.spin_until_future_complete(future, std::chrono::seconds(20)));

auto response = future.get();
EXPECT_EQ(action_msgs::msg::GoalStatus::STATUS_SUCCEEDED, response->status);
Expand Down
6 changes: 6 additions & 0 deletions rclcpp_components/src/component_container_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <memory>

#include "rcpputils/compile_warnings.hpp"
#include "rclcpp/utilities.hpp"
#include "rclcpp/experimental/executors/events_executor/events_executor.hpp"

Expand All @@ -27,7 +28,12 @@ int main(int argc, char * argv[])

/// Component container with an events executor.
rclcpp::init(argc, argv);

// Disable deprecation warnings while maintaining the EventsExecutor
RCPPUTILS_DEPRECATION_WARNING_OFF_START
auto exec = std::make_shared<rclcpp::experimental::executors::EventsExecutor>();
RCPPUTILS_DEPRECATION_WARNING_OFF_STOP

auto node = std::make_shared<rclcpp_components::ComponentManager>(exec);
exec->add_node(node);
exec->spin();
Expand Down