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-5810] remove impossible-to-implement functions from digital interrupts #503

Merged

Conversation

penguinland
Copy link
Member

Within digital interrupts, the value() method will get the number of interrupts that have occurred. It's a good thing to have; we'll keep it. However,

  • add_callback() cannot be implemented without changing the GPRC interface, which will require a scope doc, which will require planning how to do this right. Get rid of it for now: digital interrupts aren't really part of the API yet.
  • add_post_processor() doesn't exist outside of raspberry pi boards; get rid of it.
  • tick() is only used in tests (to simulate the interrupt firing). Keep it in MockDigitalInterrupt, but get rid of it in the "real" code.

So, how do you use digital interrupts outside of the RDK server? Unfortunately, you kinda can't, and have never been able to. You can repeatedly check its value and do something if you notice the value has changed, but a proper GRPC interface for digital interrupts doesn't currently exist. We shouldn't pretend that it does.

Copy link
Contributor

Warning your change may break code samples. If your change modifies any of the following functions please contact @viamrobotics/fleet-management. Thanks!

component function
base is_moving
board gpio_pin_by_name
camera get_image
encoder get_position
motor is_moving
sensor get_readings
servo get_position
arm get_end_position
gantry get_lengths
gripper is_moving
movement_sensor get_linear_acceleration
input_controller get_controls
audio get_properties
pose_tracker get_poses
power_sensor get_power
motion get_pose
vision get_classifications_from_camera

Copy link
Member

@njooma njooma left a comment

Choose a reason for hiding this comment

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

Love red PRs

@penguinland penguinland merged commit 63adacb into viamrobotics:main Dec 18, 2023
12 checks passed
@penguinland penguinland deleted the remove_dead_interrupt_methods branch December 18, 2023 22:39
njooma pushed a commit that referenced this pull request Dec 22, 2023
…errupts (#503)

Within digital interrupts, the `value()` method will get the number of interrupts that have occurred. It's a good thing to have; we'll keep it. However,
- `add_callback()` cannot be implemented without changing the GPRC interface, which will require a scope doc, which will require planning how to do this right. Get rid of it for now: digital interrupts aren't really part of the API yet.
- `add_post_processor()` doesn't exist outside of raspberry pi boards; get rid of it.
- `tick()` is only used in tests (to simulate the interrupt firing). Keep it in `MockDigitalInterrupt`, but get rid of it in the "real" code.

So, how do you use digital interrupts outside of the RDK server? Unfortunately, you kinda can't, and have never been able to. You can repeatedly check its value and do something if you notice the value has changed, but a proper GRPC interface for digital interrupts doesn't currently exist. We shouldn't pretend that it does. It ought to come sometime in 2024.
nicksanford pushed a commit to nicksanford/viam-python-sdk that referenced this pull request Jan 29, 2024
…errupts (viamrobotics#503)

Within digital interrupts, the `value()` method will get the number of interrupts that have occurred. It's a good thing to have; we'll keep it. However,
- `add_callback()` cannot be implemented without changing the GPRC interface, which will require a scope doc, which will require planning how to do this right. Get rid of it for now: digital interrupts aren't really part of the API yet.
- `add_post_processor()` doesn't exist outside of raspberry pi boards; get rid of it.
- `tick()` is only used in tests (to simulate the interrupt firing). Keep it in `MockDigitalInterrupt`, but get rid of it in the "real" code.

So, how do you use digital interrupts outside of the RDK server? Unfortunately, you kinda can't, and have never been able to. You can repeatedly check its value and do something if you notice the value has changed, but a proper GRPC interface for digital interrupts doesn't currently exist. We shouldn't pretend that it does. It ought to come sometime in 2024.
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