ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

microros rclc executor allows 5 handles but not 6

asked 2023-02-01 13:14:04 -0500

BryanGD gravatar image

updated 2023-02-01 13:15:31 -0500

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;
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-02-02 00:54:46 -0500

Pablogs gravatar image

Please open an issue in the github repo you are using, there are RMW configuration related with timer creations in micro-ROS.

edit flag offensive delete link more

Comments

Alright, I will do so, thanks.

BryanGD gravatar image BryanGD  ( 2023-02-02 06:31:01 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2023-02-01 13:14:04 -0500

Seen: 72 times

Last updated: Feb 02 '23