Skip to content

DOCS-3351: Update Flutter SDK component links #326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions lib/src/components/arm/arm.dart
Original file line number Diff line number Diff line change
@@ -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<Pose> endPosition({Map<String, dynamic>? 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<void> moveToPosition(Pose pose, {Map<String, dynamic>? 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<void> moveToJointPositions(List<double> positions, {Map<String, dynamic>? extra});

/// Get the [List] of current joint angles of each arm joint
@@ -50,7 +50,7 @@ abstract class Arm extends Resource {
/// List<double> 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<List<double>> jointPositions({Map<String, dynamic>? 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<void> stop({Map<String, dynamic>? 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<bool> 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));
}
28 changes: 18 additions & 10 deletions lib/src/components/base/base.dart
Original file line number Diff line number Diff line change
@@ -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<void> moveStraight(int distance, double velocity, {Map<String, dynamic>? 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<void> spin(double angle, double velocity, {Map<String, dynamic>? 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<void> setPower(Vector3 linear, Vector3 angular, {Map<String, dynamic>? 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<void> setVelocity(Vector3 linear, Vector3 angular, {Map<String, dynamic>? 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<void> stop({Map<String, dynamic>? extra});

/// Whether the base is currently moving
@@ -94,25 +94,33 @@ 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<bool> 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);
}

/// 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<BaseProperties> properties({Map<String, dynamic>? 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));
}
38 changes: 23 additions & 15 deletions lib/src/components/board/board.dart
Original file line number Diff line number Diff line change
@@ -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<void> setGpioState(String pin, bool high, {Map<String, dynamic>? 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<bool> gpio(String pin, {Map<String, dynamic>? 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<double> pwm(String pin, {Map<String, dynamic>? 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<void> setPwm(String pin, double dutyCyclePct, {Map<String, dynamic>? 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<int> pwmFrequency(String pin, {Map<String, dynamic>? 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<void> setPwmFrequency(String pin, int frequencyHz, {Map<String, dynamic>? 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<AnalogValue> analogReaderValue(String analogReaderName, {Map<String, dynamic>? 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<int> digitalInterruptValue(String digitalInterruptName, {Map<String, dynamic>? extra});

/// Stream digital interrupts ticks.
@@ -108,7 +108,7 @@ abstract class Board extends Resource {
/// Stream<Tick> 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<Tick> streamTicks(List<String> interrupts, {Map<String, dynamic>? 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<void> addCallbacks(List<String> interrupts, Queue<Tick> tickQueue, {Map<String, dynamic>? 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<void> setPowerMode(PowerMode powerMode, int seconds, int nanos, {Map<String, dynamic>? 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<void> writeAnalog(String pin, int value, {Map<String, dynamic>? 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));
}
20 changes: 14 additions & 6 deletions lib/src/components/camera/camera.dart
Original file line number Diff line number Diff line change
@@ -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<ViamImage> image({MimeType? mimeType, Map<String, dynamic>? 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<ViamImage> pointCloud({Map<String, dynamic>? 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<CameraProperties> 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));
}
26 changes: 17 additions & 9 deletions lib/src/components/gantry/gantry.dart
Original file line number Diff line number Diff line change
@@ -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<List<double>> position({Map<String, dynamic>? 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<void> moveToPosition(List<double> positions, List<double> speeds, {Map<String, dynamic>? 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<bool> home({Map<String, dynamic>? 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<List<double>> lengths({Map<String, dynamic>? 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<void> stop({Map<String, dynamic>? 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<bool> 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));
}
14 changes: 11 additions & 3 deletions lib/src/components/generic/generic.dart
Original file line number Diff line number Diff line change
@@ -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));
}
22 changes: 15 additions & 7 deletions lib/src/components/gripper/gripper.dart
Original file line number Diff line number Diff line change
@@ -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<void> open({Map<String, dynamic>? 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<void> grab({Map<String, dynamic>? 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<void> stop({Map<String, dynamic>? 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<bool> 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));
}
30 changes: 17 additions & 13 deletions lib/src/components/motor/motor.dart
Original file line number Diff line number Diff line change
@@ -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<void> setPower(double powerPct, {Map<String, dynamic>? 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<void> goFor(double rpm, double revolutions, {Map<String, dynamic>? 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<void> goTo(double rpm, double positionRevolutions, {Map<String, dynamic>? 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<void> setRPM(double rpm, {Map<String, dynamic>? 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<void> resetZeroPosition(double offset, {Map<String, dynamic>? 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<double> position({Map<String, dynamic>? 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<MotorProperties> properties({Map<String, dynamic>? 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<void> stop({Map<String, dynamic>? 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> powerState({Map<String, dynamic>? 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<bool> isMoving({Map<String, dynamic>? 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));
}
32 changes: 20 additions & 12 deletions lib/src/components/movement_sensor/movement_sensor.dart
Original file line number Diff line number Diff line change
@@ -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<Map<String, dynamic>> readings({Map<String, dynamic>? 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> position({Map<String, dynamic>? 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<Vector3> linearVelocity({Map<String, dynamic>? 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<Vector3> angularVelocity({Map<String, dynamic>? 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<Vector3> linearAcceleration({Map<String, dynamic>? 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<double> compassHeading({Map<String, dynamic>? 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> orientation({Map<String, dynamic>? 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> properties({Map<String, dynamic>? 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> accuracy({Map<String, dynamic>? 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));
}
22 changes: 15 additions & 7 deletions lib/src/components/power_sensor/power_sensor.dart
Original file line number Diff line number Diff line change
@@ -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<Map<String, dynamic>> readings({Map<String, dynamic>? 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> voltage({Map<String, dynamic>? 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> current({Map<String, dynamic>? 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<double> power({Map<String, dynamic>? 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));
}
16 changes: 12 additions & 4 deletions lib/src/components/sensor/sensor.dart
Original file line number Diff line number Diff line change
@@ -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<Map<String, dynamic>> readings({Map<String, dynamic>? 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));
}
19 changes: 11 additions & 8 deletions lib/src/components/servo/servo.dart
Original file line number Diff line number Diff line change
@@ -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<void> move(int angle, {Map<String, dynamic>? 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<int> position({Map<String, dynamic>? 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<void> stop({Map<String, dynamic>? 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<bool> 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));
}