Code Monkey home page Code Monkey logo

Comments (6)

ct2034 avatar ct2034 commented on June 16, 2024 1

Yes, the get_node_names() (https://docs.ros2.org/galactic/api/rclpy/api/node.html#rclpy.node.Node.get_node_names) method should return all running nodes. I am not sure, though, how quickly a node is removed after it dies. Maybe you have to test this.

from diagnostics.

ct2034 avatar ct2034 commented on June 16, 2024 1

You can publish the results similar to how it is done here https://github.com/ros/diagnostics/blob/ros2/diagnostic_updater/diagnostic_updater/example.py

from diagnostics.

ct2034 avatar ct2034 commented on June 16, 2024

Hi @TZECHIN6. I agree that this may be a common use case. Currently, there is no pre-made node for that. Please feel free to add one to: https://github.com/ros/diagnostics/tree/ros2/diagnostic_common_diagnostics :)

from diagnostics.

TZECHIN6 avatar TZECHIN6 commented on June 16, 2024

To verify a node is dead or not, what is the best way to do so, a very simple method is to publish a heartbeat message say every single second, but this come to creating a whole bunch of messages if there are many nodes.

is there any build in function in ros2 can directly access its state?

get_node_names() Function in rclpy will list out all node within ROS2 environment, I am not sure does a node can be seen mean that node is alive and functioning…

from diagnostics.

TZECHIN6 avatar TZECHIN6 commented on June 16, 2024

I can come up with a very quick way to test it using python list element check, but this come down to hardcoding the node name needed to be checked... which some time the launch file can rename the node. So I am not so sure is there any dynamic way to solve this if using get_node_names().

I can share it to the common diagnostics, do you expect the output of the diagnostics result in a form of this /diagnostic topic? Acutally I havent use this before, so have to understand the structure of it..

from diagnostics.

TZECHIN6 avatar TZECHIN6 commented on June 16, 2024

I just spotted that there is a class (here) actually doing something to what i want, check a node is alive or not. but I am not so sure how to use it. I will rise another issue about that. Thanks

from diagnostics.

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.