From 98ea2d6eb538d76eb137cdfbd677bb6cee135242 Mon Sep 17 00:00:00 2001 From: JessamyT <75634662+JessamyT@users.noreply.github.com> Date: Wed, 15 Jan 2025 09:48:16 -0800 Subject: [PATCH] DOCS-3351: Update Flutter SDK links (#326) --- lib/src/components/arm/arm.dart | 26 ++++++++----- lib/src/components/base/base.dart | 28 +++++++++----- lib/src/components/board/board.dart | 38 +++++++++++-------- lib/src/components/camera/camera.dart | 20 +++++++--- lib/src/components/gantry/gantry.dart | 26 ++++++++----- lib/src/components/generic/generic.dart | 14 +++++-- lib/src/components/gripper/gripper.dart | 22 +++++++---- lib/src/components/motor/motor.dart | 30 ++++++++------- .../movement_sensor/movement_sensor.dart | 32 ++++++++++------ .../components/power_sensor/power_sensor.dart | 22 +++++++---- lib/src/components/sensor/sensor.dart | 16 ++++++-- lib/src/components/servo/servo.dart | 19 ++++++---- 12 files changed, 190 insertions(+), 103 deletions(-) diff --git a/lib/src/components/arm/arm.dart b/lib/src/components/arm/arm.dart index 2789e9de645..14df0f2f8bd 100644 --- a/lib/src/components/arm/arm.dart +++ b/lib/src/components/arm/arm.dart @@ -5,7 +5,7 @@ import '../../robot/client.dart'; /// {@category Components} /// Arm represents a physical robot arm that exists in three-dimensional space. /// -/// For more information, see [Arm component](https://docs.viam.com/components/arm/). +/// For more information, see [Arm component](https://docs.viam.com/dev/reference/apis/components/arm/). abstract class Arm extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'arm'); @@ -15,7 +15,7 @@ abstract class Arm extends Resource { /// final currentPose = await myArm.endPosition(); /// ``` /// - /// For more information, see [Arm component](https://docs.viam.com/components/arm/). + /// For more information, see [Arm component](https://docs.viam.com/dev/reference/apis/components/arm/#getendposition). Future endPosition({Map? extra}); /// Move the end of the arm to the [Pose] specified. @@ -28,7 +28,7 @@ abstract class Arm extends Resource { /// await myArm.moveToPosition(targetPose); /// ``` /// - /// For more information, see [Arm component](https://docs.viam.com/components/arm/). + /// For more information, see [Arm component](https://docs.viam.com/dev/reference/apis/components/arm/#movetoposition). Future moveToPosition(Pose pose, {Map? extra}); /// Move each joint on the arm to the corresponding position specified in [positions]. @@ -41,7 +41,7 @@ abstract class Arm extends Resource { /// await myArm.moveToJointPositions(targetPositions); /// ``` /// - /// For more information, see [Arm component](https://docs.viam.com/components/arm/). + /// For more information, see [Arm component](https://docs.viam.com/dev/reference/apis/components/arm/#movetojointpositions). Future moveToJointPositions(List positions, {Map? extra}); /// Get the [List] of current joint angles of each arm joint @@ -50,7 +50,7 @@ abstract class Arm extends Resource { /// List currentJointPositions = await myArm.moveToJointPosition(); /// ``` /// - /// For more information, see [Arm component](https://docs.viam.com/components/arm/). + /// For more information, see [Arm component](https://docs.viam.com/dev/reference/apis/components/arm/#getjointpositions). Future> jointPositions({Map? extra}); /// Stop all motion of the arm. It is assumed that the arm stops immediately. @@ -59,7 +59,7 @@ abstract class Arm extends Resource { /// await myArm.stop(); /// ``` /// - /// For more information, see [Arm component](https://docs.viam.com/components/arm/). + /// For more information, see [Arm component](https://docs.viam.com/dev/reference/apis/components/arm/#stop). Future stop({Map? extra}); /// Whether the arm is currently moving @@ -68,19 +68,27 @@ abstract class Arm extends Resource { /// bool isArmMoving = await myArm.isMoving(); /// ``` /// - /// For more information, see [Arm component](https://docs.viam.com/components/arm/). + /// For more information, see [Arm component](https://docs.viam.com/dev/reference/apis/components/arm/#ismoving). Future isMoving(); /// Get the [ResourceName] for this [Arm] with the given [name]. /// - /// For more information, see [Arm component](https://docs.viam.com/components/arm/). + /// ``` + /// final myArmResourceName = myArm.getResourceName("my_arm"); + /// ``` + /// + /// For more information, see [Arm component](https://docs.viam.com/dev/reference/apis/components/arm/#getresourcename). static ResourceName getResourceName(String name) { return Arm.subtype.getResourceName(name); } /// Get the [Arm] named [name] from the provided robot. /// - /// For more information, see [Arm component](https://docs.viam.com/components/arm/). + /// ``` + /// final myArm = Arm.fromRobot(myRobotClient, "my_arm"); + /// ``` + /// + /// For more information, see [Arm component](https://docs.viam.com/dev/reference/apis/components/arm/). static Arm fromRobot(RobotClient robot, String name) { return robot.getResource(Arm.getResourceName(name)); } diff --git a/lib/src/components/base/base.dart b/lib/src/components/base/base.dart index 5da84d37a0e..149b273b2c3 100644 --- a/lib/src/components/base/base.dart +++ b/lib/src/components/base/base.dart @@ -9,7 +9,7 @@ typedef BaseProperties = GetPropertiesResponse; /// {@category Components} /// Base represents a physical base of a robot. /// -/// For more information, see [Base component](https://docs.viam.com/components/base/). +/// For more information, see [Base component](https://docs.viam.com/dev/reference/apis/components/base/). abstract class Base extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'base'); @@ -24,7 +24,7 @@ abstract class Base extends Resource { /// await myBase.moveStraight(40, 90); /// ``` /// - /// For more information, see [Base component](https://docs.viam.com/components/base/). + /// For more information, see [Base component](https://docs.viam.com/dev/reference/apis/components/base/#movestraight). Future moveStraight(int distance, double velocity, {Map? extra}); /// Spin the [Base] in place [angle] degrees, at the given angular [velocity], expressed in degrees per second. @@ -37,7 +37,7 @@ abstract class Base extends Resource { /// await myBase.spin(10, 15); /// ``` /// - /// For more information, see [Base component](https://docs.viam.com/components/base/). + /// For more information, see [Base component](https://docs.viam.com/dev/reference/apis/components/base/#spin). Future spin(double angle, double velocity, {Map? extra}); /// Set the linear and angular velocity of the [Base]. @@ -63,7 +63,7 @@ abstract class Base extends Resource { /// await myBase.setPower(Vector3(), Vector3(0, 0, -0.6)); /// ``` /// - /// For more information, see [Base component](https://docs.viam.com/components/base/). + /// For more information, see [Base component](https://docs.viam.com/dev/reference/apis/components/base/#setpower). Future setPower(Vector3 linear, Vector3 angular, {Map? extra}); /// Set the linear and angular velocities of the base, expressed as @@ -76,7 +76,7 @@ abstract class Base extends Resource { /// await myBase.setVelocity(Vector3(0, 50, 0), Vector3(0, 0, 15)); /// ``` /// - /// For more information, see [Base component](https://docs.viam.com/components/base/). + /// For more information, see [Base component](https://docs.viam.com/dev/reference/apis/components/base/#setvelocity). Future setVelocity(Vector3 linear, Vector3 angular, {Map? extra}); /// Stop the base. @@ -85,7 +85,7 @@ abstract class Base extends Resource { /// await myBase.stop(); /// ``` /// - /// For more information, see [Base component](https://docs.viam.com/components/base/). + /// For more information, see [Base component](https://docs.viam.com/dev/reference/apis/components/base/#stop). Future stop({Map? extra}); /// Whether the base is currently moving @@ -94,12 +94,12 @@ abstract class Base extends Resource { /// bool baseIsMoving = await myBase.isMoving(); /// ``` /// - /// For more information, see [Base component](https://docs.viam.com/components/base/). + /// For more information, see [Base component](https://docs.viam.com/dev/reference/apis/components/base/#ismoving). Future isMoving(); /// Get the [ResourceName] for this [Base] with the given [name] /// - /// For more information, see [Base component](https://docs.viam.com/components/base/). + /// For more information, see [Base component](https://docs.viam.com/dev/reference/apis/components/base/#getresourcename). static ResourceName getResourceName(String name) { return Base.subtype.getResourceName(name); } @@ -107,12 +107,20 @@ abstract class Base extends Resource { /// Report a dictionary mapping optional properties to /// whether it is supported by this base. /// - /// For more information, see [Base component](https://docs.viam.com/components/base/). + /// ``` + /// final myBaseResourceName = myBase.getResourceName("my_base"); + /// ``` + /// + /// For more information, see [Base component](https://docs.viam.com/dev/reference/apis/components/base/#getproperties). Future properties({Map? extra}); /// Get the [Base] named [name] from the provided robot. /// - /// For more information, see [Base component](https://docs.viam.com/components/base/). + /// ``` + /// final myBase = Base.fromRobot(myRobotClient, "my_base"); + /// ``` + /// + /// For more information, see [Base component](https://docs.viam.com/dev/reference/apis/components/base/). static Base fromRobot(RobotClient robot, String name) { return robot.getResource(Base.getResourceName(name)); } diff --git a/lib/src/components/board/board.dart b/lib/src/components/board/board.dart index 4675146e8c8..939c13ce464 100644 --- a/lib/src/components/board/board.dart +++ b/lib/src/components/board/board.dart @@ -16,7 +16,7 @@ typedef AnalogValue = ReadAnalogReaderResponse; /// Board represents a physical general purpose compute board that contains various /// components such as analog readers, and digital interrupts. /// -/// For more information, see [Board component](https://docs.viam.com/components/board/). +/// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/). abstract class Board extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'board'); @@ -27,7 +27,7 @@ abstract class Board extends Resource { /// await myBoard.setGpioState('15', true); /// ``` /// - /// For more information, see [Board component](https://docs.viam.com/components/board/). + /// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/#setgpio). Future setGpioState(String pin, bool high, {Map? extra}); /// Get the high/low state of the given pin of a board. @@ -37,7 +37,7 @@ abstract class Board extends Resource { /// bool pinStateIsHigh = await myBoard.gpio('15'); /// ``` /// - /// For more information, see [Board component](https://docs.viam.com/components/board/). + /// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/#getgpio). Future gpio(String pin, {Map? extra}); /// Get the duty cycle of the given pin of a board. @@ -47,7 +47,7 @@ abstract class Board extends Resource { /// var dutyCycle = await myBoard.pwm('15'); /// ``` /// - /// For more information, see [Board component](https://docs.viam.com/components/board/). + /// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/#pwm). Future pwm(String pin, {Map? extra}); /// Set the duty cycle of the given pin of a board. @@ -57,7 +57,7 @@ abstract class Board extends Resource { /// await myBoard.setPwm('13', 0.6); /// ``` /// - /// For more information, see [Board component](https://docs.viam.com/components/board/). + /// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/#setpwm). Future setPwm(String pin, double dutyCyclePct, {Map? extra}); /// Get the PWM frequency of the given pin of a board. @@ -67,7 +67,7 @@ abstract class Board extends Resource { /// var frequency = await myBoard.pwmFrequency('11'); /// ``` /// - /// For more information, see [Board component](https://docs.viam.com/components/board/). + /// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/#pwmfrequency). Future pwmFrequency(String pin, {Map? extra}); /// Set the PWM frequency in hertz of the given pin of a board. @@ -77,7 +77,7 @@ abstract class Board extends Resource { /// await myBoard.setPwmFrequency('15', 1600); /// ``` /// - /// For more information, see [Board component](https://docs.viam.com/components/board/). + /// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/#setpwmfrequency). Future setPwmFrequency(String pin, int frequencyHz, {Map? extra}); /// Read the current value of an analog reader of a board. @@ -87,7 +87,7 @@ abstract class Board extends Resource { /// var analogVal = await myBoard.analogReaderValue('my_example_analog'); /// ``` /// - /// For more information, see [Board component](https://docs.viam.com/components/board/). + /// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/#readanalogreader). Future analogReaderValue(String analogReaderName, {Map? extra}); /// Return the current value of the interrupt which is based on the type of Interrupt. @@ -97,7 +97,7 @@ abstract class Board extends Resource { /// var interruptVal = await myBoard.digitalInterruptValue('my_example_digital_interrupt'); /// ``` /// - /// For more information, see [Board component](https://docs.viam.com/components/board/). + /// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/#getdigitalinterruptvalue). Future digitalInterruptValue(String digitalInterruptName, {Map? extra}); /// Stream digital interrupts ticks. @@ -108,7 +108,7 @@ abstract class Board extends Resource { /// Stream tickStream = await myBoard.streamTicks(interrupts); /// ``` /// - /// For more information, see [Board component](https://docs.viam.com/components/board/). + /// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/#streamticks). Stream streamTicks(List interrupts, {Map? extra}); /// Add a listener for the digital interrupts. @@ -120,7 +120,7 @@ abstract class Board extends Resource { /// await myBoard.addCallbacks(interrupts, tickQueue); /// ``` /// - /// For more information, see [Board component](https://docs.viam.com/components/board/). + /// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/). Future addCallbacks(List interrupts, Queue tickQueue, {Map? extra}); /// Set the board to the indicated power mode. @@ -132,7 +132,7 @@ abstract class Board extends Resource { /// await myBoard.setPowerMode(powerMode, 60, 0); /// ``` /// - /// For more information, see [Board component](https://docs.viam.com/components/board/). + /// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/#setpowermode). Future setPowerMode(PowerMode powerMode, int seconds, int nanos, {Map? extra}); /// Write analog value to pin. @@ -142,19 +142,27 @@ abstract class Board extends Resource { /// await myBoard.writeAnalog('11', 48); /// ``` /// - /// For more information, see [Board component](https://docs.viam.com/components/board/). + /// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/#writeanalog). Future writeAnalog(String pin, int value, {Map? extra}); /// Get the [ResourceName] for this [Board] with the given [name] /// - /// For more information, see [Board component](https://docs.viam.com/components/board/). + /// ``` + /// final myBoardResourceName = myBoard.getResourceName("my_board"); + /// ``` + /// + /// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/#getresourcename). static common.ResourceName getResourceName(String name) { return Board.subtype.getResourceName(name); } /// Get the [Board] named [name] from the provided robot. /// - /// For more information, see [Board component](https://docs.viam.com/components/board/). + /// ``` + /// final myBoard = Board.fromRobot(myRobotClient, "my_board"); + /// ``` + /// + /// For more information, see [Board component](https://docs.viam.com/dev/reference/apis/components/board/). static Board fromRobot(RobotClient robot, String name) { return robot.getResource(Board.getResourceName(name)); } diff --git a/lib/src/components/camera/camera.dart b/lib/src/components/camera/camera.dart index 99a9e2b0d0d..5d5c9ad2dc9 100644 --- a/lib/src/components/camera/camera.dart +++ b/lib/src/components/camera/camera.dart @@ -11,7 +11,7 @@ typedef CameraProperties = GetPropertiesResponse; /// {@category Components} /// Camera represents any physical hardware that can capture frames. /// -/// For more information, see [Camera component](https://docs.viam.com/components/camera/). +/// For more information, see [Camera component](https://docs.viam.com/dev/reference/apis/components/camera/). abstract class Camera extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'camera'); @@ -21,7 +21,7 @@ abstract class Camera extends Resource { /// var nextImage = await myCamera.image(); /// ``` /// - /// For more information, see [Camera component](https://docs.viam.com/components/camera/). + /// For more information, see [Camera component](https://docs.viam.com/dev/reference/apis/components/camera/#getimage). Future image({MimeType? mimeType, Map? extra}); /// Get the next point cloud from the camera. @@ -30,7 +30,7 @@ abstract class Camera extends Resource { /// var nextPointCloud = await myCamera.pointCloud(); /// ``` /// - /// For more information, see [Camera component](https://docs.viam.com/components/camera/). + /// For more information, see [Camera component](https://docs.viam.com/dev/reference/apis/components/camera/#getpointcloud). Future pointCloud({Map? extra}); /// Get the camera's intrinsic parameters and the camera's distortion parameters. @@ -39,19 +39,27 @@ abstract class Camera extends Resource { /// var cameraProperties = await myCamera.properties(); /// ``` /// - /// For more information, see [Camera component](https://docs.viam.com/components/camera/). + /// For more information, see [Camera component](https://docs.viam.com/dev/reference/apis/components/camera/#getproperties). Future properties(); /// Get the [ResourceName] for this [Camera] with the given [name] /// - /// For more information, see [Camera component](https://docs.viam.com/components/camera/). + /// ``` + /// final myCameraResourceName = myCamera.getResourceName("my_camera"); + /// ``` + /// + /// For more information, see [Camera component](https://docs.viam.com/dev/reference/apis/components/camera/#getresourcename). static ResourceName getResourceName(String name) { return Camera.subtype.getResourceName(name); } /// Get the [Camera] named [name] from the provided robot. /// - /// For more information, see [Camera component](https://docs.viam.com/components/camera/). + /// ``` + /// final myCamera = Camera.fromRobot(myRobotClient, "my_camera"); + /// ``` + /// + /// For more information, see [Camera component](https://docs.viam.com/dev/reference/apis/components/camera/). static Camera fromRobot(RobotClient robot, String name) { return robot.getResource(Camera.getResourceName(name)); } diff --git a/lib/src/components/gantry/gantry.dart b/lib/src/components/gantry/gantry.dart index 6b5f6672355..5817833a558 100644 --- a/lib/src/components/gantry/gantry.dart +++ b/lib/src/components/gantry/gantry.dart @@ -5,7 +5,7 @@ import '../../robot/client.dart'; /// {@category Components} /// Gantry represents a physical Gantry and can be used for controlling gantries of N axes. /// -/// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). +/// For more information, see [Gantry component](https://docs.viam.com/dev/reference/apis/components/gantry/). abstract class Gantry extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'gantry'); @@ -15,7 +15,7 @@ abstract class Gantry extends Resource { /// var position = await myGantry.position(); /// ``` /// - /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). + /// For more information, see [Gantry component](https://docs.viam.com/dev/reference/apis/components/gantry/#getposition). Future> position({Map? extra}); /// Move the gantry to a new position in millimeters at the requested speeds in millimeters/second. @@ -24,7 +24,7 @@ abstract class Gantry extends Resource { /// await myGantry.moveToPosition([0.0, 20.5], [15, 15]); /// ``` /// - /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). + /// For more information, see [Gantry component](https://docs.viam.com/dev/reference/apis/components/gantry/#movetoposition). Future moveToPosition(List positions, List speeds, {Map? extra}); /// Run the homing sequence and return true if completed successfully. @@ -33,7 +33,7 @@ abstract class Gantry extends Resource { /// var homed = await myGantry.home(); /// ``` /// - /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). + /// For more information, see [Gantry component](https://docs.viam.com/dev/reference/apis/components/gantry/#home). Future home({Map? extra}); /// Get the lengths of the axes of the gantry in millimeters. @@ -42,7 +42,7 @@ abstract class Gantry extends Resource { /// var lengths = await myGantry.lengths(); /// ``` /// - /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). + /// For more information, see [Gantry component](https://docs.viam.com/dev/reference/apis/components/gantry/#getlengths). Future> lengths({Map? extra}); /// Stop all motion of the [Gantry]. It is assumed the [Gantry] stops immediately. @@ -51,7 +51,7 @@ abstract class Gantry extends Resource { /// await myGantry.stop(); /// ``` /// - /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). + /// For more information, see [Gantry component](https://docs.viam.com/dev/reference/apis/components/gantry/#stop). Future stop({Map? extra}); /// Whether the [Gantry] is currently moving. @@ -60,19 +60,27 @@ abstract class Gantry extends Resource { /// var moving = await myGantry.isMoving(); /// ``` /// - /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). + /// For more information, see [Gantry component](https://docs.viam.com/dev/reference/apis/components/gantry/#ismoving). Future isMoving(); /// Get the [ResourceName] for this [Gantry] with the given [name] /// - /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). + /// ``` + /// final myGantryResourceName = myGantry.getResourceName("my_gantry"); + /// ``` + /// + /// For more information, see [Gantry component](https://docs.viam.com/dev/reference/apis/components/gantry/#getresourcename). static ResourceName getResourceName(String name) { return Gantry.subtype.getResourceName(name); } /// Get the [Gantry] named [name] from the provided robot. /// - /// For more information, see [Gantry component](https://docs.viam.com/components/gantry/). + /// ``` + /// final myGantry = Gantry.fromRobot(myRobotClient, "my_gantry"); + /// ``` + /// + /// For more information, see [Gantry component](https://docs.viam.com/dev/reference/apis/components/gantry/). static Gantry fromRobot(RobotClient robot, String name) { return robot.getResource(Gantry.getResourceName(name)); } diff --git a/lib/src/components/generic/generic.dart b/lib/src/components/generic/generic.dart index e97397aadb9..5a980c974c8 100644 --- a/lib/src/components/generic/generic.dart +++ b/lib/src/components/generic/generic.dart @@ -5,20 +5,28 @@ import '../../robot/client.dart'; /// {@category Components} /// Generic represents a generic component that executes doCommand. /// -/// For more information, see [Generic component](https://docs.viam.com/components/generic/). +/// For more information, see [Generic component](https://docs.viam.com/dev/reference/apis/components/generic/). abstract class Generic extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'generic'); /// Get the [ResourceName] for this [Generic] with the given [name] /// - /// For more information, see [Generic component](https://docs.viam.com/components/generic/). + /// ``` + /// final myGenericResourceName = myGeneric.getResourceName("my_generic"); + /// ``` + /// + /// For more information, see [Generic component](https://docs.viam.com/dev/reference/apis/components/generic/#getresourcename). static ResourceName getResourceName(String name) { return Generic.subtype.getResourceName(name); } /// Get the [Generic] named [name] from the provided robot. /// - /// For more information, see [Generic component](https://docs.viam.com/components/generic/). + /// ``` + /// final myGeneric = Generic.fromRobot(myRobotClient, "my_generic"); + /// ``` + /// + /// For more information, see [Generic component](https://docs.viam.com/dev/reference/apis/components/generic/). static Generic fromRobot(RobotClient robot, String name) { return robot.getResource(Generic.getResourceName(name)); } diff --git a/lib/src/components/gripper/gripper.dart b/lib/src/components/gripper/gripper.dart index 82bff40d0ca..29d23f3ba44 100644 --- a/lib/src/components/gripper/gripper.dart +++ b/lib/src/components/gripper/gripper.dart @@ -5,7 +5,7 @@ import '../../robot/client.dart'; /// {@category Components} /// Gripper represents a physical Gripper which can open and close. /// -/// For more information, see [Gripper component](https://docs.viam.com/components/gripper/). +/// For more information, see [Gripper component](https://docs.viam.com/dev/reference/apis/components/gripper/). abstract class Gripper extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'gripper'); @@ -15,7 +15,7 @@ abstract class Gripper extends Resource { /// await myGripper.open(); /// ``` /// - /// For more information, see [Gripper component](https://docs.viam.com/components/gripper/). + /// For more information, see [Gripper component](https://docs.viam.com/dev/reference/apis/components/gripper/#open). Future open({Map? extra}); /// Close the [Gripper] @@ -24,7 +24,7 @@ abstract class Gripper extends Resource { /// await myGripper.grab(); /// ``` /// - /// For more information, see [Gripper component](https://docs.viam.com/components/gripper/). + /// For more information, see [Gripper component](https://docs.viam.com/dev/reference/apis/components/gripper/#grab). Future grab({Map? extra}); /// Stop all motion of the [Gripper]. It is assumed the [Gripper] stops immediately. @@ -33,7 +33,7 @@ abstract class Gripper extends Resource { /// await myGripper.stop(); /// ``` /// - /// For more information, see [Gripper component](https://docs.viam.com/components/gripper/). + /// For more information, see [Gripper component](https://docs.viam.com/dev/reference/apis/components/gripper/#stop). Future stop({Map? extra}); /// Whether the [Gripper] is currently moving. @@ -42,19 +42,27 @@ abstract class Gripper extends Resource { /// var isItMoving = await myGripper.isMoving(); /// ``` /// - /// For more information, see [Gripper component](https://docs.viam.com/components/gripper/). + /// For more information, see [Gripper component](https://docs.viam.com/dev/reference/apis/components/gripper/#ismoving). Future isMoving(); /// Get the [ResourceName] for the [Gripper] with the given [name] /// - /// For more information, see [Gripper component](https://docs.viam.com/components/gripper/). + /// ``` + /// final myGripperResourceName = myGripper.getResourceName("my_gripper"); + /// ``` + /// + /// For more information, see [Gripper component](https://docs.viam.com/dev/reference/apis/components/gripper/#getresourcename). static ResourceName getResourceName(String name) { return Gripper.subtype.getResourceName(name); } /// Get the [Gripper] named [name] from the provided robot. /// - /// For more information, see [Gripper component](https://docs.viam.com/components/gripper/). + /// ``` + /// final myGripper = Gripper.fromRobot(myRobotClient, "my_gripper"); + /// ``` + /// + /// For more information, see [Gripper component](https://docs.viam.com/dev/reference/apis/components/gripper/). static Gripper fromRobot(RobotClient robot, String name) { return robot.getResource(Gripper.getResourceName(name)); } diff --git a/lib/src/components/motor/motor.dart b/lib/src/components/motor/motor.dart index 37842fff71a..037e1db8e00 100644 --- a/lib/src/components/motor/motor.dart +++ b/lib/src/components/motor/motor.dart @@ -21,7 +21,7 @@ class PowerState { /// {@category Components} /// Motor represents a physical motor. /// -/// For more information, see [Motor component](https://docs.viam.com/components/motor/). +/// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/). abstract class Motor extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'motor'); @@ -33,7 +33,7 @@ abstract class Motor extends Resource { /// await myMotor.setPower(0.4); /// ``` /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). + /// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/#setpower). Future setPower(double powerPct, {Map? extra}); /// Spin the [Motor] the specified number of [revolutions] at specified [rpm]. @@ -45,7 +45,7 @@ abstract class Motor extends Resource { /// await myMotor.goFor(60, 7.2); /// ``` /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). + /// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/#gofor). Future goFor(double rpm, double revolutions, {Map? extra}); /// Spin the [Motor] to the specified position (provided in revolutions from home/zero), @@ -58,7 +58,7 @@ abstract class Motor extends Resource { /// await myMotor.goTo(75, 8.3); /// ``` /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). + /// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/#goto). Future goTo(double rpm, double positionRevolutions, {Map? extra}); /// Spin the [Motor] indefinitely at the specified speed, in revolutions per minute. @@ -69,7 +69,7 @@ abstract class Motor extends Resource { /// await myMotor.setRPM(-120.5); /// ``` /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). + /// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/#setrpm). Future setRPM(double rpm, {Map? extra}); /// Set the current position (modified by [offset]) to be the new zero (home) position. @@ -79,7 +79,7 @@ abstract class Motor extends Resource { /// await myMotor.resetZeroPosition(0.0); /// ``` /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). + /// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/#resetzeroposition). Future resetZeroPosition(double offset, {Map? extra}); /// Report the position of the motor based on its encoder. @@ -91,7 +91,7 @@ abstract class Motor extends Resource { /// var position = await myMotor.position(); /// ``` /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). + /// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/#getposition). Future position({Map? extra}); /// Report a dictionary mapping each optional property to @@ -102,7 +102,7 @@ abstract class Motor extends Resource { /// var properties = await myMotor.properties(); /// ``` /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). + /// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/#getproperties). Future properties({Map? extra}); /// Stop the motor immediately, without any gradual step down. @@ -112,7 +112,7 @@ abstract class Motor extends Resource { /// await myMotor.stop(); /// ``` /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). + /// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/#stop). Future stop({Map? extra}); /// Returns whether or not the motor is currently powered, and the portion @@ -128,7 +128,7 @@ abstract class Motor extends Resource { /// var pct = powerState.powerPct; /// ``` /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). + /// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/#ispowered). Future powerState({Map? extra}); /// Get if the [Motor] is currently moving. @@ -138,7 +138,7 @@ abstract class Motor extends Resource { /// var moving = await myMotor.isMoving(); /// ``` /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). + /// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/#ismoving). Future isMoving({Map? extra}); /// Get the [ResourceName] for this [Motor] with the given [name]. @@ -147,14 +147,18 @@ abstract class Motor extends Resource { /// var name = Motor.getResourceName('myMotor'); /// ``` /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). + /// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/#getresourcename). static ResourceName getResourceName(String name) { return Motor.subtype.getResourceName(name); } /// Get the [Motor] named [name] from the provided robot. /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). + /// ``` + /// final myMotor = Motor.fromRobot(myRobotClient, "my_motor"); + /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/). static Motor fromRobot(RobotClient robot, String name) { return robot.getResource(Motor.getResourceName(name)); } diff --git a/lib/src/components/movement_sensor/movement_sensor.dart b/lib/src/components/movement_sensor/movement_sensor.dart index e5f37406f58..32b553dc3aa 100644 --- a/lib/src/components/movement_sensor/movement_sensor.dart +++ b/lib/src/components/movement_sensor/movement_sensor.dart @@ -20,7 +20,7 @@ typedef Accuracy = GetAccuracyResponse; /// {@category Components} /// MovementSensor reports information about the robot's direction, position and speed. /// -/// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). +/// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/). abstract class MovementSensor extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'movement_sensor'); @@ -32,7 +32,7 @@ abstract class MovementSensor extends Resource { /// var readings = await myMovementSensor.readings(); /// ``` /// - /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). + /// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getreadings). Future> readings({Map? extra}); /// Get the current [GeoPoint] (latitude, longitude) and altitude (mm). @@ -43,7 +43,7 @@ abstract class MovementSensor extends Resource { /// var coordinates = position.coordinates; /// ``` /// - /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). + /// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getposition). Future position({Map? extra}); /// Get the current linear velocity as a [Vector3] with x, y, and z axes represented in mm/sec. @@ -52,7 +52,7 @@ abstract class MovementSensor extends Resource { /// var linVel = await myMovementSensor.linearVelocity(); /// ``` /// - /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). + /// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearvelocity). Future linearVelocity({Map? extra}); /// Get the current angular velocity as a [Vector3] with @@ -62,7 +62,7 @@ abstract class MovementSensor extends Resource { /// var angVel = await myMovementSensor.angularVelocity(); /// ``` /// - /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). + /// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getangularvelocity). Future angularVelocity({Map? extra}); /// Get the current linear acceleration as a [Vector3] with @@ -72,7 +72,7 @@ abstract class MovementSensor extends Resource { /// var linAccel = await myMovementSensor.linearAcceleration(); /// ``` /// - /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). + /// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearacceleration). Future linearAcceleration({Map? extra}); /// Get the current compass heading in degrees. @@ -81,7 +81,7 @@ abstract class MovementSensor extends Resource { /// var compassHeading = await myMovementSensor.compassHeading(); /// ``` /// - /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). + /// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getcompassheading). Future compassHeading({Map? extra}); /// Get the current orientation as an [Orientation]. @@ -90,7 +90,7 @@ abstract class MovementSensor extends Resource { /// var orientation = await myMovementSensor.orientation(); /// ``` /// - /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). + /// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getorientation). Future orientation({Map? extra}); /// Get the supported properties of this sensor. @@ -99,7 +99,7 @@ abstract class MovementSensor extends Resource { /// var props = await myMovementSensor.properties(); /// ``` /// - /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). + /// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getproperties). Future properties({Map? extra}); /// Get the reliability metrics of the movement sensor, @@ -110,19 +110,27 @@ abstract class MovementSensor extends Resource { /// var accuracy = await myMovementSensor.accuracy(); /// ``` /// - /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). + /// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getaccuracy). Future accuracy({Map? extra}); /// Get the [ResourceName] for this [MovementSensor] with the given [name] /// - /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). + /// ``` + /// final myMovementSensorResourceName = myMovementSensor.getResourceName("my_movement_sensor"); + /// ``` + /// + /// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getresourcename). static ResourceName getResourceName(String name) { return MovementSensor.subtype.getResourceName(name); } /// Get the [MovementSensor] named [name] from the provided robot. /// - /// For more information, see [Movement Sensor component](https://docs.viam.com/components/movement-sensor/). + /// ``` + /// final myMovementSensor = MovementSensor.fromRobot(myRobotClient, "my_movement_sensor"); + /// ``` + /// + /// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/). static MovementSensor fromRobot(RobotClient robot, String name) { return robot.getResource(MovementSensor.getResourceName(name)); } diff --git a/lib/src/components/power_sensor/power_sensor.dart b/lib/src/components/power_sensor/power_sensor.dart index 85c54f0c923..2653a91cceb 100644 --- a/lib/src/components/power_sensor/power_sensor.dart +++ b/lib/src/components/power_sensor/power_sensor.dart @@ -12,7 +12,7 @@ typedef Current = GetCurrentResponse; /// {@category Components} /// PowerSensor reports information about voltage, current, and power. /// -/// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/). +/// For more information, see [Power Sensor component](https://docs.viam.com/dev/reference/apis/components/power-sensor/). abstract class PowerSensor extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'power_sensor'); @@ -24,7 +24,7 @@ abstract class PowerSensor extends Resource { /// var readings = await myPowerSensor.readings(); /// ``` /// - /// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/). + /// For more information, see [Power Sensor component](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getreadings). Future> readings({Map? extra}); /// Get the voltage in volts, and whether the power is @@ -36,7 +36,7 @@ abstract class PowerSensor extends Resource { /// bool isItAC = voltageObject.isAc; /// ``` /// - /// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/). + /// For more information, see [Power Sensor component](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getvoltage). Future voltage({Map? extra}); /// Get the current in amperes, and whether the current @@ -48,7 +48,7 @@ abstract class PowerSensor extends Resource { /// bool isItAC = currentObject.isAc; /// ``` /// - /// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/). + /// For more information, see [Power Sensor component](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getcurrent). Future current({Map? extra}); /// Get the power (watts) @@ -57,19 +57,27 @@ abstract class PowerSensor extends Resource { /// var power = await myPowerSensor.power(); /// ``` /// - /// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/). + /// For more information, see [Power Sensor component](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getpower). Future power({Map? extra}); /// Get the [ResourceName] for this [PowerSensor] with the given [name]. /// - /// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/). + /// ``` + /// final myPowerSensorResourceName = myPowerSensor.getResourceName("my_power_sensor"); + /// ``` + /// + /// For more information, see [Power Sensor component](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getresourcename). static ResourceName getResourceName(String name) { return PowerSensor.subtype.getResourceName(name); } /// Get the [PowerSensor] named [name] from the provided robot. /// - /// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/). + /// ``` + /// final myPowerSensor = PowerSensor.fromRobot(myRobotClient, "my_power_sensor"); + /// ``` + /// + /// For more information, see [Power Sensor component](https://docs.viam.com/dev/reference/apis/components/power-sensor/). static PowerSensor fromRobot(RobotClient robot, String name) { return robot.getResource(PowerSensor.getResourceName(name)); } diff --git a/lib/src/components/sensor/sensor.dart b/lib/src/components/sensor/sensor.dart index c33887fd9ba..3ace54d8e94 100644 --- a/lib/src/components/sensor/sensor.dart +++ b/lib/src/components/sensor/sensor.dart @@ -5,7 +5,7 @@ import '../../robot/client.dart'; /// {@category Components} /// Sensor represents a physical sensing device that can provide measurement readings. /// -/// For more information, see [Sensor component](https://docs.viam.com/components/sensor/). +/// For more information, see [Sensor component](https://docs.viam.com/dev/reference/apis/components/sensor/). abstract class Sensor extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'sensor'); @@ -15,19 +15,27 @@ abstract class Sensor extends Resource { /// var readings = await mySensor.readings(); /// ``` /// - /// For more information, see [Sensor component](https://docs.viam.com/components/sensor/). + /// For more information, see [Sensor component](https://docs.viam.com/dev/reference/apis/components/sensor/#getreadings). Future> readings({Map? extra}); /// Get the [ResourceName] for this [Sensor] with the given [name]. /// - /// For more information, see [Sensor component](https://docs.viam.com/components/sensor/). + /// ``` + /// final mySensorResourceName = mySensor.getResourceName("my_sensor"); + /// ``` + /// + /// For more information, see [Sensor component](https://docs.viam.com/dev/reference/apis/components/sensor/#getresourcename). static ResourceName getResourceName(String name) { return Sensor.subtype.getResourceName(name); } /// Get the [Sensor] named [name] from the provided robot. /// - /// For more information, see [Sensor component](https://docs.viam.com/components/sensor/). + /// ``` + /// final mySensor = Sensor.fromRobot(myRobotClient, "my_sensor"); + /// ``` + /// + /// For more information, see [Sensor component](https://docs.viam.com/dev/reference/apis/components/sensor/). static Sensor fromRobot(RobotClient robot, String name) { return robot.getResource(Sensor.getResourceName(name)); } diff --git a/lib/src/components/servo/servo.dart b/lib/src/components/servo/servo.dart index 62e9ea877ee..88278a2b108 100644 --- a/lib/src/components/servo/servo.dart +++ b/lib/src/components/servo/servo.dart @@ -5,7 +5,7 @@ import '../../robot/client.dart'; /// {@category Components} /// Servo represents a physical servo. /// -/// For more information, see [Servo component](https://docs.viam.com/components/servo/). +/// For more information, see [Servo component](https://docs.viam.com/dev/reference/apis/components/servo/). abstract class Servo extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'servo'); @@ -15,7 +15,7 @@ abstract class Servo extends Resource { /// await myServo.move(30); /// ``` /// - /// For more information, see [Servo component](https://docs.viam.com/components/servo/). + /// For more information, see [Servo component](https://docs.viam.com/dev/reference/apis/components/servo/#move). Future move(int angle, {Map? extra}); /// Get the current angle (degrees) of the [Servo]. @@ -24,7 +24,7 @@ abstract class Servo extends Resource { /// var angle = await myServo.position(); /// ``` /// - /// For more information, see [Servo component](https://docs.viam.com/components/servo/). + /// For more information, see [Servo component](https://docs.viam.com/dev/reference/apis/components/servo/#position). Future position({Map? extra}); /// Stop the [Servo]. It is assumed that the servo stops immediately. @@ -33,7 +33,7 @@ abstract class Servo extends Resource { /// await myServo.stop(); /// ``` /// - /// For more information, see [Servo component](https://docs.viam.com/components/servo/). + /// For more information, see [Servo component](https://docs.viam.com/dev/reference/apis/components/servo/#stop). Future stop({Map? extra}); /// Get if the [Servo] is currently moving. @@ -42,25 +42,28 @@ abstract class Servo extends Resource { /// var isItMoving = await myServo.isMoving(); /// ``` /// - /// For more information, see [Servo component](https://docs.viam.com/components/servo/). + /// For more information, see [Servo component](https://docs.viam.com/dev/reference/apis/components/servo/#ismoving). Future isMoving(); /// Get the [ResourceName] for this [Servo] with the given [name]. /// /// ``` /// // Example: - /// var name = Servo.getResourceName('myServo'); + /// var name = Servo.getResourceName('my_servo'); /// ``` /// - /// For more information, see [Servo component](https://docs.viam.com/components/servo/). + /// For more information, see [Servo component](https://docs.viam.com/dev/reference/apis/components/servo/#getresourcename). static ResourceName getResourceName(String name) { return Servo.subtype.getResourceName(name); } /// Get the [Servo] named [name] from the provided robot. /// - /// For more information, see [Servo component](https://docs.viam.com/components/servo/). + /// ``` + /// final myServo = Servo.fromRobot(myRobotClient, "my_servo"); + /// ``` /// + /// For more information, see [Servo component](https://docs.viam.com/dev/reference/apis/components/servo/). static Servo fromRobot(RobotClient robot, String name) { return robot.getResource(Servo.getResourceName(name)); }