Skip to content
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

RSDK-7961: highlight viam sdk section #262

Merged
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions dartdoc_options.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
dartdoc:
categories:
"Viam SDK":
markdown: doc/ViamSDK.md
name: Viam SDK
"Protobuf Definitions":
markdown: doc/Protobuf.md
name: Protobuf Definitions
categoryOrder: ["Protobuf Definitions"]
nodoc: ['**/di/**', '**/domain/**']
categoryOrder: ["Viam SDK", "Protobuf Definitions"]
nodoc: ["**/di/**", "**/domain/**"]
3 changes: 3 additions & 0 deletions doc/ViamSDK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Viam SDK Library

Smart machines on smart devices.
2 changes: 2 additions & 0 deletions lib/src/app/data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import '../gen/app/datasync/v1/data_sync.pbgrpc.dart' hide CaptureInterval;
import '../gen/google/protobuf/timestamp.pb.dart';
import '../media/image.dart';

/// {@category Viam SDK}
typedef DatabaseConnection = GetDatabaseConnectionResponse;

/// gRPC client used for retrieving, uploading, and modifying stored data from app.viam.com.
Expand Down Expand Up @@ -532,6 +533,7 @@ class DataClient {
}
}

/// {@category Viam SDK}
extension FilterUtils on Filter {
/// Return a [Filter] with a [CaptureInterval] created by the provided start and end [DateTime] objects
Filter withDateTimeCaptureInterval({DateTime? start, DateTime? end}) {
Expand Down
5 changes: 5 additions & 0 deletions lib/src/app/permissions.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '../gen/app/v1/app.pbgrpc.dart' as proto;

/// {@category Viam SDK}
enum AuthorizationId {
organizationOwner,
organizationOperator,
Expand All @@ -15,6 +16,7 @@ enum AuthorizationId {
}
}

/// {@category Viam SDK}
enum IdentityType {
user,
apiKey;
Expand All @@ -26,8 +28,10 @@ enum IdentityType {
}
}

/// {@category Viam SDK}
enum ResourceType { location, organization, robot }

/// {@category Viam SDK}
enum Permission {
readOrganization,
writeOrganization,
Expand All @@ -52,6 +56,7 @@ enum Permission {
}
}

/// {@category Viam SDK}
class ViamAuthorization {
String authorizationType;

Expand Down
2 changes: 2 additions & 0 deletions lib/src/app/provisioning.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import 'dart:async';

import '../gen/provisioning/v1/provisioning.pbgrpc.dart';

/// {@category Viam SDK}
enum NetworkType { wifi, wired }

/// {@category Viam SDK}
/// gRPC client for connecting to Viam's Provisioning Service
///
/// All calls must be authenticated.
Expand Down
1 change: 1 addition & 0 deletions lib/src/app/robot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:viam_sdk/src/gen/google/protobuf/timestamp.pb.dart';
import '../gen/app/v1/robot.pbgrpc.dart';
import '../gen/common/v1/common.pb.dart';

/// {@category Viam SDK}
/// gRPC client for connecting to app's RobotService.
///
/// All calls must be authenticated.
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/arm/arm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import '../../gen/common/v1/common.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

/// {@category Viam SDK}
/// Arm represents a physical robot arm that exists in three-dimensional space.
///
/// For more information, see [Arm component](https://docs.viam.com/components/arm/).
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/arm/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'arm.dart';

/// {@category Viam SDK}
/// gRPC client for an [Arm] component.
///
/// Used to communicate with an existing [Arm] implementation over gRPC.
Expand Down
2 changes: 2 additions & 0 deletions lib/src/components/base/base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import '../../gen/component/base/v1/base.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

/// {@category Viam SDK}
typedef BaseProperties = GetPropertiesResponse;

/// {@category Viam SDK}
/// Base represents a physical base of a robot.
///
/// For more information, see [Base component](https://docs.viam.com/components/base/).
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/base/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'base.dart';

/// {@category Viam SDK}
/// gRPC client for the [Base] component.
class BaseClient extends Base implements ResourceRPCClient {
@override
Expand Down
4 changes: 4 additions & 0 deletions lib/src/components/board/board.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ import '../../gen/component/board/v1/board.pbgrpc.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

/// {@category Viam SDK}
/// Tick of a digital interrupt
typedef Tick = StreamTicksResponse;

/// {@category Viam SDK}
typedef AnalogValue = ReadAnalogReaderResponse;

/// {@category Viam SDK}
/// Board represents a physical general purpose compute board that contains various
/// components such as analog readers, and digital interrupts.
///
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/board/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'board.dart';

/// {@category Viam SDK}
/// gRPC client for the [Board] component.
class BoardClient extends Board implements ResourceRPCClient {
@override
Expand Down
2 changes: 2 additions & 0 deletions lib/src/components/camera/camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import '../../media/image.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

/// {@category Viam SDK}
/// The camera's supported features and settings
typedef CameraProperties = GetPropertiesResponse;

/// {@category Viam SDK}
/// Camera represents any physical hardware that can capture frames.
///
/// For more information, see [Camera component](https://docs.viam.com/components/camera/).
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/camera/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'camera.dart';

/// {@category Viam SDK}
/// gRPC client for the [Camera] component
class CameraClient extends Camera implements ResourceRPCClient {
@override
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/gantry/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'gantry.dart';

/// {@category Viam SDK}
/// gRPC client for the [Gantry] component.
class GantryClient extends Gantry implements ResourceRPCClient {
@override
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/gantry/gantry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import '../../gen/common/v1/common.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

/// {@category Viam SDK}
/// 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/).
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/generic/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'generic.dart';

/// {@category Viam SDK}
/// gRPC client for the [Generic] component.
class GenericClient extends Generic implements ResourceRPCClient {
@override
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/generic/generic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import '../../gen/common/v1/common.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

/// {@category Viam SDK}
/// Generic represents a generic component that executes doCommand.
///
/// For more information, see [Generic component](https://docs.viam.com/components/generic/).
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/gripper/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'gripper.dart';

/// {@category Viam SDK}
/// gRPC client for the [Gripper] component.
class GripperClient extends Gripper implements ResourceRPCClient {
@override
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/gripper/gripper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import '../../gen/common/v1/common.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

/// {@category Viam SDK}
/// Gripper represents a physical Gripper which can open and close.
///
/// For more information, see [Gripper component](https://docs.viam.com/components/gripper/).
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/motor/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'motor.dart';

/// {@category Viam SDK}
/// gRPC client for the [Motor] component.
class MotorClient extends Motor implements ResourceRPCClient {
@override
Expand Down
3 changes: 3 additions & 0 deletions lib/src/components/motor/motor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import '../../gen/component/motor/v1/motor.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

/// {@category Viam SDK}
typedef MotorProperties = GetPropertiesResponse;

/// {@category Viam SDK}
class PowerState {
bool isOn;
double powerPct;
Expand All @@ -16,6 +18,7 @@ class PowerState {
}
}

/// {@category Viam SDK}
/// Motor represents a physical motor.
///
/// For more information, see [Motor component](https://docs.viam.com/components/motor/).
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/movement_sensor/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'movement_sensor.dart';

/// {@category Viam SDK}
/// gRPC client for the [MovementSensor] component.
class MovementSensorClient extends MovementSensor implements ResourceRPCClient {
@override
Expand Down
5 changes: 5 additions & 0 deletions lib/src/components/movement_sensor/movement_sensor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@ import '../../gen/component/movementsensor/v1/movementsensor.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

/// {@category Viam SDK}
class Position {
GeoPoint coordinates;
double altitude;

Position(this.coordinates, this.altitude);
}

/// {@category Viam SDK}
typedef Properties = GetPropertiesResponse;

/// {@category Viam SDK}
typedef Accuracy = GetAccuracyResponse;

/// {@category Viam SDK}
/// 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/).
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/power_sensor/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'power_sensor.dart';

/// {@category Viam SDK}
/// gRPC client for the [PowerSensor] component.
class PowerSensorClient extends PowerSensor implements ResourceRPCClient {
@override
Expand Down
4 changes: 4 additions & 0 deletions lib/src/components/power_sensor/power_sensor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ import '../../gen/component/powersensor/v1/powersensor.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

/// {@category Viam SDK}
typedef Voltage = GetVoltageResponse;

/// {@category Viam SDK}
typedef Current = GetCurrentResponse;

/// {@category Viam SDK}
/// PowerSensor reports information about voltage, current, and power.
///
/// For more information, see [Power Sensor component](https://docs.viam.com/components/power-sensor/).
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/sensor/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'sensor.dart';

/// {@category Viam SDK}
/// gRPC client for the [Sensor] component.
class SensorClient extends Sensor implements ResourceRPCClient {
@override
Expand Down
2 changes: 2 additions & 0 deletions lib/src/components/sensor/sensor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import '../../gen/common/v1/common.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

/// {@category Viam SDK}

/// Sensor represents a physical sensing device that can provide measurement readings.
///
/// For more information, see [Sensor component](https://docs.viam.com/components/sensor/).
Expand Down
2 changes: 2 additions & 0 deletions lib/src/components/servo/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'servo.dart';

/// {@category Viam SDK}

/// gRPC client for the [Servo] component.
class ServoClient extends Servo implements ResourceRPCClient {
@override
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/servo/servo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import '../../gen/common/v1/common.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

/// {@category Viam SDK}
/// Servo represents a physical servo.
///
/// For more information, see [Servo component](https://docs.viam.com/components/servo/).
Expand Down
2 changes: 2 additions & 0 deletions lib/src/media/image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:typed_data';

import 'package:image/image.dart' as img;

/// {@category Viam SDK}
/// Mime types supported by Viam
class MimeType {
final String _type;
Expand Down Expand Up @@ -89,6 +90,7 @@ class MimeType {
}
}

/// {@category Viam SDK}
/// A custom image type that contains the [MimeTYpe], raw image data, and lazily loads and caches an [img.Image].
class ViamImage {
/// The mimetype of the image
Expand Down
1 change: 1 addition & 0 deletions lib/src/media/stream/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class StreamManager {
}
}

/// {@category Viam SDK}
/// A client to manage a camera's WebRTC stream.
///
/// Use the [getStream] method to obtain a stream of [MediaStream] that can be used to display WebRTC video.
Expand Down
6 changes: 6 additions & 0 deletions lib/src/resource/base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ import 'package:grpc/grpc_connection_interface.dart';

import '../gen/common/v1/common.pb.dart';

/// {@category Viam SDK}
/// The standard namespace for Viam resources (rdk)
const String resourceNamespaceRDK = 'rdk';

/// {@category Viam SDK}
/// The standard type for component resources (component)
const String resourceTypeComponent = 'component';

/// {@category Viam SDK}
/// The standard type for service resources (service)
const String resourceTypeService = 'service';

/// {@category Viam SDK}
/// [Subtype] defines a triplet of strings that correspond to a resource's specific API definition.
class Subtype {
/// The namespace of the subtype
Expand Down Expand Up @@ -61,6 +65,7 @@ class Subtype {
namespace == other.namespace && resourceType == other.resourceType && resourceSubtype == other.resourceSubtype;
}

/// {@category Viam SDK}
/// Abstract class that defines the base functionality for all [Resource] types
abstract class Resource {
abstract final String name;
Expand All @@ -77,6 +82,7 @@ abstract class Resource {
}
}

/// {@category Viam SDK}
/// Abstract class that defines the base functionality for all RPC clients for resources
abstract class ResourceRPCClient<T extends Client> {
abstract ClientChannelBase channel;
Expand Down
Loading
Loading