Git Product home page Git Product logo

Comments (9)

BrannonKing avatar BrannonKing commented on August 25, 2024 1

I'm quite certain that Gazebo does not load its plugins in parallel. I don't think that multithreaded access will be an issue there.

from rcl.

dirk-thomas avatar dirk-thomas commented on August 25, 2024

From @BrannonKing on August 31, 2017 20:16

I suppose catching the exception in Gazebo is fine. I just wanted the logging removed (since it already throws an exception). BTW, this should move to rcl; it's logged in the wrong spot.

from rcl.

dirk-thomas avatar dirk-thomas commented on August 25, 2024

@BrannonKing Can you please provide more information about how the API is being used and if possible how to reproduce the problem.

from rcl.

BrannonKing avatar BrannonKing commented on August 25, 2024

I start up multiple Gazebo plugins. Each one has to call rclcpp::init because you don't know which plugin will start first. They all run in the same process, but init prints a message and throws an error about having been called already for every subsequent plugin. I can eat the exception but can't hide the message.

from rcl.

wjwwood avatar wjwwood commented on August 25, 2024

You could just ignore the ones that fail to init for this particular reason (assuming that some other code managed to init first). However we should make sure rclcpp::init is thread-safe. rcl_init is not:

https://github.com/ros2/rcl/blob/master/rcl/include/rcl/rcl.h#L108

from rcl.

dirk-thomas avatar dirk-thomas commented on August 25, 2024

I think that is what he is trying to do but the calls which throw also print an error message which he currently can't avoid. I will come up with a PR to fix this...

from rcl.

wjwwood avatar wjwwood commented on August 25, 2024

The rcl error just needs to be cleared here: https://github.com/ros2/rclcpp/blob/master/rclcpp/src/rclcpp/utilities.cpp#L168

@dirk-thomas I'll let you do that since you already said you were working on it.

But we should also make sure it is thread-safe, because right now it is not I think.

from rcl.

dirk-thomas avatar dirk-thomas commented on August 25, 2024

The rcl error just needs to be cleared here: https://github.com/ros2/rclcpp/blob/master/rclcpp/src/rclcpp/utilities.cpp#L168

Indeed: ros2/rclcpp#366

from rcl.

wjwwood avatar wjwwood commented on August 25, 2024

I'll just reiterate that rclcpp::init() is not thread-safe. So we either could use a pr to make it so, or @BrannonKing you should take care to protect it in your code.

from rcl.

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.