Skip to content

Commit

Permalink
killing command_astrobee on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
marinagmoreira committed Feb 14, 2024
1 parent 39fbc27 commit 736c4d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace plansys2_actions {
class IsaacAction : public plansys2::ActionExecutorClient {
public:
IsaacAction(ros::NodeHandle nh, const std::string& action, const std::chrono::nanoseconds& rate);
~IsaacAction();

protected:
void do_work();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ void IsaacAction::do_work() {
}
}
}

IsaacAction::~IsaacAction() {
if (pid_ != 0) {
// Kill the child process
kill(pid_, SIGKILL);
}
}
} // namespace plansys2_actions


Expand Down

0 comments on commit 736c4d1

Please sign in to comment.