Giter Club home page Giter Club logo

Comments (3)

cbcoutu avatar cbcoutu commented on August 21, 2024 1

Apparently, I just needed to voice my problem to have the solution work, (guess I should invest in a rubber duck.) I will leave this issue open for a little longer, as the resulting solution is incredibly hacky and may have underlying problems.

Simply creating yet another signalhanlder over-ride (as mentioned in roscpp and 317 linked above) closes everything correctly. I'm not very content on this solution, because I tried this the other day and it didn't change anything. Not sure why it worked this time around, but the edits I made are:

Starting around line 655 in create_driver.cpp

void mySigintHandler(int sig){  //ADDITION
  rclcpp::shutdown();                //ADDITION
}                                               //ADDITION

int main(int argc, char** argv)
{
  rclcpp::init(argc, argv);
  auto create_driver = std::make_shared<CreateDriver>();
  signal(SIGINT, mySigintHandler); //ADDITION
  try
  {
    rclcpp::spin(create_driver);
    std::cout <<"PRINT" <<std::endl; //NOW THIS CORRECTLY PRINTS!
  }
  catch (std::runtime_error& ex)
  {
    RCLCPP_FATAL_STREAM(create_driver->get_logger(), "[CREATE] Runtime error: " << ex.what());
    return 1;
  }

  rclcpp::shutdown();
  return 0;
}

Again, a second opinion is greatly appreciated on this so I'll leave the issue for at least a couple days.

Thanks!

from create_robot.

jacobperron avatar jacobperron commented on August 21, 2024

Thanks for opening the issue! I suspect that the signal handler registered by libcreate is interferring with the rclcpp signal handler. I'll see if I can reproduce later this evening.

from create_robot.

jacobperron avatar jacobperron commented on August 21, 2024

@cbcoutu
I was able to reproduce the issue (thanks for the detailed investigation!). I think #89 should fix this issue, which depends on a new option in libcreate for disabling it's signal handler (AutonomyLab/libcreate#65). If you are able to try it out and report back that would be awesome 🙂

from create_robot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.