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

Humble backport and new fixes #154

Merged
Show file tree
Hide file tree
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: 5 additions & 2 deletions rclcpp/include/rclcpp/experimental/intra_process_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,14 @@ class IntraProcessManager
auto server = get_matching_intra_process_action_server<ActionT>(ipc_action_client_id);

if (server) {
{
std::unique_lock<std::shared_timed_mutex> lock(mutex_);
clients_uuid_to_id_[goal_id] = ipc_action_client_id;
}

server->store_ipc_action_goal_request(
ipc_action_client_id, std::move(goal_request));

std::unique_lock<std::shared_timed_mutex> lock(mutex_);
clients_uuid_to_id_[goal_id] = ipc_action_client_id;
return true;
}
return false;
Expand Down
11 changes: 5 additions & 6 deletions rclcpp/include/rclcpp/publisher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,11 @@ class Publisher : public PublisherBase
bool inter_process_publish_needed =
get_subscription_count() > get_intra_process_subscription_count();

if (inter_process_publish_needed) {
// If the publisher is configured with transient local durability, we must publish
// inter-process. This ensures that the RMW stores the messages for late joiner subscriptions.
// This has the consequence of subscriptions experiencing the double-delivery issue
// mentioned in https://github.com/ros2/rclcpp/issues/1750
if (inter_process_publish_needed || buffer_) {
auto ros_msg_ptr = std::make_shared<ROSMessageType>();
// TODO(clalancette): This is unnecessarily doing an additional conversion
// that may have already been done in do_intra_process_publish_and_return_shared().
Expand All @@ -363,11 +367,6 @@ class Publisher : public PublisherBase
buffer_->add_shared(ros_msg_ptr);
}
} else {
if (buffer_) {
auto ros_msg_ptr = std::make_shared<ROSMessageType>();
rclcpp::TypeAdapter<MessageT>::convert_to_ros_message(*msg, *ros_msg_ptr);
buffer_->add_shared(ros_msg_ptr);
}
this->do_intra_process_publish(std::move(msg));
}
}
Expand Down
Loading