Skip to content

doc: Added explanation of preceding/following controllers #2192

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

Merged
merged 5 commits into from
Apr 17, 2025

Conversation

peci1
Copy link
Contributor

@peci1 peci1 commented Apr 17, 2025

Resolves #2189 .

This PR adds explanation of what preceding/following controller means.

I also broke the rule and attached an irrelevant fix of grammar in the paragraph directly preceding the paragraph I added. I hope it's not a big no no :)

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.

not sure about the RST syntax with '', let's see what happens

Co-authored-by: Christoph Fröhlich <[email protected]>
bmagyar
bmagyar previously approved these changes Apr 17, 2025
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!

@peci1
Copy link
Contributor Author

peci1 commented Apr 17, 2025

I have one more unclear point, probably because I'm pretty new to ros2_control: Could "if A's output" be replaced with "if A's command interfaces"? Or are command interfaces somehow different from controller outputs? I may be a bit confused because for Hardware, command interfaces are inputs...

@christophfroehlich
Copy link
Contributor

I have one more unclear point, probably because I'm pretty new to ros2_control: Could "if A's output" be replaced with "if A's command interfaces"? Or are command interfaces somehow different from controller outputs? I may be a bit confused because for Hardware, command interfaces are inputs...

There is no "output" in the implementation actually. A following controller or hardware component exports command interfaces, and (preceding) controllers are claiming it (as output). I.e., controller A is claiming the reference interfaces of controller B in this example. Should we also phrase it like this?

@peci1
Copy link
Contributor Author

peci1 commented Apr 17, 2025

Hmm, then I'm probably missing a distinction between command interface and reference interface...

@saikishor
Copy link
Member

saikishor commented Apr 17, 2025

Hmm, then I'm probably missing a distinction between command interface and reference interface...

The command interfaces are the outputs of your controller, where as the reference interfaces are the inputs to your controller so that they can produce outputs (which are commands).

For example, for a diff_drive_controller, the command interfaces would be the velocities of the wheels, where as the reference interfaces can be the base twist velocity. I hope this is clear for you :)

@peci1
Copy link
Contributor Author

peci1 commented Apr 17, 2025

Hmm, still not there... It seems to me @christophfroehlich and @saikishor have conflicting views:

There is no "output" in the implementation actually.

vs

The command interfaces are the outputs of your controller

Also, this type of code (taken from diff_drive controller) doesn't help my understanding of the distinction:

reference_interfaces.push_back(
    hardware_interface::CommandInterface(

@christophfroehlich
Copy link
Contributor

From the signal flow, sure, the controllers have an output. From the memory side they don't create an output, but they claim them.

@peci1
Copy link
Contributor Author

peci1 commented Apr 17, 2025

Okay, I probably start getting this.

A precedes controller B if A's output is connected to B's reference interface.

Could it be

A precedes controller B if A claims B's reference interfaces.

?

Or is the formulation with outputs more clear?

@saikishor
Copy link
Member

Okay, I probably start getting this.

A precedes controller B if A's output is connected to B's reference interface.

Could it be

A precedes controller B if A claims B's reference interfaces.

?

Or is the formulation with outputs more clear?

Yes, you are right!

@peci1
Copy link
Contributor Author

peci1 commented Apr 17, 2025

Or maybe to get the best of both the precise and the intuitive wording:

A precedes controller B if A claims (connects its output to) B's reference interfaces (inputs).

@peci1
Copy link
Contributor Author

peci1 commented Apr 17, 2025

Thanks, I've updated the wording.

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.

Thanks for the discussion, now it looks fine!

@christophfroehlich christophfroehlich added the backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS2 humble. label Apr 17, 2025
@christophfroehlich christophfroehlich merged commit 14ea4a6 into ros-controls:master Apr 17, 2025
5 checks passed
mergify bot pushed a commit that referenced this pull request Apr 17, 2025
(cherry picked from commit 14ea4a6)

# Conflicts:
#	controller_manager/doc/controller_chaining.rst
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 maintainers only! Label triggers PR backport to ROS2 humble.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: What are preceding and following controllers?
4 participants