[wpilib] add gravity compensation methods to expansion hub position constants#8890
[wpilib] add gravity compensation methods to expansion hub position constants#8890zachwaffle4 wants to merge 1 commit into
Conversation
a13508f to
7205f59
Compare
Signed-off-by: Zach Harel <zach@zharel.me>
7205f59 to
6f4fe76
Compare
ArchdukeTim
left a comment
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
this reads as kg Lift or 'kilogram lift'. Other notation in wpilib has kG
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). |
There was a problem hiding this comment.
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.
also requires wpilibsuite/scservices#29