Skip to content

Commit

Permalink
DOCS-2032: Add camera and gantry example snippets (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
JessamyT authored Jun 7, 2024
1 parent 617aef3 commit ec43462
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
12 changes: 12 additions & 0 deletions lib/src/components/camera/camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,24 @@ abstract class Camera extends Resource {
static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'camera');

/// Get the next image from the camera.
///
/// ```
/// var nextImage = await myCamera.image();
/// ```
Future<ViamImage> image({MimeType? mimeType, Map<String, dynamic>? extra});

/// Get the next point cloud from the camera.
///
/// ```
/// var nextPointCloud = await myCamera.pointCloud();
/// ```
Future<ViamImage> pointCloud({Map<String, dynamic>? extra});

/// Get the camera's intrinsic parameters and the camera's distortion parameters.
///
/// ```
/// var cameraProperties = await myCamera.properties();
/// ```
Future<CameraProperties> properties();

/// Get the [ResourceName] for this [Camera] with the given [name]
Expand Down
36 changes: 30 additions & 6 deletions lib/src/components/gantry/gantry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,46 @@ import '../../robot/client.dart';
abstract class Gantry extends Resource {
static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'gantry');

/// Get the position of the axes in millimeters
/// Get the position of the axes in millimeters.
///
/// ```
/// var position = await myGantry.position();
/// ```
Future<List<double>> position({Map<String, dynamic>? extra});

/// Move the gantry to a new position in millimeters at the requested speeds in millimeters/second
/// Move the gantry to a new position in millimeters at the requested speeds in millimeters/second.
///
/// ```
/// await myGantry.moveToPosition([0.0, 20.5], [15, 15]);
/// ```
Future<void> moveToPosition(List<double> positions, List<double> speeds, {Map<String, dynamic>? extra});

/// Run the homing sequence and return true if completed successfully
/// Run the homing sequence and return true if completed successfully.
///
/// ```
/// var homed = await myGantry.home();
/// ```
Future<bool> home({Map<String, dynamic>? extra});

/// Get the lengths of the axes of the gantry in millimeters
/// Get the lengths of the axes of the gantry in millimeters.
///
/// ```
/// var lengths = await myGantry.lengths();
/// ```
Future<List<double>> lengths({Map<String, dynamic>? extra});

/// Stop all motion of the [Gantry]. It is assumed the [Gantry] stops immediately
/// Stop all motion of the [Gantry]. It is assumed the [Gantry] stops immediately.
///
/// ```
/// await myGantry.stop();
/// ```
Future<void> stop({Map<String, dynamic>? extra});

/// If the [Gantry] is currently moving
/// Whether the [Gantry] is currently moving.
///
/// ```
/// var moving = await myGantry.isMoving();
/// ```
Future<bool> isMoving();

/// Get the [ResourceName] for this [Gantry] with the given [name]
Expand Down

0 comments on commit ec43462

Please sign in to comment.