Skip to content

Commit

Permalink
Fix arm, base, camera, and resource example snippets (#4392)
Browse files Browse the repository at this point in the history
  • Loading branch information
JessamyT authored Sep 25, 2024
1 parent 93aebdd commit 7a0577c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/arm/arm.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func Named(name string) resource.Name {
// // Create a Pose for the arm.
// examplePose := spatialmath.NewPose(
// r3.Vector{X: 5, Y: 5, Z: 5},
// &spatialmath.OrientationVectorDegrees{0X: 5, 0Y: 5, Theta: 20}
// &spatialmath.OrientationVectorDegrees{OX: 5, OY: 5, Theta: 20},
// )
//
// // Move your arm to the Pose.
Expand Down
2 changes: 1 addition & 1 deletion components/base/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func Named(name string) resource.Name {
//
// // Make your wheeled base spin right. Set angular power to -75%.
// logger.Info("spin right")
// err = mybase.SetPower(context.Background(), r3.Vector{}, r3.Vector{Z: -.75}, nil)
// err = myBase.SetPower(context.Background(), r3.Vector{}, r3.Vector{Z: -.75}, nil)
//
// SetVelocity example:
//
Expand Down
6 changes: 3 additions & 3 deletions components/camera/camera.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ type Camera interface {
//
// myCamera, err := camera.FromRobot(machine, "my_camera")
//
// // gets the properties from a camera
// properties, err := myCamera.Properties(context.Background())
// // gets the next point cloud from a camera
// pointCloud, err := myCamera.NextPointCloud(context.Background())
//
// Close example:
//
// myCamera, err := camera.FromRobot(machine, "my_camera")
//
// err = myCamera.Close(ctx)
// err = myCamera.Close(context.Background())
//
// [camera component docs]: https://docs.viam.com/components/camera/
type VideoSource interface {
Expand Down
4 changes: 2 additions & 2 deletions resource/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var (
// // This example shows using Close with an arm component.
// myArm, err := arm.FromRobot(machine, "my_arm")
//
// err = myArm.Close(ctx)
// err = myArm.Close(context.Background())
type Resource interface {
// Get the Name of the resource.
Name() Name
Expand Down Expand Up @@ -204,7 +204,7 @@ type Actuator interface {
// if len(geometries) > 0 {
// // Get the center of the first geometry
// elem := geometries[0]
// fmt.Println("Pose of the first geometry's center point:", elem.center)
// fmt.Println("Pose of the first geometry's center point:", elem.Pose())
// }
type Shaped interface {
// Geometries returns the list of geometries associated with the resource, in any order. The poses of the geometries reflect their
Expand Down

0 comments on commit 7a0577c

Please sign in to comment.