Ask Your Question
0

How to convert rosgraph output to graphical representation?

asked 2018-04-09 02:51:57 -0500

thinwybk gravatar image

updated 2018-04-09 02:54:09 -0500

Is there some way to convert the output of rosgraph to a graphical representation similar to the one of rqt_graph? (I am interested in a way to do that in ros1 indigo.)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-04-09 03:03:01 -0500

gvdhoorn gravatar image

It depends a bit on what you mean exactly by rosgraph output, but if you're after the kind of diagram that rqt_graph shows, then that would be basically a rendering of a dot graph.

I'm not aware of any stand-alone tools that will render those for you, but a good starting point would be the code in rqt_graph, specifically RosGraph._update_rosgraph(), which calls RosGraph._generate_dotcode() which uses RosGraphDotcodeGenerator.generate_dotgraph(..) to generate the actual dot markup.

edit flag offensive delete link more

Comments

Exactly, I was thinking about a diagram. Thanks for the hint! In case one would like to add a "converter" functionality to e.g. rosgraph where would the most suitable place to add it there?

thinwybk gravatar imagethinwybk ( 2018-04-09 03:23:56 -0500 )edit

rosgraph itself doesn't have any dependencies right now other than rospkg. It's probably best to keep it that way.

Seeing as rqt_graph already contains the infrastructure, perhaps adding a stand-alone command line script there would be nice.

gvdhoorn gravatar imagegvdhoorn ( 2018-04-09 03:26:05 -0500 )edit

Alternatively, I could imagine that refactoring rqt_graph to make the RosGraphDotcodeGenerator into a stand-alone library might also make sense. rqt_graph could then use that, as well as a new tool that does what you are after.

gvdhoorn gravatar imagegvdhoorn ( 2018-04-09 03:27:23 -0500 )edit

Using one of your suggested approaches could it be made compatible with rqt_graph - "Topic statistics"?

thinwybk gravatar imagethinwybk ( 2018-04-09 04:08:19 -0500 )edit

I'm unsure as to what you're asking: rqt_graph already renders the topic statistics, if they are available. I haven't checked, but I would imagine that the same code that generates the dot graph adds the statistics.

gvdhoorn gravatar imagegvdhoorn ( 2018-04-09 04:11:22 -0500 )edit

I have statistics enabled with rosparam set enable_statistics true. I cannot run rgt_graph for displaying a diagram on the system I am working on. I am not seeing any /statistics topic. seems like rqt_graph is not installed on there...

thinwybk gravatar imagethinwybk ( 2018-04-09 04:22:39 -0500 )edit

Statistics gathering is independent of rqt_graph. If you're not seeing the topic then that would be a different issue. It is a prerequisite for rqt_graph (or some other tool) to visualise them though (obviously).

gvdhoorn gravatar imagegvdhoorn ( 2018-04-09 04:25:12 -0500 )edit

Did you see the note on wiki/Topics - Topic statistics:

this parameter has to be set before you start your nodes

gvdhoorn gravatar imagegvdhoorn ( 2018-04-09 04:25:43 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-04-09 02:51:57 -0500

Seen: 113 times

Last updated: Apr 09 '18