Skip to content

Proposal: Modular Reference Handling in ROS 2 Controllers #1757

Open
@my-rice

Description

@my-rice

Hi, we are writing this issue as part of the Automatic Control Group from the University of Salerno. We have previously contributed to the ROS ecosystem, for example, through pull requests such as here and here, as well as by deploying ROS 2 packages to the community like here.


We are opening this issue to propose a new design approach for the control framework, specifically aimed at improving how controllers handle reference inputs.

Is your feature request related to a problem? Please describe.
After reviewing the current implementations, we observed that a significant portion of controller code is dedicated to managing reference acquisition, typically via subscribers or action servers. For example, here and here.

Describe the solution you'd like
To improve modularity and separation of concerns, we propose a cleaner structure that decouples reference acquisition from control logic. The idea is to divide responsibilities into two distinct modules:

  1. Reference Generator – This component is practically a controller, but its purpose is to receive and validate reference trajectories or setpoints from the ROS 2 network. It abstracts the communication interface and provides a clean output to downstream controllers, using controller chaining.

  2. Controller – This component is exclusively responsible for computing the control law. It receives input from the Reference Generator and remains agnostic to how references are produced or delivered.

This modular structure promotes better organization and a clearer separation of responsibilities. Moreover, Reference Generators increase code reuse across multiple controllers. The diagram below illustrates the proposed architecture:
Image
Importantly, this proposal does not require any modifications to existing controllers. The framework is fully backward-compatible, allowing existing controllers to continue functioning without changes. Developers creating new controllers may adopt this structure if it aligns with their needs.

Describe alternatives you've considered
The most straightforward alternative is to maintain the current design, leaving users responsible for implementing their own reference-handling logic, even when this functionality could be modularized and reused across controllers.

Additional context
We have already internally implemented a prototype of this modular framework and developed demo controllers to demonstrate its benefits. We are happy to make the repository public on request.

We are sharing this issue now to gather feedbacks and assess whether this direction aligns with the needs and preferences of the community. We are happy to discuss, refine, or adjust the approach based on your input.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions