-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execution rate becomes unstable when using component_container_mt #298
Comments
@isamu-takagi thanks for posting issue. i confirmed that source build with ros2/ros2@0e6cc1c, the problem CANNOT be observed in mainline.
[component_container_mt-1] [INFO] [1617927524.587156965] [producer]: produce: 004, 0x7f3b70023140
[component_container_mt-1] [INFO] [1617927524.587316806] [consumer]: consume: 004, 0x7f3b70023140
[component_container_mt-1] [INFO] [1617927525.587494242] [producer]: produce: 005, 0x7f3b500011f0
[component_container_mt-1] [INFO] [1617927525.587620083] [consumer]: consume: 005, 0x7f3b500011f0
[component_container_mt-1] [INFO] [1617927526.586748026] [producer]: produce: 006, 0x7f3b50001120
[component_container_mt-1] [INFO] [1617927526.586872937] [consumer]: consume: 006, 0x7f3b50001120
[component_container_mt-1] [INFO] [1617927527.586752922] [producer]: produce: 007, 0x7f3b50001120
[component_container_mt-1] [INFO] [1617927527.586878123] [consumer]: consume: 007, 0x7f3b50001120
[component_container_mt-1] [INFO] [1617927528.587181825] [producer]: produce: 008, 0x7f3b50001120
[component_container_mt-1] [INFO] [1617927528.587379966] [consumer]: consume: 008, 0x7f3b50001120
[component_container-1] [INFO] [1617927535.959378536] [producer]: produce: 000, 0x55f5c7dc69d0
[component_container-1] [INFO] [1617927535.959552437] [consumer]: consume: 000, 0x55f5c7dc69d0
[component_container-1] [INFO] [1617927536.959364671] [producer]: produce: 001, 0x55f5c7dc69d0
[component_container-1] [INFO] [1617927536.959492992] [consumer]: consume: 001, 0x55f5c7dc69d0
[component_container-1] [INFO] [1617927537.958930075] [producer]: produce: 002, 0x55f5c7d9ca70
[component_container-1] [INFO] [1617927537.959062356] [consumer]: consume: 002, 0x55f5c7d9ca70
[component_container-1] [INFO] [1617927538.959381064] [producer]: produce: 003, 0x55f5c7d9ca70
[component_container-1] [INFO] [1617927538.959526865] [consumer]: consume: 003, 0x55f5c7d9ca70 i believe that ros2/rclcpp#1516 can fix this problem, introducing gradual mutex locks gives some time window to take the executables.
there is a couple of warning for your test sample. /root/ros2_ws/colcon_ws/src/ros2/ros2_sandbox/src/intra_process/src/producer.cpp:20:33: warning: format ‘%p’ expects argument of type ‘void*’, but argument 6 has type ‘std::unique_ptr<std_msgs::msg::Int32_<std::allocator<void> >, std::default_delete<std_msgs::msg::Int32_<std::allocator<void> > > >::pointer’ {aka ‘std_msgs::msg::Int32_<std::allocator<void> >*’} [-Wformat=]
20 | RCLCPP_INFO(get_logger(), "produce: %03d, %p", msg->data, msg.get());
| ^~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
| |
| std::unique_ptr<std_msgs::msg::Int32_<std::allocator<void> >, std::default_delete<std_msgs::msg::Int32_<std::allocator<void> > > >::pointer {aka std_msgs::msg::Int32_<std::allocator<void> >*}
/root/ros2_ws/colcon_ws/src/ros2/ros2_sandbox/src/intra_process/src/producer.cpp:20:50: note: format string is defined here
20 | RCLCPP_INFO(get_logger(), "produce: %03d, %p", msg->data, msg.get());
| ~^
| |
| void* the following patch can get rid of the warning. diff --git a/src/intra_process/src/consumer.cpp b/src/intra_process/src/consumer.cpp
index edfad97..930c01d 100644
--- a/src/intra_process/src/consumer.cpp
+++ b/src/intra_process/src/consumer.cpp
@@ -10,7 +10,7 @@ class ConsumerComponent : public rclcpp::Node
sub_ = create_subscription<std_msgs::msg::Int32>("intra_topic", 10,
[this](const std_msgs::msg::Int32::UniquePtr msg)
{
- RCLCPP_INFO(get_logger(), "consume: %03d, %p", msg->data, msg.get());
+ RCLCPP_INFO(get_logger(), "consume: %03d, %p", msg->data, (void *)msg.get());
}
);
}
diff --git a/src/intra_process/src/producer.cpp b/src/intra_process/src/producer.cpp
index 1dfcaf3..1a693b1 100644
--- a/src/intra_process/src/producer.cpp
+++ b/src/intra_process/src/producer.cpp
@@ -17,7 +17,7 @@ class ProducerComponent : public rclcpp::Node
{
std_msgs::msg::Int32::UniquePtr msg = std::make_unique<std_msgs::msg::Int32>();
msg->data = counter_++;
- RCLCPP_INFO(get_logger(), "produce: %03d, %p", msg->data, msg.get());
+ RCLCPP_INFO(get_logger(), "produce: %03d, %p", msg->data, (void *)msg.get());
pub_->publish(std::move(msg));
}
|
@fujitatomoya Thank you for answering. I confirmed that it is executed every 1 second using ros2 source build. I'll close this issue.
|
Bug report
Required Info:
Steps to reproduce issue
cyclonedds setting
execute this command
clone test code and build
Note: This code is for testing intra-process communication, but it occurs even if
extra_arguments=[{"use_intra_process_comms": False}]
.launch
Expected behavior
Pub/sub logs are displayed at 1 second intervals like component_container_mt (with Fast RTPS) or component_container.
Actual behavior
The text was updated successfully, but these errors were encountered: