Skip to content

Commit

Permalink
[FIX] sigint handler initialization before first cin
Browse files Browse the repository at this point in the history
  • Loading branch information
mascheiber committed Nov 25, 2022
1 parent 8b2788c commit d9c4f42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/autonomy_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ int main(int argc, char* argv[])
// Instanciate autonomy
autonomy::Autonomy autonomy(nh);

autonomy.logger_.logUI("undefined", ESCAPE(BOLD_ESCAPE, GREEN_ESCAPE),
" >>> Press [ENTER] to start the CNS-FLIGHT Autonomy\n");
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');

// Sigaction to handle CTRL-C
// sigintHandler = std::bind(&autonomy::Autonomy::sigintHandler, &autonomy);
sigintHandler = [&autonomy]() { autonomy.sigintHandler(); };
Expand All @@ -61,6 +57,10 @@ int main(int argc, char* argv[])
sigIntHandler.sa_flags = 0;
sigaction(SIGINT, &sigIntHandler, nullptr);

autonomy.logger_.logUI("undefined", ESCAPE(BOLD_ESCAPE, GREEN_ESCAPE),
" >>> Press [ENTER] to start the CNS-FLIGHT Autonomy\n");
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');

// Start the autonomy
autonomy.startAutonomy();

Expand Down

0 comments on commit d9c4f42

Please sign in to comment.