@@ -523,17 +523,13 @@ class Client : public ClientBase
523523 // If there's not, we fall back into inter-process communication, since
524524 // the server might be available in another process or was configured to not use IPC.
525525 if (intra_process_server_available) {
526- bool goal_sent_by_ipc = ipc_action_client_->has_goal_id (hashed_guuid);
526+ ipc_action_client_->store_goal_response_callback (
527+ hashed_guuid, goal_response_callback);
527528
528- if (goal_sent_by_ipc) {
529- ipc_action_client_->store_goal_response_callback (
530- hashed_guuid, goal_response_callback);
531-
532- intra_process_send_done = ipm->template intra_process_action_send_goal_request <ActionT>(
533- ipc_action_client_id_,
534- std::move (goal_request),
535- hashed_guuid);
536- }
529+ intra_process_send_done = ipm->template intra_process_action_send_goal_request <ActionT>(
530+ ipc_action_client_id_,
531+ std::move (goal_request),
532+ hashed_guuid);
537533 }
538534 }
539535
@@ -850,7 +846,8 @@ class Client : public ClientBase
850846 if (intra_process_server_available) {
851847 size_t hashed_guuid = std::hash<GoalUUID>()(goal_handle->get_goal_id ());
852848
853- bool goal_sent_by_ipc = ipc_action_client_->has_goal_id (hashed_guuid);
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);
854851
855852 if (goal_sent_by_ipc) {
856853 ipc_action_client_->store_result_response_callback (
@@ -910,17 +907,12 @@ class Client : public ClientBase
910907 // the server might be available in another process or was configured to not use IPC.
911908 if (intra_process_server_available) {
912909 size_t hashed_guuid = std::hash<GoalUUID>()(cancel_request->goal_info .goal_id .uuid );
910+ ipc_action_client_->store_cancel_goal_callback (
911+ hashed_guuid, cancel_goal_callback);
913912
914- bool goal_sent_by_ipc = ipc_action_client_->has_goal_id (hashed_guuid);
915-
916- if (goal_sent_by_ipc) {
917- ipc_action_client_->store_cancel_goal_callback (
918- hashed_guuid, cancel_goal_callback);
919-
920- intra_process_send_done = ipm->template intra_process_action_send_cancel_request <ActionT>(
913+ intra_process_send_done = ipm->template intra_process_action_send_cancel_request <ActionT>(
921914 ipc_action_client_id_,
922915 std::move (cancel_request));
923- }
924916 }
925917 }
926918
0 commit comments