Skip to content

Conversation

@mauropasse
Copy link
Collaborator

@mauropasse mauropasse commented Feb 4, 2021

Here I create a pure virtual EventsQueue class and an implementation SimpleEventsQueue

Usage:

#include "rclcpp/experimental/buffers/simple_events_queue.hpp"

auto events_queue = std::make_unique<rclcpp::experimental::buffers::SimpleEventsQueue>();

auto executor = std::make_shared<rclcpp::executors::EventsExecutor>(std::move(events_queue));

Todo:
Implement in a different PR other policies

@mauropasse
Copy link
Collaborator Author

With my latest changes this PR could be merged.
This other PR to my own branch is useful to discuss a BoundedEventsQueue implementation:
mauropasse#6

*/
RCLCPP_PUBLIC
void
set_queue_size_limit(size_t queue_size_limit)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not pass this to constructor?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did it on 5780ccf

bounded_queue->set_queue_size_limit(10);

// Create an events executor using the bounded queue
EventsExecutor executor_sub(std::move(bounded_queue));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit-tests for the queues should be independent from the executor.
You should just create a queue and start manually pushing/popping things

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I pushed this commit mauropasse@6fb2463
but this PR is not being updated, strange. I'll wait some time to see if gets updated

@mauropasse mauropasse closed this Feb 8, 2021
@mauropasse mauropasse reopened this Feb 8, 2021
@irobot-ros irobot-ros merged commit 4d78d42 into irobot-ros:irobot/add-events-executor Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants