diff --git a/components/encoder/encoder.go b/components/encoder/encoder.go index 95d5434b1db..a75e1a07c32 100644 --- a/components/encoder/encoder.go +++ b/components/encoder/encoder.go @@ -73,6 +73,8 @@ func (t PositionType) String() string { // // Get the position of the encoder in ticks // position, posType, err := myEncoder.Position(context.Background(), encoder.PositionTypeTicks, nil) // +// For more information, see the [Position method docs]. +// // ResetPosition example: // // myEncoder, err := encoder.FromRobot(machine, "my_encoder") @@ -82,6 +84,8 @@ func (t PositionType) String() string { // // err = myEncoder.ResetPosition(context.Background(), nil) // +// For more information, see the [ResetPosition method docs]. +// // Properties example: // // myEncoder, err := encoder.FromRobot(machine, "my_encoder") @@ -89,7 +93,12 @@ 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/ +// For more information, see the [Properties methods docs]. +// +// [encoder component docs]: https://docs.viam.com/dev/reference/apis/components/encoder/ +// [Position method docs]: https://docs.viam.com/dev/reference/apis/components/encoder/#getposition +// [ResetPosition method docs]: https://docs.viam.com/dev/reference/apis/components/encoder/#resetposition +// [Properties methods docs]: https://docs.viam.com/dev/reference/apis/components/encoder/#getproperties type Encoder interface { resource.Resource diff --git a/components/gantry/gantry.go b/components/gantry/gantry.go index e3af187f363..d29276adcc6 100644 --- a/components/gantry/gantry.go +++ b/components/gantry/gantry.go @@ -54,6 +54,8 @@ func Named(name string) resource.Name { // // Get the current positions of the axes of the gantry in millimeters. // position, err := myGantry.Position(context.Background(), nil) // +// For more information, see the [Position method docs]. +// // MoveToPosition example: // // myGantry, err := gantry.FromRobot(machine, "my_gantry") @@ -67,6 +69,8 @@ func Named(name string) resource.Name { // // Move the axes of the gantry to the positions specified. // myGantry.MoveToPosition(context.Background(), examplePositions, exampleSpeeds, nil) // +// For more information, see the [MoveToPosition method docs]. +// // Lengths example: // // myGantry, err := gantry.FromRobot(machine, "my_gantry") @@ -74,13 +78,21 @@ func Named(name string) resource.Name { // // Get the lengths of the axes of the gantry in millimeters. // lengths_mm, err := myGantry.Lengths(context.Background(), nil) // +// For more information, see the [Lengths method docs]. +// // Home example: // // myGantry, err := gantry.FromRobot(machine, "my_gantry") // // myGantry.Home(context.Background(), nil) // -// [gantry component docs]: https://docs.viam.com/components/gantry/ +// For more information, see the [Home method docs]. +// +// [gantry component docs]: https://docs.viam.com/dev/reference/apis/components/gantry/ +// [Position method docs]: https://docs.viam.com/dev/reference/apis/components/gantry/#getposition +// [MoveToPosition method docs]: https://docs.viam.com/dev/reference/apis/components/gantry/#movetoposition +// [Lengths method docs]: https://docs.viam.com/dev/reference/apis/components/gantry/#getlengths +// [Home method docs]: https://docs.viam.com/dev/reference/apis/components/gantry/#home type Gantry interface { resource.Resource resource.Actuator diff --git a/components/gripper/gripper.go b/components/gripper/gripper.go index f938de73cad..d2e8450c2fd 100644 --- a/components/gripper/gripper.go +++ b/components/gripper/gripper.go @@ -44,6 +44,8 @@ func Named(name string) resource.Name { // // Open the gripper. // err := myGripper.Open(context.Background(), nil) // +// For more information, see the [Open method docs]. +// // Grab example: // // myGripper, err := gripper.FromRobot(machine, "my_gripper") @@ -51,7 +53,11 @@ 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/ +// For more information, see the [Grab method docs]. +// +// [gripper component docs]: https://docs.viam.com/dev/reference/apis/components/gripper/ +// [Open method docs]: https://docs.viam.com/dev/reference/apis/components/gripper/#open +// [Grab method docs]: https://docs.viam.com/dev/reference/apis/components/gripper/#grab type Gripper interface { resource.Resource resource.Shaped diff --git a/components/input/input.go b/components/input/input.go index 7069edf696b..f9e7c46a0ec 100644 --- a/components/input/input.go +++ b/components/input/input.go @@ -45,6 +45,8 @@ func Named(name string) resource.Name { // // Get the list of Controls provided by the controller. // controls, err := myController.Controls(context.Background(), nil) // +// For more information, see the [Controls method docs]. +// // Events example: // // myController, err := input.FromRobot(machine, "my_input_controller") @@ -52,6 +54,8 @@ func Named(name string) resource.Name { // // Get the most recent Event for each Control. // recent_events, err := myController.Events(context.Background(), nil) // +// For more information, see the [Events method docs]. +// // RegisterControlCallback example: // // // Define a function to handle pressing the Start Menu button, "ButtonStart", on your controller and logging the start time @@ -75,7 +79,12 @@ func Named(name string) resource.Name { // // myController.RegisterControlCallback(context.Background(), input.ButtonStart, triggers, printStartTime, nil) // -// [input controller component docs]: https://docs.viam.com/components/input-controller/ +// For more information, see the [RegisterControlCallback method docs]. +// +// [input controller component docs]: https://docs.viam.com/dev/reference/apis/components/input-controller/ +// [Controls method docs]: https://docs.viam.com/dev/reference/apis/components/input-controller/#getcontrols +// [Events method docs]: https://docs.viam.com/dev/reference/apis/components/input-controller/#getevents +// [RegisterControlCallback method docs]: https://docs.viam.com/dev/reference/apis/components/input-controller/#registercontrolcallback type Controller interface { resource.Resource diff --git a/components/motor/motor.go b/components/motor/motor.go index 5677ee63c28..32344c01b67 100644 --- a/components/motor/motor.go +++ b/components/motor/motor.go @@ -48,27 +48,37 @@ var API = resource.APINamespaceRDK.WithComponentType(SubtypeName) // // Set the motor power to 40% forwards. // myMotorComponent.SetPower(context.Background(), 0.4, nil) // +// For more information, see the [SetPower method docs]. +// // GoFor example: // // myMotorComponent, err := motor.FromRobot(machine, "my_motor") // // Turn the motor 7.2 revolutions at 60 RPM. // myMotorComponent.GoFor(context.Background(), 60, 7.2, nil) // +// For more information, see the [GoFor method docs]. +// // GoTo example: // // // Turn the motor to 8.3 revolutions from home at 75 RPM. // myMotorComponent.GoTo(context.Background(), 75, 8.3, nil) // +// For more information, see the [GoTo method docs]. +// // SetRPM example: // // // Set the motor's RPM to 50 // myMotorComponent.SetRPM(context.Background(), 50, nil) // +// For more information, see the [SetRPM method docs]. +// // ResetZeroPosition example: // // // Set the current position as the new home position with no offset. // myMotorComponent.ResetZeroPosition(context.Background(), 0.0, nil) // +// For more information, see the [ResetZeroPosition method docs]. +// // Position example: // // // Get the current position of an encoded motor. @@ -78,6 +88,8 @@ var API = resource.APINamespaceRDK.WithComponentType(SubtypeName) // logger.Info("Position:") // logger.Info(position) // +// For more information, see the [Position method docs]. +// // Properties example: // // // Return whether or not the motor supports certain optional features. @@ -87,6 +99,8 @@ var API = resource.APINamespaceRDK.WithComponentType(SubtypeName) // logger.Info("Properties:") // logger.Info(properties) // +// For more information, see the [Properties method docs]. +// // IsPowered example: // // // Check whether the motor is currently running. @@ -97,7 +111,17 @@ var API = resource.APINamespaceRDK.WithComponentType(SubtypeName) // logger.Info("Power percent:") // logger.Info(pct) // -// [motor component docs]: https://docs.viam.com/components/motor/ +// For more information, see the [IsPowered method docs]. +// +// [motor component docs]: https://docs.viam.com/dev/reference/apis/components/motor/ +// [SetPower method docs]: https://docs.viam.com/dev/reference/apis/components/motor/#setpower +// [GoFor method docs]: https://docs.viam.com/dev/reference/apis/components/motor/#gofor +// [GoTo method docs]: https://docs.viam.com/dev/reference/apis/components/motor/#goto +// [SetRPM method docs]: https://docs.viam.com/dev/reference/apis/components/motor/#setrpm +// [ResetZeroPosition method docs]: https://docs.viam.com/dev/reference/apis/components/motor/#resetzeroposition +// [Position method docs]: https://docs.viam.com/dev/reference/apis/components/motor/#getposition +// [Properties method docs]: https://docs.viam.com/dev/reference/apis/components/motor/#getproperties +// [IsPowered method docs]: https://docs.viam.com/dev/reference/apis/components/motor/#ispowered type Motor interface { resource.Resource resource.Actuator