Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hal, wpilib] PWM Rewrite #7845

Open
wants to merge 17 commits into
base: 2027
Choose a base branch
from
Open

Conversation

ThadHouse
Copy link
Member

The HAL will only contain the output period and the raw microseconds. Higher level things such as SimDevice can handle everything else.

@ThadHouse ThadHouse requested review from a team as code owners March 2, 2025 17:26
@ThadHouse ThadHouse marked this pull request as draft March 2, 2025 17:26
@github-actions github-actions bot added component: hal Hardware Abstraction Layer 2027 2027 target labels Mar 2, 2025
@@ -4,7 +4,6 @@ nativeUtils {
groupId = "edu.wpi.first.thirdparty.frc2024.ceres"
artifactId = "ceres-cpp"
headerClassifier = "headers"
sourceClassifier = "sources"
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but #7844 will likely be merged beforehand and make this OBE.

Copy link
Member

Choose a reason for hiding this comment

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

Was the change missed in 7844?

Copy link
Member Author

Choose a reason for hiding this comment

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

We haven't merged main into 2027 since then.

@ThadHouse ThadHouse marked this pull request as ready for review March 13, 2025 22:40
@ThadHouse ThadHouse requested a review from a team as a code owner March 13, 2025 22:40
@PeterJohnson PeterJohnson linked an issue Mar 14, 2025 that may be closed by this pull request
m_rawCbKey = REGISTER(PulseMicrosecond, "<raw", int32_t, int);
m_periodScaleCbKey = REGISTER(PeriodScale, "<period_scale", int32_t, int);
m_zeroLatchCbKey = REGISTER(ZeroLatch, "<zero_latch", bool, boolean);
m_outputPeriodCbKey = REGISTER(OutputPeriod, "<output_period", int32_t, int);
Copy link
Member

Choose a reason for hiding this comment

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

Need to update the websocket doc to match (both hardware_ws_api.md and wpilib-ws.yaml). Note this will break the Romi motor interface as well, but that should probably be changed to use a SimDevice.

Copy link
Member Author

Choose a reason for hiding this comment

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

Theres already a decent chunk of romi breakages in 2027. But I'll update that for now.

void SetSpeed(double val) override { HALSIM_SetPWMSpeed(m_index, val); }
void SetSpeed(double val) override {
HALSIM_SetPWMPulseMicrosecond(m_index, val);
}
Copy link
Member

Choose a reason for hiding this comment

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

Naming of Speed functions should be updated to be PulseMicrosecond or similar. Parameter/return types should also be changed from double to int32_t. But most likely this just needs a major update to use the SimDevice pieces instead? That can be a separate PR, we should just open an issue to track it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah the 2nd one is what is really needed. I just wanted it compiling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2027 2027 target component: examples component: hal Hardware Abstraction Layer component: wpilibc WPILib C++ component: wpilibj WPILib Java
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make servo class use composition instead of PWM inheritance
3 participants