Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pub/Sub graph generation #6368

Closed
wants to merge 2 commits into from
Closed

Conversation

stephanbro
Copy link
Contributor

@stephanbro stephanbro commented Jan 17, 2017

This script looks through each file within the scope passed to it to generate a list of the publishers and subscribers for each topic. The current output prints a JSON of each key and within that a list of the publishers and subscribers. Additionally there is the ability to use graphviz to generate a plot, but that is currently commented out.

Usage: ./px_generate_pubsub_graph.py <cmake-file-scoping>, where the value of <cmake-file-scoping> is a config file found in cmake/configs.

See #6189

@LorenzMeier
Copy link
Member

Nice! What is the value for <cmake-file-scoping>?

@stephanbro
Copy link
Contributor Author

stephanbro commented Jan 17, 2017

I used the files in the cmake/configs folder. I updated the first comment to reflect that.

@stephanbro stephanbro changed the title [WIP] Pub/Sub graph generation Pub/Sub graph generation Jan 19, 2017
@bartslinger
Copy link
Contributor

Great idea! I've not tested it yet, but looking at the script I think not everything is captured. For example in the mc pos controller: https://github.com/PX4/Firmware/blob/master/src/modules/mc_pos_control/mc_pos_control_main.cpp#L2328

In this case, it actually depends on whether or not the vehicle is VTOL which topic is used. Therefore I'm also not sure what would be the appropriate solution.

import codecs

from graphviz import Digraph
from px4params import scope, cmakeparser
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmakeparser is getting nuked here (#6385) , it didn't know how to parse include statements, so it is better to just use cmake to parse the cmake files.

To do this, make this script take a list of modules like I did in the PR. Then you can tie this script into cmake to do the scoping and pub sub graph creation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgoppert Thanks for the heads up! I will update this PR accordingly

@TSC21
Copy link
Member

TSC21 commented Jul 27, 2017

@stephanbro what's the current status?

@dagar
Copy link
Member

dagar commented Dec 9, 2017

Continued in #8393

@dagar dagar closed this Dec 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants