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

Visualize chained controllers with graphviz #763

Merged
merged 34 commits into from
Aug 25, 2022

Conversation

pac48
Copy link
Contributor

@pac48 pac48 commented Jul 3, 2022

This change depends on this PR. It adds a new command line option ros2 control view_controller_chains, which generates an image using Graphviz.
Screenshot from 2022-07-02 23-56-55

@pac48 pac48 changed the title Pr visualize chained controllers Visualize chained controllers with graphviz Jul 3, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jul 3, 2022

Codecov Report

Merging #763 (c023416) into master (925f5f3) will decrease coverage by 1.92%.
The diff coverage is 36.60%.

@@            Coverage Diff             @@
##           master     #763      +/-   ##
==========================================
- Coverage   34.61%   32.69%   -1.93%     
==========================================
  Files          52       90      +38     
  Lines        2981     8620    +5639     
  Branches     1855     5765    +3910     
==========================================
+ Hits         1032     2818    +1786     
- Misses        310      673     +363     
- Partials     1639     5129    +3490     
Flag Coverage Δ
unittests 32.69% <36.60%> (-1.93%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
controller_manager/src/realtime.cpp 0.00% <0.00%> (ø)
controller_manager/src/ros2_control_node.cpp 0.00% <0.00%> (ø)
..._interface/include/hardware_interface/actuator.hpp 100.00% <ø> (ø)
...re_interface/include/hardware_interface/sensor.hpp 100.00% <ø> (ø)
...re_interface/include/hardware_interface/system.hpp 100.00% <ø> (ø)
hardware_interface/src/resource_manager.cpp 50.09% <ø> (-3.53%) ⬇️
hardware_interface/src/sensor.cpp 50.52% <ø> (ø)
hardware_interface/src/system.cpp 55.45% <ø> (ø)
...rface/test/mock_components/test_generic_system.cpp 8.62% <ø> (ø)
...dware_interface/test/test_component_interfaces.cpp 32.44% <ø> (+4.25%) ⬆️
... and 106 more

@pac48 pac48 requested review from destogl and bmagyar July 3, 2022 17:04
@destogl
Copy link
Member

destogl commented Jul 4, 2022

This looks very cool! What do you think that we create a rqt plugin for that?

@pac48
Copy link
Contributor Author

pac48 commented Jul 4, 2022

This looks very cool! What do you think that we create a rqt plugin for that?

I was taking inspiration from ros2 run tf2_tools view_frames.py described here, but I think an rqt_plugin would also be a good idea. I will investigate the rqt plugin.

@ejalaa12
Copy link
Contributor

ejalaa12 commented Jul 4, 2022

That is a very cool feature indeed.
In general a plugin that displays the state of each controller(active, inactive, hardware interface claimed) with features like the one that existed in rqt in Ros1 would be very useful.

@pac48
Copy link
Contributor Author

pac48 commented Jul 5, 2022

That is a very cool feature indeed. In general a plugin that displays the state of each controller(active, inactive, hardware interface claimed) with features like the one that existed in rqt in Ros1 would be very useful.

What if I make the lines dashed if the interface is not claimed and solid if it is? And what if I put the controller status (active, inactive) underneath the name at the top of each node?

@ejalaa12
Copy link
Contributor

ejalaa12 commented Jul 5, 2022

What if I make the lines dashed if the interface is not claimed and solid if it is? And what if I put the controller status (active, inactive) underneath the name at the top of each node?

Agreed for the dashed lines.
I would add a either a small circle (red for inactive, green for active) on the side, or just change the text color, this would be more readable than having an additional text to tell if it is active inactive.

@mergify
Copy link
Contributor

mergify bot commented Jul 30, 2022

This pull request is in conflict. Could you fix it @pac48?

@destogl destogl marked this pull request as ready for review July 30, 2022 07:16
ros2controlcli/package.xml Outdated Show resolved Hide resolved
Copy link
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

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

Minor cleanup

ros2controlcli/test/test_view_controller_chains.py Outdated Show resolved Hide resolved
pac48 and others added 7 commits August 21, 2022 12:15
Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
…os2_control into pr-visualize-chained-controllers
@bmagyar bmagyar merged commit fbf9ca4 into ros-controls:master Aug 25, 2022
mamueluth pushed a commit to StoglRobotics-forks/ros2_control that referenced this pull request Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants