microros rclc executor allows 5 handles but not 6
Good day all,
Does the microros rclc executor have a maximum allowed number of handles that can be added? I couldn't find anything documented about this, so perhaps I have some other kind of memory issue (or something else altogether).
I was able to run an executor with 4 publishers + 1 subscriber, but the moment I add another publisher, there is no data on the new published topic. I then tried to split the publishers and subscribers over two executors. The behaviour was still the same. A snippet of my code:
rclc_executor_t executor_1, executor_2;
executor_1 = rclc_executor_get_zero_initialized_executor();
executor_2 = rclc_executor_get_zero_initialized_executor();
rclc_executor_init(&executor_1, &support.context, 4, &allocator);
rclc_executor_init(&executor_2, &support.context, 2, &allocator);
rclc_executor_add_timer(&executor_1, &publisher1_timer);
rclc_executor_add_timer(&executor_1, &publisher2_timer);
rclc_executor_add_timer(&executor_1, &publisher3_timer);
rclc_executor_add_subscription(&executor_1, &subscriber, &sub_msg, &subscription_callback, ON_NEW_DATA);
rclc_executor_add_timer(&executor_2, &publisher4_timer);
rclc_executor_add_timer(&executor_2, &publisher5_time);
rclc_executor_prepare(&executor_1);
rclc_executor_prepare(&executor_2);
while (true)
{
val1 = val1_read();
val2 = val2_read();
val3 = val3_read();
rclc_executor_spin_some(&executor_1, RCL_MS_TO_NS(1000));
val4 = val4_read();
val5 = val5_read();
rclc_executor_spin_some(&executor_2, RCL_MS_TO_NS(1000));
}
return 0;