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-7962: organize sections in docs #266

Merged
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
11 changes: 8 additions & 3 deletions dartdoc_options.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
dartdoc:
categories:
"Components":
markdown: doc/Components.md
"Services":
markdown: doc/Services.md
"Viam SDK":
markdown: doc/ViamSDK.md
name: Viam SDK
"Common":
markdown: doc/Common.md
"Protobuf Definitions":
markdown: doc/Protobuf.md
name: Protobuf Definitions
categoryOrder: ["Viam SDK", "Protobuf Definitions"]
categoryOrder:
["Components", "Services", "Common", "Viam SDK", "Protobuf Definitions"]
nodoc: ["**/di/**", "**/domain/**"]
19 changes: 19 additions & 0 deletions doc/Common.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Classes in Viam SDK Library

These are common classes that are also in the [Viam SDK library](https://flutter.viam.dev/viam_sdk/viam_sdk-library.html).

[DoCommandRequest](https://flutter.viam.dev/viam_sdk/DoCommandRequest-class.html)

[DoCommandResponse](https://flutter.viam.dev/viam_sdk/DoCommandResponse-class.html)

[GeoPoint](https://flutter.viam.dev/viam_sdk/GeoPoint-class.html)

[Orientation](https://flutter.viam.dev/viam_sdk/Orientation-class.html)

[Pose](https://flutter.viam.dev/viam_sdk/Pose-class.html)

[PoseInFrame](https://flutter.viam.dev/viam_sdk/PoseInFrame-class.html)

[ResourceName](https://flutter.viam.dev/viam_sdk/ResourceName-class.html)

[Vector3](https://flutter.viam.dev/viam_sdk/Vector3-class.html)
Empty file added doc/Components.md
Empty file.
Empty file added doc/Services.md
Empty file.
2 changes: 1 addition & 1 deletion doc/ViamSDK.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Viam SDK Library
# Viam SDK

Smart machines on smart devices.
2 changes: 1 addition & 1 deletion lib/protos/common/common.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// The proto definitions for common
/// {@category Protobuf Definitions}
/// {@category Common}
library viam_protos.common.common;

// THIS FILE IS AUTOMATICALLY GENERATED
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/arm/arm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import '../../gen/common/v1/common.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

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

/// {@category Viam SDK}
/// {@category Components}
/// gRPC client for an [Arm] component.
///
/// Used to communicate with an existing [Arm] implementation over gRPC.
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/arm/service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import '../../resource/manager.dart';
import '../../utils.dart';
import 'arm.dart';

/// {@category Components}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the category definitions in all of the service.dart files are actually unneeded since we don't export these files, so no documentation exists for these

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(No need to do anything, just commenting here for documentation)

/// gRPC Service for an [Arm]
class ArmService extends ArmServiceBase {
final ResourceManager _manager;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/base/base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '../../robot/client.dart';
/// {@category Viam SDK}
typedef BaseProperties = GetPropertiesResponse;

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

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

/// {@category Components}
/// gRPC service for a robotic [Base]
class BaseService extends BaseServiceBase {
final ResourceManager _manager;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/board/board.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ typedef Tick = StreamTicksResponse;
/// {@category Viam SDK}
typedef AnalogValue = ReadAnalogReaderResponse;

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

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

/// {@category Components}
/// gRPC Service for a [Board]
class BoardService extends BoardServiceBase {
final ResourceManager _manager;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/camera/camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import '../../robot/client.dart';
/// The camera's supported features and settings
typedef CameraProperties = GetPropertiesResponse;

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

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

/// {@category Components}
/// gRPC Service for a generic [Camera]
class CameraService extends CameraServiceBase {
final ResourceManager _manager;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/gantry/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'gantry.dart';

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

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

/// {@category Components}
/// gRPC Service for a [Gantry]
class GantryService extends GantryServiceBase {
final ResourceManager _manager;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/generic/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'generic.dart';

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

/// {@category Viam SDK}
/// {@category Components}
/// 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/generic/service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import '../../resource/manager.dart';
import '../../utils.dart';
import 'generic.dart';

/// {@category Components}
/// gRPC Service for a generic [Generic]
class GenericService extends GenericServiceBase {
final ResourceManager _manager;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/gripper/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'gripper.dart';

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

/// {@category Viam SDK}
/// {@category Components}
/// 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/gripper/service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import '../../resource/manager.dart';
import '../../utils.dart';
import 'gripper.dart';

/// {@category Components}
/// gRPC Service for a [Gripper]
class GripperService extends GripperServiceBase {
final ResourceManager _manager;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/motor/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'motor.dart';

/// {@category Viam SDK}
/// {@category Components}
/// gRPC client for the [Motor] component.
class MotorClient extends Motor implements ResourceRPCClient {
@override
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/motor/motor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class PowerState {
}
}

/// {@category Viam SDK}
/// {@category Components}
/// 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/motor/service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import '../../resource/manager.dart';
import '../../utils.dart';
import 'motor.dart';

/// {@category Components}
/// gRPC Service for a [Motor]
class MotorService extends MotorServiceBase {
final ResourceManager _manager;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/movement_sensor/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'movement_sensor.dart';

/// {@category Viam SDK}
/// {@category Components}
/// gRPC client for the [MovementSensor] component.
class MovementSensorClient extends MovementSensor implements ResourceRPCClient {
@override
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/movement_sensor/movement_sensor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ typedef Properties = GetPropertiesResponse;
/// {@category Viam SDK}
typedef Accuracy = GetAccuracyResponse;

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

/// {@category Components}
/// gRPC Service for a [MovementSensor]
class MovementSensorService extends MovementSensorServiceBase {
final ResourceManager _manager;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/power_sensor/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'power_sensor.dart';

/// {@category Viam SDK}
/// {@category Components}
/// gRPC client for the [PowerSensor] component.
class PowerSensorClient extends PowerSensor implements ResourceRPCClient {
@override
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/power_sensor/power_sensor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ typedef Voltage = GetVoltageResponse;
/// {@category Viam SDK}
typedef Current = GetCurrentResponse;

/// {@category Viam SDK}
/// {@category Components}
/// 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/power_sensor/service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import '../../resource/manager.dart';
import '../../utils.dart';
import 'power_sensor.dart';

/// {@category Components}
/// gRPC Service for a [PowerSensor]
class PowerSensorService extends PowerSensorServiceBase {
final ResourceManager _manager;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/sensor/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'sensor.dart';

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

/// {@category Viam SDK}

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

/// {@category Components}
/// gRPC Service for a generic [Sensor]
class SensorService extends SensorServiceBase {
final ResourceManager _manager;
Expand Down
3 changes: 1 addition & 2 deletions lib/src/components/servo/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import '../../resource/base.dart';
import '../../utils.dart';
import 'servo.dart';

/// {@category Viam SDK}

/// {@category Components}
/// 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/service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import '../../resource/manager.dart';
import '../../utils.dart';
import 'servo.dart';

/// {@category Components}
/// gRPC Service for a [Servo]
class ServoService extends ServoServiceBase {
final ResourceManager _manager;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/servo/servo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import '../../gen/common/v1/common.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

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

/// {@category Viam SDK}
/// {@category Services}
class VisionClient extends Resource implements ResourceRPCClient {
static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeService, 'vision');

Expand Down
1 change: 1 addition & 0 deletions lib/viam_sdk.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// Robots at your fingertips.
/// {@category Viam SDK}
library viam_sdk;

/// App Clients
Expand Down
7 changes: 6 additions & 1 deletion tool/export_protos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,14 @@ Future<void> _populateExports(Map<String, Iterable<File>> dirStructure) async {
final file = File('$_newProtoPath${entry.key}${Platform.pathSeparator}${fEntry.key}.dart');
await file.create(recursive: true);
final writer = file.openWrite(mode: FileMode.writeOnlyAppend);
String category = 'Protobuf Definitions';
if (fEntry.key == 'common') {
category = 'Common';
}

writer.writeAll([
'/// The proto definitions for ${fEntry.key}',
'/// {@category Protobuf Definitions}',
'/// {@category $category}',
'library viam_protos.${entry.key}.${fEntry.key};\n',
'// THIS FILE IS AUTOMATICALLY GENERATED',
'// DO NOT OVERWRITE\n',
Expand Down
Loading