Skip to content

How can we set sched_priority when we use dispatcher_executor #395

@alexleel

Description

@alexleel

Issue template

I check rclc_dispatcher_executor_spin implementation , and seems there is no apparent difference in case that I have set the priority.

Steps to reproduce the issue

subscriber code:

‘rclc_executor_sched_parameter_t` sched_p1;
  rclc_executor_sched_parameter_t sched_p2;
  sched_p1.policy = SCHED_FIFO;
  sched_p1.param.sched_priority = 10;
  sched_p2.policy = SCHED_FIFO;
  sched_p2.param.sched_priority = 20;
  rc = rclc_dispatcher_executor_add_subscription(
    &executor, &sub_a, &sub_msg_a, &callback_a,
    ON_NEW_DATA, &sched_p1);
  if (rc != RCL_RET_OK) {
    printf("Error in rclc_dispatcher_executor_add_subscription. \n");
  }

  rc = rclc_dispatcher_executor_add_subscription(
    &executor, &sub_b, &sub_msg_b, &callback_b,
    ON_NEW_DATA, &sched_p2);
  if (rc != RCL_RET_OK) {
    printf("Error in rclc_dispatcher_executor_add_subscription. \n");
  }

  rclc_dispatcher_executor_spin(&executor);

Expected behavior

See the difference of sub_a and sub_b

Actual behavior

No difference since checking executor->handles one by one in rclc_dispatcher_executor_spin()

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions