Skip to content

Commit 89f7a29

Browse files
DOCS-3353: Add backlinks part 3 (viamrobotics#4705)
Co-authored-by: JessamyT <[email protected]>
1 parent 1c994c8 commit 89f7a29

File tree

5 files changed

+47
-5
lines changed

5 files changed

+47
-5
lines changed

components/movementsensor/movementsensor.go

+25-1
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,15 @@ func Named(name string) resource.Name {
7575
// // Get the current position of the movement sensor above sea level in meters.
7676
// position, altitude, err := myMovementSensor.Position(context.Background(), nil)
7777
//
78+
// For more information, see the [Position method docs].
79+
//
7880
// LinearVelocity example:
7981
//
8082
// // Get the current linear velocity of the movement sensor.
8183
// linVel, err := myMovementSensor.LinearVelocity(context.Background(), nil)
8284
//
85+
// For more information, see the [LinearVelocity method docs].
86+
//
8387
// AngularVelocity example:
8488
//
8589
// // Get the current angular velocity of the movement sensor.
@@ -88,16 +92,22 @@ func Named(name string) resource.Name {
8892
// // Get the y component of angular velocity.
8993
// yAngVel := angVel.Y
9094
//
95+
// For more information, see the [AngularVelocity method docs].
96+
//
9197
// LinearAcceleration example:
9298
//
9399
// // Get the current linear acceleration of the movement sensor.
94100
// linAcc, err := myMovementSensor.LinearAcceleration(context.Background(), nil)
95101
//
102+
// For more information, see the [LinearAcceleration method docs].
103+
//
96104
// CompassHeading example:
97105
//
98106
// // Get the current compass heading of the movement sensor.
99107
// heading, err := myMovementSensor.CompassHeading(context.Background(), nil)
100108
//
109+
// For more information, see the [CompassHeading method docs].
110+
//
101111
// Orientation example:
102112
//
103113
// // Get the current orientation of the movement sensor.
@@ -112,17 +122,31 @@ func Named(name string) resource.Name {
112122
// logger.Info("The z component of the orientation vector: ", orientation.OZ)
113123
// logger.Info("The number of degrees that the movement sensor is rotated about the vector: ", orientation.Theta)
114124
//
125+
// For more information, see the [Orientation method docs].
126+
//
115127
// Properties example:
116128
//
117129
// // Get the supported properties of the movement sensor.
118130
// properties, err := myMovementSensor.Properties(context.Background(), nil)
119131
//
132+
// For more information, see the [Properties method docs].
133+
//
120134
// Accuracy example:
121135
//
122136
// // Get the accuracy of the movement sensor.
123137
// accuracy, err := myMovementSensor.Accuracy(context.Background(), nil)
124138
//
125-
// [movement sensor component docs]: https://docs.viam.com/components/movement-sensor/
139+
// For more information, see the [Accuracy method docs].
140+
//
141+
// [movement sensor component docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/
142+
// [Position method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getposition
143+
// [LinearVelocity method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearvelocity
144+
// [AngularVelocity method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getangularvelocity
145+
// [LinearAcceleration method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearacceleration
146+
// [CompassHeading method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getcompassheading
147+
// [Orientation method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getorientation
148+
// [Properties method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getproperties
149+
// [Accuracy method docs]: https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getaccuracy
126150
type MovementSensor interface {
127151
resource.Sensor
128152
resource.Resource

components/powersensor/powersensor.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,26 @@ func Named(name string) resource.Name {
5858
// // Get the voltage from device in volts.
5959
// voltage, isAC, err := myPowerSensor.Voltage(context.Background(), nil)
6060
//
61+
// For more information, see the [Voltage method docs].
62+
//
6163
// Current example:
6264
//
6365
// // Get the current reading from device in amps.
6466
// current, isAC, err := myPowerSensor.Current(context.Background(), nil)
6567
//
68+
// For more information, see the [Current method docs].
69+
//
6670
// Power example:
6771
//
6872
// // Get the power measurement from device in watts.
6973
// power, err := myPowerSensor.Power(context.Background(), nil)
7074
//
71-
// [power sensor component docs]: https://docs.viam.com/components/power-sensor/
75+
// For more information, see the [Power method docs].
76+
//
77+
// [power sensor component docs]: https://docs.viam.com/dev/reference/apis/components/power-sensor/
78+
// [Voltage method docs]: https://docs.viam.com/dev/reference/apis/components/power-sensor/#getvoltage
79+
// [Current method docs]: https://docs.viam.com/dev/reference/apis/components/power-sensor/#getcurrent
80+
// [Power method docs]: https://docs.viam.com/dev/reference/apis/components/power-sensor/#getpower
7281
type PowerSensor interface {
7382
resource.Sensor
7483
resource.Resource

components/sensor/sensor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Package sensor defines an abstract sensing device that can provide measurement readings.
22
// For more information, see the [sensor component docs].
33
//
4-
// [sensor component docs]: https://docs.viam.com/components/sensor/
4+
// [sensor component docs]: https://docs.viam.com/dev/reference/apis/components/sensor/
55
package sensor
66

77
import (

components/servo/servo.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ var API = resource.APINamespaceRDK.WithComponentType(SubtypeName)
4141
// // Move the servo from its origin to the desired angle of 30 degrees.
4242
// myServoComponent.Move(context.Background(), 30, nil)
4343
//
44+
// For more information, see the [Move method docs].
45+
//
4446
// Position example:
4547
//
4648
// // Get the current set angle of the servo.
@@ -55,7 +57,11 @@ var API = resource.APINamespaceRDK.WithComponentType(SubtypeName)
5557
// logger.Info("Position 1: ", pos1)
5658
// logger.Info("Position 2: ", pos2)
5759
//
58-
// [servo component docs]: https://docs.viam.com/components/servo/
60+
// For more information, see the [Position method docs].
61+
//
62+
// [servo component docs]: https://docs.viam.com/dev/reference/apis/components/servo/
63+
// [Move method docs]: https://docs.viam.com/dev/reference/apis/components/servo/#move
64+
// [Position method docs]: https://docs.viam.com/dev/reference/apis/components/servo/#getposition
5965
type Servo interface {
6066
resource.Resource
6167
resource.Actuator

resource/resource.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ func ContainsReservedCharacter(val string) error {
158158
// // Get the readings provided by the sensor.
159159
// readings, err := mySensor.Readings(context.Background(), nil)
160160
//
161-
// [sensor component docs]: https://docs.viam.com/components/sensor/
161+
// For more information, see the [Readings method docs].
162+
//
163+
// [sensor component docs]: https://docs.viam.com/dev/reference/apis/components/sensor/
164+
// [Readings method docs]: https://docs.viam.com/dev/reference/apis/components/sensor/#getreadings
162165
type Sensor interface {
163166
// Readings return data specific to the type of sensor and can be of any type.
164167
Readings(ctx context.Context, extra map[string]interface{}) (map[string]interface{}, error)

0 commit comments

Comments
 (0)