Skip to content
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

Disable intra-process-comms for transient_local publisher #220

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/robot_state_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,15 @@ RobotStatePublisher::RobotStatePublisher(const rclcpp::NodeOptions & options)
tf_broadcaster_ = std::make_unique<tf2_ros::TransformBroadcaster>(this);
static_tf_broadcaster_ = std::make_unique<tf2_ros::StaticTransformBroadcaster>(this);

auto publisher_options = rclcpp::PublisherOptions();
// Explicitly disable intra_process_comms for this publisher alone to allow
// for this node to run in a component container with intra_process_comms enabled.
publisher_options.use_intra_process_comm = rclcpp::IntraProcessSetting::Disable;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised this is necessary. Does this mean subscribers in the same process don't receive messages from publishers if the publishers have transient_local durability? I would have expected them to still get the messages through the rmw API.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Iron and before an exception would be thrown by rclcpp. I wasn't aware that support for this was added in Jazzy/Rolling. So we can close this PR

description_pub_ = this->create_publisher<std_msgs::msg::String>(
"robot_description",
// Transient local is similar to latching in ROS 1.
rclcpp::QoS(1).transient_local());
rclcpp::QoS(1).transient_local(),
std::move(publisher_options));

setupURDF(urdf_xml);

Expand Down