Skip to content

[wpilib] add gravity compensation methods to expansion hub position constants#8890

Open
zachwaffle4 wants to merge 1 commit into
wpilibsuite:mainfrom
zachwaffle4:exhub-feedforward
Open

[wpilib] add gravity compensation methods to expansion hub position constants#8890
zachwaffle4 wants to merge 1 commit into
wpilibsuite:mainfrom
zachwaffle4:exhub-feedforward

Conversation

@zachwaffle4
Copy link
Copy Markdown
Contributor

@zachwaffle4 zachwaffle4 commented May 12, 2026

@zachwaffle4 zachwaffle4 requested a review from a team as a code owner May 12, 2026 16:49
Signed-off-by: Zach Harel <zach@zharel.me>
Copy link
Copy Markdown
Contributor

@ArchdukeTim ArchdukeTim left a comment

Choose a reason for hiding this comment

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

There should probably be a cosine angle for arm compensation for when maximum kG is not at 0º


m_gLiftPublisher = systemServer
.GetDoubleTopic(fmt::format(
"/rhsp/{}/motor{}/constants/position/kgLift",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this reads as kg Lift or 'kilogram lift'. Other notation in wpilib has kG

@zachwaffle4
Copy link
Copy Markdown
Contributor Author

There should probably be a cosine angle for arm compensation for when maximum kG is not at 0º

Can you describe what this would look like? I looked at REV's API and they don't seem to have that (unless I missed it, which is definitely possible).

@ThadHouse ThadHouse requested a review from Copilot May 15, 2026 05:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds gravity compensation configuration support to ExpansionHub position constants in Java, C++, and Python bindings, publishing new NetworkTables topics expected by the corresponding service-side implementation.

Changes:

  • Adds lift gravity, arm gravity, and arm ratio publishers.
  • Adds fluent setter APIs for gravity compensation in Java and C++.
  • Exposes the new C++ methods through semiwrap Python bindings.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
wpilibj/src/main/java/org/wpilib/hardware/expansionhub/ExpansionHubPositionConstants.java Adds Java publishers, setters, and cleanup for gravity compensation constants.
wpilibc/src/main/python/semiwrap/ExpansionHubPositionConstants.yml Adds Python binding entries for the new C++ methods.
wpilibc/src/main/native/include/wpi/hardware/expansionhub/ExpansionHubPositionConstants.hpp Declares the new C++ gravity compensation APIs and publisher members.
wpilibc/src/main/native/cpp/hardware/expansionhub/ExpansionHubPositionConstants.cpp Implements the new C++ publishers and setter methods.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants