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 @@ -53,7 +53,7 @@ EventsExecutor::EventsExecutor(
EventsExecutor::~EventsExecutor()
{
spinning.store(false);
};
}

void
EventsExecutor::spin()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ EventsExecutorEntitiesCollector::set_callback_group_entities_callbacks(
// Set callbacks for all other entity types
group->find_subscription_ptrs_if(
[this](const rclcpp::SubscriptionBase::SharedPtr & subscription) {
assert(this != nullptr);
if (subscription) {
weak_subscriptions_map_.emplace(subscription.get(), subscription);

Expand Down Expand Up @@ -389,17 +390,19 @@ std::function<void(size_t)>
EventsExecutorEntitiesCollector::create_entity_callback(
void * exec_entity_id, ExecutorEventType event_type)
{
auto callback = [this, exec_entity_id, event_type](size_t num_events) {
assert(this != nullptr);
std::function<void(size_t)> callback = [this, exec_entity_id, event_type](size_t num_events) {
assert(this != nullptr);
ExecutorEvent event = {exec_entity_id, -1, event_type, num_events};
associated_executor_->events_queue_->enqueue(event);
this->associated_executor_->events_queue_->enqueue(event);
};
return callback;
}

std::function<void(size_t, int)>
EventsExecutorEntitiesCollector::create_waitable_callback(void * exec_entity_id)
{
auto callback = [this, exec_entity_id](size_t num_events, int gen_entity_id) {
std::function<void(size_t, int)> callback = [this, exec_entity_id](size_t num_events, int gen_entity_id) {
ExecutorEvent event =
{exec_entity_id, gen_entity_id, ExecutorEventType::WAITABLE_EVENT, num_events};
associated_executor_->events_queue_->enqueue(event);
Expand Down