Skip to content

Commit cce9a1a

Browse files
authored
Merge pull request #1 from mauropasse/mauro/apojomovsky-iron
Mauro/apojomovsky iron
2 parents ccdd52e + 2a36625 commit cce9a1a

File tree

5 files changed

+591
-251
lines changed

5 files changed

+591
-251
lines changed

rclcpp/include/rclcpp/experimental/intra_process_manager.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ class IntraProcessManager
10611061
auto ptr = MessageAllocTraits::allocate(allocator, 1);
10621062
MessageAllocTraits::construct(allocator, ptr, *message);
10631063

1064-
subscription->provide_intra_process_data(std::move(MessageUniquePtr(ptr, deleter)));
1064+
subscription->provide_intra_process_data(MessageUniquePtr(ptr, deleter));
10651065
}
10661066

10671067
continue;
@@ -1104,7 +1104,7 @@ class IntraProcessManager
11041104
MessageAllocTraits::construct(allocator, ptr, *message);
11051105

11061106
ros_message_subscription->provide_intra_process_message(
1107-
std::move(MessageUniquePtr(ptr, deleter)));
1107+
MessageUniquePtr(ptr, deleter));
11081108
}
11091109
}
11101110
}

rclcpp_action/include/rclcpp_action/client.hpp

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@ class ClientBase : public rclcpp::Waitable
9797
);
9898
}
9999

100+
/// Return true if there is an intra-process action server that is ready to take goal requests.
101+
bool
102+
intra_process_action_server_is_available()
103+
{
104+
if (auto ipm = weak_ipm_.lock()) {
105+
return ipm->action_server_is_available(ipc_action_client_id_);
106+
}
107+
return false;
108+
}
109+
100110
// -------------
101111
// Waitables API
102112

@@ -835,12 +845,18 @@ class Client : public ClientBase
835845
// the server might be available in another process or was configured to not use IPC.
836846
if (intra_process_server_available) {
837847
size_t hashed_guuid = std::hash<GoalUUID>()(goal_handle->get_goal_id());
838-
ipc_action_client_->store_result_response_callback(
839-
hashed_guuid, result_response_callback);
840848

841-
intra_process_send_done = ipm->template intra_process_action_send_result_request<ActionT>(
842-
ipc_action_client_id_,
843-
std::move(goal_result_request));
849+
// Determine if goal was sent through inter or intra process by checking the goal ID
850+
bool goal_sent_by_ipc = ipm->get_action_client_id_from_goal_uuid(hashed_guuid);
851+
852+
if (goal_sent_by_ipc) {
853+
ipc_action_client_->store_result_response_callback(
854+
hashed_guuid, result_response_callback);
855+
856+
intra_process_send_done = ipm->template intra_process_action_send_result_request<ActionT>(
857+
ipc_action_client_id_,
858+
std::move(goal_result_request));
859+
}
844860
}
845861
}
846862

rclcpp_action/include/rclcpp_action/server.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,8 @@ class Server : public ServerBase, public std::enable_shared_from_this<Server<Act
675675
rclcpp::get_logger("rclcpp_action"),
676676
"Action server can't send result response, missing IPC Action client: %s. "
677677
"Will do inter-process publish",
678-
this->action_name_.c_str());
678+
this->action_name_);
679+
679680
return true;
680681
}
681682

0 commit comments

Comments
 (0)