-
Notifications
You must be signed in to change notification settings - Fork 64
RSDK-2483: Encoder API SDK changes (Python) #256
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few nits.
Report the position of the encoder. | ||
The value returned is the current position either in relative units (ticks away from a zero position) | ||
or absolute units (degrees along a circle). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have a comment describing the parameter position_type
and what it is/used for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the test is failing because evidently python 3.9 is being stricter with types. So everywhere you take PositionType
as a param/return, you should make it PositionType.ValueType
.
[nit] Also, be sure to organize your imports. You can do so in VS Code by pressing Option+Shift+O
Co-authored-by: Naveed Jooma <naveedjooma@gmail.com>
Co-authored-by: Naveed Jooma <naveedjooma@gmail.com>
This change adds support for the new encoder API in the Python SDK. All of the tests in
test_encoder.py
pass successfully, however there is a consistent IDE error of a type mismatch whenever using the PositionType enum. It shouldn't be an actual issue (as it's not causing any tests to fail) but for reference, those errors occur at the following locations:src/viam/components/encoder/service.py
, line 49,request.position_type
, and line 51,pos_type
tests/mocks/components.py
, line 442,return ... self.position_type
examples/server/v1/components.py
, line 454,return ... self.position_type