Skip to content

Commit

Permalink
DOCS-3353: Add backlinks part 3 (#4705)
Browse files Browse the repository at this point in the history
Co-authored-by: JessamyT <[email protected]>
  • Loading branch information
sguequierre and JessamyT authored Jan 14, 2025
1 parent 1c994c8 commit 89f7a29
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 5 deletions.
26 changes: 25 additions & 1 deletion components/movementsensor/movementsensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,15 @@ func Named(name string) resource.Name {
// // Get the current position of the movement sensor above sea level in meters.
// position, altitude, err := myMovementSensor.Position(context.Background(), nil)
//
// For more information, see the [Position method docs].
//
// LinearVelocity example:
//
// // Get the current linear velocity of the movement sensor.
// linVel, err := myMovementSensor.LinearVelocity(context.Background(), nil)
//
// For more information, see the [LinearVelocity method docs].
//
// AngularVelocity example:
//
// // Get the current angular velocity of the movement sensor.
Expand All @@ -88,16 +92,22 @@ func Named(name string) resource.Name {
// // Get the y component of angular velocity.
// yAngVel := angVel.Y
//
// For more information, see the [AngularVelocity method docs].
//
// LinearAcceleration example:
//
// // Get the current linear acceleration of the movement sensor.
// linAcc, err := myMovementSensor.LinearAcceleration(context.Background(), nil)
//
// For more information, see the [LinearAcceleration method docs].
//
// CompassHeading example:
//
// // Get the current compass heading of the movement sensor.
// heading, err := myMovementSensor.CompassHeading(context.Background(), nil)
//
// For more information, see the [CompassHeading method docs].
//
// Orientation example:
//
// // Get the current orientation of the movement sensor.
Expand All @@ -112,17 +122,31 @@ func Named(name string) resource.Name {
// logger.Info("The z component of the orientation vector: ", orientation.OZ)
// logger.Info("The number of degrees that the movement sensor is rotated about the vector: ", orientation.Theta)
//
// For more information, see the [Orientation method docs].
//
// Properties example:
//
// // Get the supported properties of the movement sensor.
// properties, err := myMovementSensor.Properties(context.Background(), nil)
//
// For more information, see the [Properties method docs].
//
// Accuracy example:
//
// // Get the accuracy of the movement sensor.
// accuracy, err := myMovementSensor.Accuracy(context.Background(), nil)
//
// [movement sensor component docs]: https://docs.viam.com/components/movement-sensor/
// For more information, see the [Accuracy method docs].
//
// [movement sensor component docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/
// [Position method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getposition
// [LinearVelocity method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearvelocity
// [AngularVelocity method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getangularvelocity
// [LinearAcceleration method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearacceleration
// [CompassHeading method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getcompassheading
// [Orientation method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getorientation
// [Properties method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getproperties
// [Accuracy method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getaccuracy
type MovementSensor interface {
resource.Sensor
resource.Resource
Expand Down
11 changes: 10 additions & 1 deletion components/powersensor/powersensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,26 @@ func Named(name string) resource.Name {
// // Get the voltage from device in volts.
// voltage, isAC, err := myPowerSensor.Voltage(context.Background(), nil)
//
// For more information, see the [Voltage method docs].
//
// Current example:
//
// // Get the current reading from device in amps.
// current, isAC, err := myPowerSensor.Current(context.Background(), nil)
//
// For more information, see the [Current method docs].
//
// Power example:
//
// // Get the power measurement from device in watts.
// power, err := myPowerSensor.Power(context.Background(), nil)
//
// [power sensor component docs]: https://docs.viam.com/components/power-sensor/
// For more information, see the [Power method docs].
//
// [power sensor component docs]: https://docs.viam.com/dev/reference/apis/components/power-sensor/
// [Voltage method docs]: https://docs.viam.com/dev/reference/apis/components/power-sensor/#getvoltage
// [Current method docs]: https://docs.viam.com/dev/reference/apis/components/power-sensor/#getcurrent
// [Power method docs]: https://docs.viam.com/dev/reference/apis/components/power-sensor/#getpower
type PowerSensor interface {
resource.Sensor
resource.Resource
Expand Down
2 changes: 1 addition & 1 deletion components/sensor/sensor.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Package sensor defines an abstract sensing device that can provide measurement readings.
// For more information, see the [sensor component docs].
//
// [sensor component docs]: https://docs.viam.com/components/sensor/
// [sensor component docs]: https://docs.viam.com/dev/reference/apis/components/sensor/
package sensor

import (
Expand Down
8 changes: 7 additions & 1 deletion components/servo/servo.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ var API = resource.APINamespaceRDK.WithComponentType(SubtypeName)
// // Move the servo from its origin to the desired angle of 30 degrees.
// myServoComponent.Move(context.Background(), 30, nil)
//
// For more information, see the [Move method docs].
//
// Position example:
//
// // Get the current set angle of the servo.
Expand All @@ -55,7 +57,11 @@ var API = resource.APINamespaceRDK.WithComponentType(SubtypeName)
// logger.Info("Position 1: ", pos1)
// logger.Info("Position 2: ", pos2)
//
// [servo component docs]: https://docs.viam.com/components/servo/
// For more information, see the [Position method docs].
//
// [servo component docs]: https://docs.viam.com/dev/reference/apis/components/servo/
// [Move method docs]: https://docs.viam.com/dev/reference/apis/components/servo/#move
// [Position method docs]: https://docs.viam.com/dev/reference/apis/components/servo/#getposition
type Servo interface {
resource.Resource
resource.Actuator
Expand Down
5 changes: 4 additions & 1 deletion resource/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ func ContainsReservedCharacter(val string) error {
// // Get the readings provided by the sensor.
// readings, err := mySensor.Readings(context.Background(), nil)
//
// [sensor component docs]: https://docs.viam.com/components/sensor/
// For more information, see the [Readings method docs].
//
// [sensor component docs]: https://docs.viam.com/dev/reference/apis/components/sensor/
// [Readings method docs]: https://docs.viam.com/dev/reference/apis/components/sensor/#getreadings
type Sensor interface {
// Readings return data specific to the type of sensor and can be of any type.
Readings(ctx context.Context, extra map[string]interface{}) (map[string]interface{}, error)
Expand Down

0 comments on commit 89f7a29

Please sign in to comment.