From 1332e697ff455a6619e8bca3c6122e8487ddcf54 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Mon, 9 Sep 2024 12:58:53 -0400 Subject: [PATCH] DOCS-2498: Link to main component documentation on RDK docs site (#4351) --- components/arm/arm.go | 6 ++++++ components/base/base.go | 6 ++++++ components/board/board.go | 6 ++++++ components/camera/camera.go | 6 ++++++ components/encoder/encoder.go | 8 +++++++- components/gantry/gantry.go | 7 +++++++ components/generic/generic.go | 5 ++++- components/gripper/gripper.go | 6 ++++++ 8 files changed, 48 insertions(+), 2 deletions(-) diff --git a/components/arm/arm.go b/components/arm/arm.go index 38cc02dab8a..d01d6502a3f 100644 --- a/components/arm/arm.go +++ b/components/arm/arm.go @@ -1,6 +1,9 @@ //go:build !no_cgo // Package arm defines the arm that a robot uses to manipulate objects. +// For more information, see the [arm component docs]. +// +// [arm component docs]: https://docs.viam.com/components/arm/ package arm import ( @@ -48,6 +51,7 @@ func Named(name string) resource.Name { } // An Arm represents a physical robotic arm that exists in three-dimensional space. +// For more information, see the [arm component docs]. // // EndPosition example: // @@ -87,6 +91,8 @@ func Named(name string) resource.Name { // // // Get the current position of each joint on the arm as JointPositions. // pos, err := myArm.JointPositions(context.Background(), nil) +// +// [arm component docs]: https://docs.viam.com/components/arm/ type Arm interface { resource.Resource referenceframe.ModelFramer diff --git a/components/base/base.go b/components/base/base.go index 4a6cb3f17e4..7150bad73a3 100644 --- a/components/base/base.go +++ b/components/base/base.go @@ -1,4 +1,7 @@ // Package base defines the base that a robot uses to move around. +// For more information, see the [base component docs]. +// +// [base component docs]: https://docs.viam.com/components/base/ package base import ( @@ -34,6 +37,7 @@ func Named(name string) resource.Name { } // A Base represents a physical base of a robot. +// For more information, see the [base component docs]. // // MoveStraight example: // @@ -93,6 +97,8 @@ func Named(name string) resource.Name { // // // Get the wheel circumference // myBaseWheelCircumference := properties.WheelCircumferenceMeters +// +// [base component docs]: https://docs.viam.com/components/base/ type Base interface { resource.Resource resource.Actuator diff --git a/components/board/board.go b/components/board/board.go index 2b965259511..be6a8cffad9 100644 --- a/components/board/board.go +++ b/components/board/board.go @@ -2,6 +2,9 @@ // such as a Raspberry Pi. // // Besides the board itself, some other interfaces it defines are analog pins and digital interrupts. +// For more information, see the [board component docs]. +// +// [board component docs]: https://docs.viam.com/components/board/ package board import ( @@ -46,6 +49,7 @@ func Named(name string) resource.Name { // A Board represents a physical general purpose board that contains various // components such as analogs, and digital interrupts. +// For more information, see the [board component docs]. // // AnalogByName example: // @@ -93,6 +97,8 @@ func Named(name string) resource.Name { // } // // err = myBoard.StreamTicks(context.Background(), interrupts, ticksChan, nil) +// +// [board component docs]: https://docs.viam.com/components/board/ type Board interface { resource.Resource diff --git a/components/camera/camera.go b/components/camera/camera.go index bf9c385dfde..ec1751d53b1 100644 --- a/components/camera/camera.go +++ b/components/camera/camera.go @@ -1,4 +1,7 @@ // Package camera defines an image capturing device. +// For more information, see the [camera component docs]. +// +// [camera component docs]: https://docs.viam.com/components/camera/ package camera import ( @@ -75,6 +78,7 @@ type Camera interface { } // A VideoSource represents anything that can capture frames. +// For more information, see the [camera component docs]. // // Images example: // @@ -105,6 +109,8 @@ type Camera interface { // myCamera, err := camera.FromRobot(machine, "my_camera") // // err = myCamera.Close(ctx) +// +// [camera component docs]: https://docs.viam.com/components/camera/ type VideoSource interface { // Images is used for getting simultaneous images from different imagers, // along with associated metadata (just timestamp for now). It's not for getting a time series of images from the same imager. diff --git a/components/encoder/encoder.go b/components/encoder/encoder.go index aefb98f2f8d..95d5434b1db 100644 --- a/components/encoder/encoder.go +++ b/components/encoder/encoder.go @@ -1,4 +1,7 @@ -// Package encoder implements the encoder component +// Package encoder implements the encoder component. +// For more information, see the [encoder component docs]. +// +// [encoder component docs]: https://docs.viam.com/components/encoder/ package encoder import ( @@ -58,6 +61,7 @@ func (t PositionType) String() string { } // A Encoder turns a position into a signal. +// For more information, see the [encoder component docs]. // // Position example: // @@ -84,6 +88,8 @@ func (t PositionType) String() string { // // // Get whether the encoder returns position in ticks or degrees. // properties, err := myEncoder.Properties(context.Background(), nil) +// +// [encoder component docs]: https://docs.viam.com/components/encoder/ type Encoder interface { resource.Resource diff --git a/components/gantry/gantry.go b/components/gantry/gantry.go index dc0a124f3b6..5d3e1a8ba29 100644 --- a/components/gantry/gantry.go +++ b/components/gantry/gantry.go @@ -1,3 +1,7 @@ +// Package gantry defines a robotic gantry with one or multiple axes. +// For more information, see the [gantry component docs]. +// +// [gantry component docs]: https://docs.viam.com/components/gantry/ package gantry import ( @@ -41,6 +45,7 @@ func Named(name string) resource.Name { } // Gantry is used for controlling gantries of N axis. +// For more information, see the [gantry component docs]. // // Position example: // @@ -74,6 +79,8 @@ func Named(name string) resource.Name { // myGantry, err := gantry.FromRobot(machine, "my_gantry") // // myGantry.Home(context.Background(), nil) +// +// [gantry component docs]: https://docs.viam.com/components/gantry/ type Gantry interface { resource.Resource resource.Actuator diff --git a/components/generic/generic.go b/components/generic/generic.go index e19bffff5a9..218b6fe5158 100644 --- a/components/generic/generic.go +++ b/components/generic/generic.go @@ -1,4 +1,7 @@ -// Package generic defines an abstract generic device and DoCommand() method +// Package generic defines an abstract generic device and DoCommand() method. +// For more information, see the [generic component docs]. +// +// [generic component docs]: https://docs.viam.com/components/generic/ package generic import ( diff --git a/components/gripper/gripper.go b/components/gripper/gripper.go index b34e6c0d66c..379e5186bdb 100644 --- a/components/gripper/gripper.go +++ b/components/gripper/gripper.go @@ -1,4 +1,7 @@ // Package gripper defines a robotic gripper. +// For more information, see the [gripper component docs]. +// +// [gripper component docs]: https://docs.viam.com/components/gripper/ package gripper import ( @@ -34,6 +37,7 @@ func Named(name string) resource.Name { } // A Gripper represents a physical robotic gripper. +// For more information, see the [gripper component docs]. // // Open example: // @@ -44,6 +48,8 @@ func Named(name string) resource.Name { // // // Grab with the gripper. // grabbed, err := myGripper.Grab(context.Background(), nil) +// +// [gripper component docs]: https://docs.viam.com/components/gripper/ type Gripper interface { resource.Resource resource.Shaped