ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

graph listener ros2

asked 2018-06-19 13:30:20 -0600

Sriram gravatar image

Is there any documentation or notes available for understanding how to work with graph listener?

I'm trying to port/get rqt_graph working with ros2 and trying analyzing differences. Where I see with ros2 we do not have a framework for mapping node_names to topic_names, which is used with rqt.

Any clues/directions would be really helpful.

edit retag flag offensive close merge delete

Comments

Hi Sriram, how is going with your porting? is it publicly available? i'm really interested in this feature and I could contribute if you have not finished yet to implement.

alsora gravatar image alsora  ( 2018-09-11 11:08:40 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-06-19 14:36:04 -0600

William gravatar image

Not really, there's documentation for the pieces, but no overarching documentation. The best option is to see how it is used in something like wait_for_service:

https://github.com/ros2/rclcpp/blob/b...

You basically:

  • create an event ("graph event" object)
  • call Node::wait_for_graph_event(event, timeout)
  • when it returns check what you're watching for, e.g. if a service is ready or if the topic_names_and_types are different

The event just tells you that something changed, but it's up to you to detect what actually changed. In the future this might change, but for now that's the best we can offer. We didn't have event contain the source of the change because that would require us to queue up events and until now our code doesn't have any queueing (the middleware handles that for us).

edit flag offensive delete link more

Comments

Thank you William for the snippet.

I'd another question linking to something above. How do we create a graph data with node name and topic name mapped? I did try to write a call back handler inside rmw_fastrtps. But didn't work. Any clues here?

Sriram gravatar image Sriram  ( 2018-06-19 15:02:37 -0600 )edit

I don't understand what you mean by "a graph data with node name and topic name mapped", but it sounds like a new question, so you should start a new question and accept this answer if it answered your original question.

William gravatar image William  ( 2018-06-19 17:10:47 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2018-06-19 13:30:20 -0600

Seen: 701 times

Last updated: Jun 19 '18