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

Added spawner colours to list_controllers depending upon active or inactive #1409

Merged
merged 6 commits into from
Feb 29, 2024

Conversation

soham2560
Copy link
Contributor

@soham2560 soham2560 commented Feb 21, 2024

This PR

Closes #687

  • Made output for list_controllers coloured
    • Active controllers are highlighted with green active
    • Inactive controllers are highlighted with red cyan inactive
    • Unconfigured controllers are highlighted with yellow(warning) unconfigured

Screenshots

image

@christophfroehlich
Copy link
Contributor

Thanks for the nice addon. Should we add other colors for unconfigured state? It is printed in red now, if it is in any other state than active?

Copy link

codecov bot commented Feb 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.88%. Comparing base (786d5b5) to head (7be93b2).
Report is 20 commits behind head on master.

❗ Current head 7be93b2 differs from pull request most recent head 17463f6. Consider uploading reports for the commit 17463f6 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1409       +/-   ##
===========================================
+ Coverage   47.49%   75.88%   +28.38%     
===========================================
  Files          41       41               
  Lines        3556     3359      -197     
  Branches     1938     1935        -3     
===========================================
+ Hits         1689     2549      +860     
+ Misses        459      418       -41     
+ Partials     1408      392     -1016     
Flag Coverage Δ
unittests 75.88% <ø> (+28.38%) ⬆️

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

see 32 files with indirect coverage changes

@soham2560
Copy link
Contributor Author

soham2560 commented Feb 21, 2024

I have changed the color scheme in 7be93b2 as suggested by @saikishor. Do let me know if there are any changes. However 2 points

  • I wasn't able to test this with a controller in the unconfigured state as I couldn't find a way to set that state purposefully, if you know of a way do let me know, I will test for that too
  • Current code also doesn't consider the finalized state, should I add that too?

@saikishor
Copy link
Member

  • I wasn't able to test this with a controller in the unconfigured state as I couldn't find a way to set that state purposefully, if you know of a way do let me know, I will test for that too

If you load a controller using load_controller service then it goes into unconfigured state

  • Current code also doesn't consider the finalized state, should I add that too?

I think internally it is not linked to any controller state, so I belive it should be good

@christophfroehlich
Copy link
Contributor

Fyi, you can use rqt_controller_manager to set the state of a controller easily.
Have a look at this color scheme here:

path = get_package_share_directory("rqt_controller_manager")
self._icons = {
"active": QIcon(f"{path}/resource/led_green.png"),
"finalized": QIcon(f"{path}/resource/led_off.png"),
"inactive": QIcon(f"{path}/resource/led_red.png"),
"unconfigured": QIcon(f"{path}/resource/led_off.png"),
}

maybe we can use the same colors there as you have implemented it now?

Copy link
Contributor

@fmauch fmauch left a comment

Choose a reason for hiding this comment

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

I like the improvement!

@soham2560
Copy link
Contributor Author

soham2560 commented Feb 22, 2024

Thanks for the tips regarding the controller manager @saikishor @christophfroehlich! Was able to test with the unconfigured state as well, I've added the result in the PR description, do have a look.

maybe we can use the same colors there as you have implemented it now?

That sounds like a good idea, I can have a look at that if you want @christophfroehlich

Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

LGTM

@bmagyar bmagyar added backport-humble This label should be used by maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron. labels Feb 29, 2024
@bmagyar bmagyar merged commit 0711cd6 into ros-controls:master Feb 29, 2024
11 checks passed
mergify bot pushed a commit that referenced this pull request Feb 29, 2024
…inactive (#1409)

(cherry picked from commit 0711cd6)

# Conflicts:
#	ros2controlcli/ros2controlcli/verb/list_controllers.py
mergify bot pushed a commit that referenced this pull request Feb 29, 2024
bmagyar pushed a commit that referenced this pull request Mar 1, 2024
bmagyar pushed a commit that referenced this pull request Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble This label should be used by maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ros2_control CLI] list_controller should have colored output
7 participants