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

DOCS-2949: QA board examples #4661

Merged
merged 3 commits into from
Jan 7, 2025
Merged

Conversation

JessamyT
Copy link
Contributor

No description provided.

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 IsMoving
board GPIOPinByName
camera Properties
encoder Properties
motor IsMoving
sensor Readings
servo Position
arm EndPosition
audio MediaProperties
gantry Lengths
gripper IsMoving
input_controller Controls
movement_sensor LinearAcceleration
power_sensor Power
pose_tracker Poses
motion GetPose
vision GetProperties

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Dec 31, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Dec 31, 2024
@JessamyT JessamyT changed the title QA board examples DOCS-2949: QA board examples Dec 31, 2024
// myBoard, err := board.FromRobot(robot, "my_board")
//
// // Get the names of all known analog pins
// names := myBoard.AnalogNames()
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think AnalogNames is supported anymore

@@ -27,7 +27,7 @@ import (
// pin, err := myBoard.GPIOPinByName("15")
//
// // Get if it is true or false that the state of the pin is high.
// high := pin.Get(context.Background(), nil)
// high, err := pin.Get(context.Background(), nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

did the returns of pin.Get change? like why is there an error now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Idk if it changed or if this was always wrong? But I'm seeing it returning bool, error: https://pkg.go.dev/go.viam.com/[email protected]/components/board#GPIOPin

@@ -37,7 +37,7 @@ import (
// pin, err := myBoard.GPIOPinByName("15")
//
// // Returns the duty cycle.
// duty_cycle := pin.PWM(context.Background(), nil)
// duty_cycle, err := pin.PWM(context.Background(), nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -67,7 +67,7 @@ import (
// pin, err := myBoard.GPIOPinByName("15")
//
// // Set the PWM frequency of this pin to 1600 Hz.
// high := pin.SetPWMFreq(context.Background(), 1600, nil)
// err = pin.SetPWMFreq(context.Background(), 1600, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

also did not know that this changed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe it has always returned an error but someone decided to name the error "high" or made a mistake? I just figured this makes more sense for consistency since looking at the interface it seems to return an error.

components/board/board.go Outdated Show resolved Hide resolved
@viambot viambot removed the safe to test This pull request is marked safe to test from a trusted zone label Jan 7, 2025
@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Jan 7, 2025
@JessamyT JessamyT merged commit 429384d into viamrobotics:main Jan 7, 2025
16 checks passed
@JessamyT JessamyT deleted the goboard-qa branch January 7, 2025 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants