From 58dd502701f7106ff7e48a5b0ff2c5a8f460f4ab Mon Sep 17 00:00:00 2001 From: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:45:08 +0200 Subject: [PATCH] Fixes --- lib/src/app/app.dart | 4 ++- lib/src/components/arm/arm.dart | 1 - lib/src/components/camera/camera.dart | 3 -- lib/src/components/motor/motor.dart | 47 +++++++++++++-------------- lib/src/components/servo/servo.dart | 29 +++++------------ 5 files changed, 34 insertions(+), 50 deletions(-) diff --git a/lib/src/app/app.dart b/lib/src/app/app.dart index 48d9ac43f6a..dc48ac78470 100644 --- a/lib/src/app/app.dart +++ b/lib/src/app/app.dart @@ -31,6 +31,7 @@ class AppClient { /// Create a new [Organization] /// /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future createOrganization(String name) async { + Future createOrganization(String name) async { final request = CreateOrganizationRequest()..name = name; final CreateOrganizationResponse response = await _client.createOrganization(request); return response.organization; @@ -74,7 +75,8 @@ class AppClient { /// Checks for namespace availablity throughout all [Organization]s. /// - /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). Future getOrganizationNamespaceAvailability(String publicNamespace) async { + /// For more information, see [Fleet Management API](https://docs.viam.com/appendix/apis/fleet/). + Future getOrganizationNamespaceAvailability(String publicNamespace) async { final request = GetOrganizationNamespaceAvailabilityRequest()..publicNamespace = publicNamespace; final GetOrganizationNamespaceAvailabilityResponse response = await _client.getOrganizationNamespaceAvailability(request); return response.available; diff --git a/lib/src/components/arm/arm.dart b/lib/src/components/arm/arm.dart index 969b2a5f7fd..7141e147a0d 100644 --- a/lib/src/components/arm/arm.dart +++ b/lib/src/components/arm/arm.dart @@ -11,7 +11,6 @@ abstract class Arm extends Resource { /// Get the current [Pose] of the end of the arm. /// /// ``` - /// // Get the pose of an arm named "myArm2" /// final currentPose = await myArm.endPosition(); /// ``` /// diff --git a/lib/src/components/camera/camera.dart b/lib/src/components/camera/camera.dart index dbfcfd4e1e0..195520c1b22 100644 --- a/lib/src/components/camera/camera.dart +++ b/lib/src/components/camera/camera.dart @@ -20,7 +20,6 @@ abstract class Camera extends Resource { /// ``` /// /// For more information, see [Camera component](https://docs.viam.com/components/camera/). - Future image({MimeType? mimeType, Map? extra}); /// Get the next point cloud from the camera. @@ -30,8 +29,6 @@ abstract class Camera extends Resource { /// ``` /// /// For more information, see [Camera component](https://docs.viam.com/components/camera/). - /// - /// For more information, see [Camera component](https://docs.viam.com/components/camera/). Future pointCloud({Map? extra}); /// Get the camera's intrinsic parameters and the camera's distortion parameters. diff --git a/lib/src/components/motor/motor.dart b/lib/src/components/motor/motor.dart index 2ff839dd194..fb12edc32c8 100644 --- a/lib/src/components/motor/motor.dart +++ b/lib/src/components/motor/motor.dart @@ -25,24 +25,24 @@ abstract class Motor extends Resource { /// Sets the "percentage" of power the [Motor] should employ between -1 and 1. /// When [powerPct] is negative, the rotation will be in the backward direction. /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). - /// /// ``` /// // Set the power to 40% forwards. /// await myMotor.setPower(0.4); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future setPower(double powerPct, {Map? extra}); /// Spin the [Motor] the specified number of [revolutions] at specified [rpm]. /// When [rpm] or [revolutions] is a negative value, the rotation will be in the backward direction. /// Note: if both [rpm] and [revolutions] are negative, the motor will spin in the forward direction. /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). - /// /// ``` /// // Turn the motor 7.2 revolutions forward at 60 RPM. /// await myMotor.goFor(60, 7.2); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future goFor(double rpm, double revolutions, {Map? extra}); /// Spin the [Motor] to the specified position (provided in revolutions from home/zero), @@ -50,67 +50,66 @@ abstract class Motor extends Resource { /// Regardless of the directionality of the [rpm] this function will move /// the [Motor] towards the specified position. /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). - /// /// ``` /// // Turn the motor to 8.3 revolutions from home at 75 RPM. /// await myMotor.goTo(75, 8.3); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future goTo(double rpm, double positionRevolutions, {Map? extra}); /// Spin the [Motor] indefinitely at the specified speed, in revolutions per minute. /// If [rpm] is positive, the motor will spin forwards, and if [rpm] is negative, the motor will spin backwards. /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). - /// /// ``` /// // Set the motor to turn backwards at 120.5 RPM. /// await myMotor.setRPM(-120.5); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future setRPM(double rpm, {Map? extra}); /// Set the current position (modified by [offset]) to be the new zero (home) position. /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). - /// /// ``` /// // Set the current position as the new home position with no offset. /// await myMotor.resetZeroPosition(0.0); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future resetZeroPosition(double offset, {Map? extra}); /// Report the position of the motor based on its encoder. /// The value returned is the number of revolutions relative to its zero position. /// This method will raise an exception if position reporting is not supported by the motor. /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). - /// /// ``` /// // Get the current position of an encoded motor. /// var position = await myMotor.position(); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future position({Map? extra}); /// Report a dictionary mapping each optional property to /// whether it is supported by this motor. /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). - /// /// ``` /// // Return whether the motor supports certain optional features /// var properties = await myMotor.properties(); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future properties({Map? extra}); /// Stop the motor immediately, without any gradual step down. /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). - Future stop({Map? extra}); - /// /// ``` /// // Stop the motor. /// await myMotor.stop(); /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future stop({Map? extra}); /// Returns whether or not the motor is currently powered, and the portion @@ -118,8 +117,6 @@ abstract class Motor extends Resource { /// motors report `true` if they are being powered while holding a position, /// as well as when they are turning themselves. /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). - /// /// ``` /// // Check whether the motor is currently powered and /// // check the percentage of max power to the motor. @@ -127,27 +124,27 @@ abstract class Motor extends Resource { /// var powered = powerState.isOn; /// var pct = powerState.powerPct; /// ``` + /// + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). Future powerState({Map? extra}); /// Get if the [Motor] is currently moving. /// - /// For more information, see [Motor component](https://docs.viam.com/components/motor/). - /// /// ``` /// // Check whether the motor is moving. /// var moving = await myMotor.isMoving(); /// ``` - Future isMoving({Map? extra}); - - /// Get the [ResourceName] for this [Motor] with the given [name] /// /// For more information, see [Motor component](https://docs.viam.com/components/motor/). + Future isMoving({Map? extra}); + + /// Get the [ResourceName] for this [Motor] with the given [name]. /// /// ``` /// var name = Motor.getResourceName('myMotor'); /// ``` /// - Future isMoving({Map? extra}); + /// For more information, see [Motor component](https://docs.viam.com/components/motor/). static ResourceName getResourceName(String name) { return Motor.subtype.getResourceName(name); } diff --git a/lib/src/components/servo/servo.dart b/lib/src/components/servo/servo.dart index 619fc320fe4..8b05214ebf4 100644 --- a/lib/src/components/servo/servo.dart +++ b/lib/src/components/servo/servo.dart @@ -15,50 +15,39 @@ abstract class Servo extends Resource { /// Get the current angle (degrees) of the [Servo]. /// - /// For more information, see [Servo component](https://docs.viam.com/components/servo/). - /// /// ``` /// var angle = await myServo.position(); /// ``` - Future position({Map? extra}); - - /// Stop the [Servo]. It is assumed that the servo stops immediately. - /// - /// For more information, see [Servo component](https://docs.viam.com/components/servo/). - /// - Future stop({Map? extra}); - - /// Get if the [Servo] is currently moving. /// /// For more information, see [Servo component](https://docs.viam.com/components/servo/). - Future isMoving(); + Future position({Map? extra}); - /// Get the [ResourceName] for this [Servo] with the given [name] - /// - /// For more information, see [Servo component](https://docs.viam.com/components/servo/). + /// Stop the [Servo]. It is assumed that the servo stops immediately. /// /// ``` /// await myServo.stop(); /// ``` - Future stop({Map? extra}); - - /// Whether the [Servo] is currently moving. /// /// For more information, see [Servo component](https://docs.viam.com/components/servo/). + Future stop({Map? extra}); + + /// Get if the [Servo] is currently moving. /// /// ``` /// var isItMoving = await myServo.isMoving(); /// ``` + /// + /// For more information, see [Servo component](https://docs.viam.com/components/servo/). Future isMoving(); /// Get the [ResourceName] for this [Servo] with the given [name]. /// - /// For more information, see [Servo component](https://docs.viam.com/components/servo/). - /// /// ``` /// // Example: /// var name = Servo.getResourceName('myServo'); /// ``` + /// + /// For more information, see [Servo component](https://docs.viam.com/components/servo/). static ResourceName getResourceName(String name) { return Servo.subtype.getResourceName(name); }