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-7267] Board cleanup part 1: analogs can be written to #606

Merged
merged 18 commits into from
May 9, 2024

Conversation

penguinland
Copy link
Member

  • AnalogReader is now just Analog. Similarly, analog_reader_by_name is just analog_by_name, etc.
  • The Analog abstract class can now .write() in addition to .read().
  • (The underlying RPCs are unchanged: it's still a WriteAnalog RPC on the board. but SDK users don't interact directly with the RPCs.)

In an upcoming PR, I'll have more board cleanup to stream digital interrupts. but that's separate enough to warrant a separate PR.

@penguinland penguinland requested a review from a team as a code owner May 8, 2024 22:37
@penguinland penguinland requested review from njooma and stuqdog May 8, 2024 22:37
Copy link
Contributor

github-actions bot commented May 8, 2024

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

@penguinland
Copy link
Member Author

Don't worry, github-actions bot. I didn't touch board.gpio_pin_by_name.

pin = await my_board.gpio_pin_by_name(name="15")

# Get if it is true or false that the pin is set to high.
duty_cycle = await pin.get_pwm()
Copy link
Member Author

Choose a reason for hiding this comment

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

This paragraph is unrelated to my main change, but also has nothing to do with the function it's documenting. Reading an analog pin doesn't involve PWM, and I suspect this "documentation" was added via a copy-and-paste mistake.

src/viam/components/board/board.py Outdated Show resolved Hide resolved
src/viam/components/board/service.py Outdated Show resolved Hide resolved
@penguinland
Copy link
Member Author

I've needed to rerun the tests several times because they time out after 1 minute, and only 95ish% of the tests finish in a minute. Is this expected? I'm unsure if I've somehow made the tests much slower than normal, or the timeout threshold ought to be raised. With enough reruns, the tests can pass within the time limit...

@penguinland penguinland requested a review from njooma May 9, 2024 18:50
Copy link
Member

@stuqdog stuqdog left a comment

Choose a reason for hiding this comment

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

One minor thing (no need to re-request review) otherwise lgtm!

src/viam/components/board/board.py Outdated Show resolved Hide resolved
@penguinland penguinland merged commit f4f6d26 into viamrobotics:main May 9, 2024
12 checks passed
@penguinland penguinland deleted the board_cleanup branch May 9, 2024 19:57
@penguinland
Copy link
Member Author

In an upcoming PR, I'll have more board cleanup to stream digital interrupts.

Surprise, no I won't! Olivia already did that 2 weeks ago.

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