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

[wpilib] add UnitTopic #7382

Open
spacey-sooty opened this issue Nov 12, 2024 · 5 comments
Open

[wpilib] add UnitTopic #7382

spacey-sooty opened this issue Nov 12, 2024 · 5 comments
Labels
component: ntcore NetworkTables library type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Comments

@spacey-sooty
Copy link
Contributor

spacey-sooty commented Nov 12, 2024

This would be a topic that stores a double with unit information represented in NT metadata. This would improve the logging experience for units greatly

@rzblue
Copy link
Member

rzblue commented Nov 15, 2024

This sounds like a better fit for a higher level telemetry library- we don't want ntcore to depend on wpimath or wpiunits, and the functionality is really just a wrapper around a double topic.

@spacey-sooty
Copy link
Contributor Author

Maybe something that could be included in wpilibc/j so it's still easily accessible to teams?

@calcmogul calcmogul added type: feature Brand new functionality, features, pages, workflows, endpoints, etc. component: ntcore NetworkTables library labels Nov 16, 2024
@Advay17
Copy link
Contributor

Advay17 commented Nov 20, 2024

Wouldn't that still require modifying NetworkTableInstance to add getUnitTopic(), making it still depend on the units library? Unless we want teams to instead use getDoubleTopic() for UnitTopic, which would be inconsistent.

@Starlight220
Copy link
Member

Starlight220 commented Nov 20, 2024

The idea would be a library that takes a Supplier<Measure<?>> etc, rather than users delving into unit-typed Topic objects etc

Or something similar to a Sendable implementation

@spacey-sooty
Copy link
Contributor Author

The idea would be a library that takes a Supplier<Measure<?>> etc, rather than users delving into unit-typed Topic objects etc

I actually disagree with this. A unit typed topic which behaves the same as other topics makes sense as an abstraction here IMO.

Wouldn't that still require modifying NetworkTableInstance to add getUnitTopic(), making it still depend on the units library? Unless we want teams to instead use getDoubleTopic() for UnitTopic, which would be inconsistent

You should be able to create this topic by injecting the instance or parent table instead of using this which would avoid modifying ntcore

@spacey-sooty spacey-sooty changed the title [ntcore] add UnitTopic [wpilib] add UnitTopic Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ntcore NetworkTables library type: feature Brand new functionality, features, pages, workflows, endpoints, etc.
Projects
None yet
Development

No branches or pull requests

5 participants