Skip to content

initial joint values for JointStateBroadcaster#2290

Draft
christianrauch wants to merge 3 commits intoros-controls:masterfrom
christianrauch:init_joint_state
Draft

initial joint values for JointStateBroadcaster#2290
christianrauch wants to merge 3 commits intoros-controls:masterfrom
christianrauch:init_joint_state

Conversation

@christianrauch
Copy link
Copy Markdown

@christianrauch christianrauch commented Apr 12, 2026

Description

Add new parameters to set the initial interface values for JointStateBroadcaster.

Fixes # (issue)

Is this user-facing behavior change?

Yes. It adds new parameters. The defaults stay the same, i.e. the default behaviour does not change.

Did you use Generative AI?

No.

Additional Information

The tests:

colcon test --event-handlers=console_direct+ --packages-select joint_state_broadcaster

fail. But they currently also fail on master (at least for me locally).

TODOs

To send us a pull request, please:

  • Fork the repository.
  • Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
  • Ensure local tests pass. (colcon test and pre-commit run (requires you to install pre-commit by pip3 install pre-commit)
  • Commit to your fork using clear commit messages.
  • Send a pull request, answering any default questions in the pull request interface.
  • Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

@christianrauch christianrauch marked this pull request as ready for review April 12, 2026 22:06
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.

Could you explain the motivation behind this change?

@christianrauch
Copy link
Copy Markdown
Author

Could you explain the motivation behind this change?

When your system only exposes velocity state interfaces, but you need the position for the rotor_state_broadcaster, it makes snese to initialise these values with 0, for example. This is akin to the joint_state_publisher, which allows you to send 0 for joint values.

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.

When your system only exposes velocity state interfaces, but you need the position for the rotor_state_broadcaster, it makes sense to initialise these values with 0, for example. This is akin to the joint_state_publisher, which allows you to send 0 for joint values.

I understand the need. If this is what you need, then the intial value should be per joint name instead of everything together, so it is explicit

@christianrauch
Copy link
Copy Markdown
Author

When your system only exposes velocity state interfaces, but you need the position for the rotor_state_broadcaster, it makes sense to initialise these values with 0, for example. This is akin to the joint_state_publisher, which allows you to send 0 for joint values.

I understand the need. If this is what you need, then the intial value should be per joint name instead of everything together, so it is explicit

This seems a bit excessive to me. For a 7 DoF arm, this amounts to setting 21 values. You do not have to do this with the joint_state_publisher. Isn't there an easier way to do this?

@saikishor
Copy link
Copy Markdown
Member

You only set those joints, who lack the feedback not for everything right?

@christianrauch
Copy link
Copy Markdown
Author

You only set those joints, who lack the feedback not for everything right?

The initial values of the joints with feedback will be overridden anyway, so you can as well just set all joints at once. But I see your problem. I guess when a robot's default configuration is not all-0, then initialising all joints to the same value does not make sense.

@saikishor
Copy link
Copy Markdown
Member

Moreover, 0 is a valid value and I don't think the JSB should initialise them to a valid value by default. There could be a case where 0 is not within your joint limits too.

@christianrauch christianrauch marked this pull request as draft April 18, 2026 23:04
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.

2 participants