Skip to content

Linear Actuator - #41

Merged
28shettr merged 7 commits into
NextFTC:mainfrom
RoushilS:linear-actuator
Oct 5, 2026
Merged

28shettr merged 7 commits into
NextFTC:mainfrom
RoushilS:linear-actuator

Conversation

@RoushilS

Copy link
Copy Markdown

Added a LinearActuator wrapper that holds a NextMotor and a distance-per-rotation Per.

It converts linear distances to rotations and calls NextMotor.setPositionSetpoint(Angle).

@zachwaffle4 zachwaffle4 left a comment

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.

You should be able to do the math directly on the Angle, Distance, and Per values without needing to convert to Doubles (ie, without needing .into/.magnitude).

@RoushilS

RoushilS commented Sep 19, 2026 •

Copy link
Copy Markdown
Author

You should be able to do the math directly on the Angle, Distance, and Per values without needing to convert to Doubles (ie, without needing .into/.magnitude).

Does that work? It looks like the units library doesn't declare those operator overloads, so I'm pretty confused if I'm interpreting this right.

@28shettr

Copy link
Copy Markdown
Member

You should be able to do the math directly on the Angle, Distance, and Per values without needing to convert to Doubles (ie, without needing .into/.magnitude).

Does that work? It looks like the units library doesn't declare those operator overloads, so I'm pretty confused if I'm interpreting this right.

Yeah I dont think it's possible

Comment thread hardware/src/main/kotlin/dev/nextftc/hardware/actuators/LinearActuator.kt Outdated
Comment thread hardware/src/main/kotlin/dev/nextftc/hardware/actuators/LinearActuator.kt Outdated
Comment thread hardware/src/main/kotlin/dev/nextftc/hardware/actuators/LinearActuator.kt Outdated
Signed-off-by: Zach Harel <zach@zharel.me>
@28shettr
28shettr merged commit 0bd694c into NextFTC:main Oct 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants