Skip to content

01. How to Use

takeshi-iwanari edited this page Jul 2, 2022 · 21 revisions

Requirements

  • Ubuntu 20.04 (Not tested in Windows / Mac)
  • optional: ROS 2 Galactic if you need runtime ROS graph analysis

Install and Run

sudo apt install graphviz graphviz-dev
pip3 install -r requirements.txt
python3 main.py architecture.yaml

Options

usage: main.py [-h] [--target_path TARGET_PATH] [--setting_file SETTING_FILE]
               [graph_file]

positional arguments:
  graph_file            Graph file path. e.g. architecture.yaml(CARET) or
                        rosgraph.dot(rqt_graph). default=architecture.yaml

optional arguments:
  -h, --help            show this help message and exit
  --setting_file SETTING_FILE
                        default=setting.json

Visualize architecture file (generated by CARET)

python3 main.py path-to-architcture.yaml

e.g.
python3 main.py architecture.yaml

Visualize dot file (generated by rqt_graph)

python3 main.py path-to-rosgraph.dot

e.g.
python3 main.py rosgraph.dot

Visualize runtime ROS graph (experimental)

  • Before starting Dear RosNodeViewr, set ROS environment
    • e.g. source /opt/ros/galactic/setup.bash
  • Click Graph -> Running ROS
python3 main.py

Setting file

How to apply setting file

python3 main.py --setting_file path-to-setting-file

Setting file format

{
    "app_setting": {                           ### Settings for application
        "window_size": [1920, 1080],           # Default window size
        "font": "/usr/share/fonts/truetype/ubuntu/Ubuntu-C.ttf",   # Path to font
        "ignore_unconnected_nodes": true       # Flag to ignore unconnected nodes 
    },
    "group_setting": {                         ### Settings for node visualization
        "__others__": {                        # Module name = The first part of topic name
            "direction": "horizontal",         # How to connect nodes (horizontal/vertical)
            "offset": [-0.5, -0.5, 1.0, 1.0],  # Position to place the module (x, y, w, h)
            "color": [16, 64, 96]              # Color for the module (r, g, b)
        }
    }
}

About node layout

  • Nodes are basically automatically located
  • However, you may want to align rough layout by yourself, when a diagram becomes complicated,
  • To achieve this, you can set offset for each module to set a specific position for a module while nodes in a module are automatically located
  • If you don't need it, just remove all entry except for "others"

todo image comes here

How to Operate

  • Move graph area
    • Middle mouse button drag
  • Zoom in/out
    • Mouse scroll
    • zoom function is temporal
Clone this wiki locally