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

Add a functionality to look for the controller type in the params file when not parsed #1502

Conversation

saikishor
Copy link
Member

This will enable to have the config file as in ROS1 with their type defined in the params file. The advantage of having it like this is that the controller type and the parameters that are parsed are dependent, it is better to define the dependent data in one place.

Thank you

@christophfroehlich
Copy link
Contributor

Does this mean that instead of

controller_manager:
  ros__parameters:
    update_rate: 10  # Hz

    forward_position_controller:
      type: forward_command_controller/ForwardCommandController

forward_position_controller:
  ros__parameters:
    joints:
      - joint1
      - joint2
    interface_name: position

one can use this?

controller_manager:
  ros__parameters:
    update_rate: 10  # Hz

forward_position_controller:
  ros__parameters:
    type: forward_command_controller/ForwardCommandController
    joints:
      - joint1
      - joint2
    interface_name: position

@saikishor
Copy link
Member Author

@christophfroehlich Yes, that should be possible now

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.42%. Comparing base (c935b50) to head (0dcf3e2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1502      +/-   ##
==========================================
+ Coverage   88.31%   88.42%   +0.10%     
==========================================
  Files         101      101              
  Lines        8313     8327      +14     
  Branches      725      726       +1     
==========================================
+ Hits         7342     7363      +21     
+ Misses        711      703       -8     
- Partials      260      261       +1     
Flag Coverage Δ
unittests 88.42% <100.00%> (+0.10%) ⬆️

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

Files Coverage Δ
controller_manager/test/test_spawner_unspawner.cpp 98.82% <100.00%> (+0.21%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

LGTM

@saikishor
Copy link
Member Author

saikishor commented Apr 23, 2024

@christophfroehlich I've found a corner case when loading multiple controllers from same file. This is fixed now. If you can take a look it would be great. Thanks

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

I played around with the tests, it seems to work fine now.

@saikishor
Copy link
Member Author

Now using the --controller-type argument should print the following deprecation warning

/home/user/rolling_worspace/ros2_control_ws/install/controller_manager/lib/python3.10/site-packages/controller_manager/spawner.py:209: DeprecationWarning: The '--controller-type' argument is deprecated and will be removed in future releases. Declare the controller type parameter in the param file instead.

@saikishor
Copy link
Member Author

In the upcoming days, I will make changes on the ros2_control_demos, so you can check how this change will affect

@saikishor
Copy link
Member Author

saikishor commented Apr 25, 2024

@christophfroehlich I've added the deprecation note to the controller_type argument as you have mentioned in the #1503

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.

Thank you!

@bmagyar bmagyar merged commit 4d772b2 into ros-controls:master May 4, 2024
11 of 12 checks passed
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

3 participants