Skip to content

Forward State Controller#2215

Open
Nibanovic wants to merge 1 commit intoros-controls:masterfrom
b-robotized-forks:feat/forward_state_controller
Open

Forward State Controller#2215
Nibanovic wants to merge 1 commit intoros-controls:masterfrom
b-robotized-forks:feat/forward_state_controller

Conversation

@Nibanovic
Copy link
Copy Markdown
Contributor

Forward State Controller

Takes a list of state interfaces, and forwards them to command interfaces.
A single state interface can be forwarded to multiple command interfaces.

Seems like a natural addition alongside "forward command controller", so I'm opening a PR.
In structure, it is very similar to forward command controller

Example config:

    state_interfaces:
      - joint1/position
      - joint1/velocity
    forward_state:
      joint1/position:
        to_command: 
          - joint2/position
          - joint3/position
      joint1/velocity:
        to_command:
          - joint2/velocity

Copy link
Copy Markdown
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.

I personally don't see the need for this at all.

Can you please give some context on why and when this is needed?. Thank you

@Nibanovic
Copy link
Copy Markdown
Contributor Author

I wanted to showcase controlling ethercat semaphore lights from OPCUA server.
had one hardware interface which read states from OPCUA server, and another which took command interfaces via ethercat.
The simplest way for me to connect this without changing the hardware interfaces was just to mirror OPCUA states to ethercat commands. That is about it.
This controller then seemed similar to forward_command_controller, so I thought it might be useful to others as well.

@saikishor
Copy link
Copy Markdown
Member

I wanted to showcase controlling ethercat semaphore lights from OPCUA server. had one hardware interface which read states from OPCUA server, and another which took command interfaces via ethercat. The simplest way for me to connect this without changing the hardware interfaces was just to mirror OPCUA states to ethercat commands. That is about it. This controller then seemed similar to forward_command_controller, so I thought it might be useful to others as well.

I personally don't think it makes sense here. Let's see what other maintainers say

@Juliaj
Copy link
Copy Markdown
Contributor

Juliaj commented Mar 24, 2026

I changed the test YAML in the hope that it would better represent the use case.

test_forward_state_controller:
  ros__parameters:
    state_interfaces:
      - opcua_stack_green/status
    forward_state:
      opcua_stack_green/status:
        to_command: ["ethercat_stack_green/status"]

If that reading is correct, this boils down to make a single controller to deal with state from hardware A + commands on hardware B. This pattern may be rare for upstream to support. With such controller, the mapping is mostly in configuration, so you don’t have to teach each driver about the other in code.

@christophfroehlich christophfroehlich moved this from WIP to Needs discussion in Review triage Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs discussion

Development

Successfully merging this pull request may close these issues.

4 participants