hi, I try to set one callback higher priority following the example cbg_executor . But It seems it introduces some delay compared to using MultiThreadedExecutor.
I publish on the topic "high_pong" at rate 100Hz. In the pong_node.cpp, I set the parameter "high_busyloop" to 1.0, and print the timestamp when receiving the msg.
Use the code in pong.cpp (setting high_prio_executor to ThreadPriority::HIGH), the output is (msg receiving interval is 1050ms):
But if I simply use MultiThreadedExecutor and add the pong node:
auto pong_node = std::make_shared<PongNode>();
rclcpp::executors::MultiThreadedExecutor multi_executor1;
multi_executor1.add_node(pong_node);
multi_executor1.spin();
rclcpp::shutdown();
return 0;
the output is (msg receiving interval is 1000ms):
