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
Pub/Sub graph generation #6368
Conversation
Nice! What is the value for |
I used the files in the |
… Seperate graphs between MC, FW, and VTOL.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@stephanbro what's the current status? |
Continued in #8393 |
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 incmake/configs
.See #6189