Skip to content

[wpilib] separate expansionhubservo into separate servo and crservo classes#8770

Open
zachwaffle4 wants to merge 2 commits intowpilibsuite:2027from
zachwaffle4:exhub-servo
Open

[wpilib] separate expansionhubservo into separate servo and crservo classes#8770
zachwaffle4 wants to merge 2 commits intowpilibsuite:2027from
zachwaffle4:exhub-servo

Conversation

@zachwaffle4
Copy link
Copy Markdown

This removes the confusion of the ExpansionHubServo class serving both purposes, and thus having a set method that functions as setPosition when in servo mode and setThrottle when not in continuous mode. It also removes the setContinuousRotationMethod which could be confused for a method that switches the actual servo firmware itself from servo to continuous mode, which is not a thing that is physically possible I think.

@zachwaffle4 zachwaffle4 requested a review from a team as a code owner April 14, 2026 03:54
@github-actions github-actions bot added component: wpilibj WPILib Java component: wpilibc WPILib C++ 2027 2027 target labels Apr 14, 2026
/**
* Sets whether the servo is reversed.
*
* This will reverse both Set() and SetAngle().
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Outdated.

* by SetAngleRange
*
* Servo angles range from 0 to 180 degrees. Use Set() with your own scaler
* Use Set() with your own scaler
Copy link
Copy Markdown
Member

@Gold856 Gold856 Apr 14, 2026

Choose a reason for hiding this comment

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

Set doesn't exist here anymore. Also reflow the comment and add missing punctuation to the summary.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Outdated.

Comment on lines +29 to +34
* Set the servo position.
*
* Servo values range from 0.0 to 1.0 corresponding to the range of full left
* to full right.
*
* @param value Position from 0.0 to 1.0.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Incorrect

@qwertychouskie
Copy link
Copy Markdown

which could be confused for a method that switches the actual servo firmware itself from servo to continuous mode, which is not a thing that is physically possible I think.

Supposedly the Servo Hub can switch the modes of REV/goBILDA servos, but I don't know if that ability is implemented at all in revlib or such, or if it's hardware-client-only right now. That said, I wouldn't really expect this to be a thing you would switch mid-opmode, and even if that functionality eventually gets exposed for hardware that supports it, it probably shouldn't be a core WPILib feature.

# Conflicts:
#	wpilibc/src/main/native/cpp/hardware/expansionhub/ExpansionHubServo.cpp
#	wpilibc/src/main/native/include/wpi/hardware/expansionhub/ExpansionHubServo.hpp
#	wpilibc/src/main/python/semiwrap/ExpansionHubServo.yml
#	wpilibj/src/main/java/org/wpilib/hardware/expansionhub/ExpansionHubServo.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2027 2027 target component: wpilibc WPILib C++ component: wpilibj WPILib Java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants