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

RSDK-8714: Encoder wrappers #64

Merged
merged 5 commits into from
Sep 11, 2024
Merged

Conversation

gloriacai01
Copy link
Member

Add encoder wrappers in java sdk + associated tests

@gloriacai01 gloriacai01 requested a review from a team as a code owner September 4, 2024 21:20
@gloriacai01 gloriacai01 changed the title Encoder RSDK-8714: Encoder wrappers Sep 11, 2024
Copy link
Member

@purplenicole730 purplenicole730 left a comment

Choose a reason for hiding this comment

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

There seems to be some whitespacing and spelling issues. I'm not sure what editor you're using, but you can probably look up some autoformatting tools to help you with the whitespace!


/**
* Report the position of the encoder.
* The value returned is the current position in terms of it's ``position_type``.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* The value returned is the current position in terms of it's ``position_type``.
* The value returned is the current position in terms of its ``position_type``.


/**
* Report the position of the encoder.
* The value returned is the current position in terms of it's ``position_type``.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* The value returned is the current position in terms of it's ``position_type``.
* The value returned is the current position in terms of its ``position_type``.


/**
* Report the position of the encoder.
* The value returned is the current position in terms of it's ``position_type``.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* The value returned is the current position in terms of it's ``position_type``.
* The value returned is the current position in terms of its ``position_type``.


/**
* Report the position of the encoder.
* The value returned is the current position in terms of it's ``position_type``.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* The value returned is the current position in terms of it's ``position_type``.
* The value returned is the current position in terms of its ``position_type``.

Comment on lines 98 to 99
fun getPosition( extra: Struct): Pair<Float, PositionType>{
return getPosition( null, extra)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
fun getPosition( extra: Struct): Pair<Float, PositionType>{
return getPosition( null, extra)
fun getPosition(extra: Struct): Pair<Float, PositionType>{
return getPosition(null, extra)

* @return a map of position types to supported status.
*/
fun getProperties(): Properties {
return getProperties( Struct.getDefaultInstance())
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return getProperties( Struct.getDefaultInstance())
return getProperties(Struct.getDefaultInstance())

verify(encoder).getProperties(Struct.getDefaultInstance())
assertTrue(properties.ticksCountSupported)
assertTrue(properties.angleDegreesSupported)
}
Copy link
Member

Choose a reason for hiding this comment

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

whitespace

Comment on lines 133 to 134


Copy link
Member

Choose a reason for hiding this comment

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

extra whitespace

* ticks since last zeroing for a relative encoder or degrees for an absolute encoder, and the second [1] the type of
* position the encoder returns (ticks or degrees).
*/
fun getPosition(): Pair<Float, PositionType> {
Copy link
Member

Choose a reason for hiding this comment

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

Why does getPosition have four definitions? It seems other functions have two.

@gloriacai01 gloriacai01 merged commit 698114b into viamrobotics:main Sep 11, 2024
3 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.

2 participants