Skip to content

Commit

Permalink
Shutdown explicitly while existing
Browse files Browse the repository at this point in the history
Signed-off-by: ChenYing Kuo <[email protected]>
  • Loading branch information
evshary committed Oct 18, 2024
1 parent a4d00a9 commit 1b031ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ros_gz_sim/src/create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,13 @@ int main(int _argc, char ** _argv)
if (node.Request(service, req, timeout, rep, result)) {
if (result && rep.data()) {
RCLCPP_INFO(ros2_node->get_logger(), "Entity creation successfull.");
rclcpp::shutdown();
return 0;
} else {
RCLCPP_ERROR(
ros2_node->get_logger(), "Entity creation failed.\n %s",
req.DebugString().c_str());
rclcpp::shutdown();
return 1;
}
} else {
Expand All @@ -275,5 +277,6 @@ int main(int _argc, char ** _argv)
}
}
RCLCPP_INFO(ros2_node->get_logger(), "Entity creation was interrupted.");
rclcpp::shutdown();
return 0;
}

0 comments on commit 1b031ec

Please sign in to comment.