diff --git a/static/include/app/apis/generated/data.md b/static/include/app/apis/generated/data.md index b9e9203883..5da410c4ca 100644 --- a/static/include/app/apis/generated/data.md +++ b/static/include/app/apis/generated/data.md @@ -56,7 +56,7 @@ Obtain unified tabular data and metadata, queried with SQL. **Returns:** -- (List[Dict[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]]): An array of data objects. +- (List[Dict[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes | [datetime.datetime](https://docs.python.org/3/library/datetime.html)]]): An array of data objects. **Example:** @@ -86,7 +86,7 @@ Obtain unified tabular data and metadata, queried with MQL. **Returns:** -- (List[Dict[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]]): An array of data objects. +- (List[Dict[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes | [datetime.datetime](https://docs.python.org/3/library/datetime.html)]]): An array of data objects. **Example:** diff --git a/static/include/components/apis/generated/board.md b/static/include/components/apis/generated/board.md index 7f089c1020..fd69cc7f6b 100644 --- a/static/include/components/apis/generated/board.md +++ b/static/include/components/apis/generated/board.md @@ -19,13 +19,13 @@ Supported by `viam-micro-server`. **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_board = Board.from_robot(robot=robot, name="my_board") +my_board = Board.from_robot(robot=machine, name="my_board") # Get the GPIOPin with pin number 15. pin = await my_board.gpio_pin_by_name(name="15") # Set the pin to high. -await pin.set(high="true") +await pin.set(high=True) ``` For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/board/client/index.html#viam.components.board.client.GPIOPinClient.set). @@ -102,7 +102,7 @@ Supported by `viam-micro-server`. **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_board = Board.from_robot(robot=robot, name="my_board") +my_board = Board.from_robot(robot=machine, name="my_board") # Get the GPIOPin with pin number 15. pin = await my_board.gpio_pin_by_name(name="15") @@ -192,7 +192,7 @@ Supported by `viam-micro-server`. **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_board = Board.from_robot(robot=robot, name="my_board") +my_board = Board.from_robot(robot=machine, name="my_board") # Get the GPIOPin with pin number 15. pin = await my_board.gpio_pin_by_name(name="15") @@ -275,14 +275,14 @@ Supported by `viam-micro-server`. **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_board = Board.from_robot(robot=robot, name="my_board") +my_board = Board.from_robot(robot=machine, name="my_board") # Get the GPIOPin with pin number 15. pin = await my_board.gpio_pin_by_name(name="15") # Set the duty cycle to .6, meaning that this pin will be in the high state for # 60% of the duration of the PWM interval period. -await pin.set_pwm(cycle=.6) +await pin.set_pwm(duty_cycle=.6) ``` For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/board/client/index.html#viam.components.board.client.GPIOPinClient.set_pwm). @@ -359,7 +359,7 @@ Supported by `viam-micro-server`. **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_board = Board.from_robot(robot=robot, name="my_board") +my_board = Board.from_robot(robot=machine, name="my_board") # Get the GPIOPin with pin number 15. pin = await my_board.gpio_pin_by_name(name="15") @@ -447,7 +447,7 @@ Supported by `viam-micro-server`. **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_board = Board.from_robot(robot=robot, name="my_board") +my_board = Board.from_robot(robot=machine, name="my_board") # Get the GPIOPin with pin number 15. pin = await my_board.gpio_pin_by_name(name="15") @@ -528,7 +528,7 @@ Get a configured `Analog` by `name`. **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_board = Board.from_robot(robot=robot, name="my_board") +my_board = Board.from_robot(robot=machine, name="my_board") # Get the Analog "my_example_analog_reader". reader = await my_board.analog_by_name(name="my_example_analog_reader") @@ -658,7 +658,7 @@ Get a configured `DigitalInterrupt` by `name`. **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_board = Board.from_robot(robot=robot, name="my_board") +my_board = Board.from_robot(robot=machine, name="my_board") # Get the DigitalInterrupt "my_example_digital_interrupt". interrupt = await my_board.digital_interrupt_by_name( @@ -712,9 +712,9 @@ Start a stream of `DigitalInterrupt` ticks. **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_board = Board.from_robot(robot=robot, name="my_board") -di8 = await my_board.digital_interrupt_by_name(name="8")) -di11 = await my_board.digital_interrupt_by_name(name="11")) +my_board = Board.from_robot(robot=machine, name="my_board") +di8 = await my_board.digital_interrupt_by_name(name="8") +di11 = await my_board.digital_interrupt_by_name(name="11") # Iterate over stream of ticks from pins 8 and 11. async for tick in await my_board.stream_ticks([di8, di11]): @@ -814,7 +814,7 @@ This is expected: the board has been successfully powered down and can no longer **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_board = Board.from_robot(robot=robot, name="my_board") +my_board = Board.from_robot(robot=machine, name="my_board") # Set the power mode of the board to OFFLINE_DEEP. status = await my_board.set_power_mode(mode=PowerMode.POWER_MODE_OFFLINE_DEEP) @@ -926,7 +926,7 @@ Supported by `viam-micro-server`. **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_board = Board.from_robot(robot=robot, name="my_board") +my_board = Board.from_robot(robot=machine, name="my_board") # Get the Analog "my_example_analog_reader". reader = await my_board.analog_reader_by_name( @@ -990,7 +990,7 @@ Get the current value of this interrupt. **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_board = Board.from_robot(robot=robot, name="my_board") +my_board = Board.from_robot(robot=machine, name="my_board") # Get the DigitalInterrupt "my_example_digital_interrupt". interrupt = await my_board.digital_interrupt_by_name( @@ -1072,7 +1072,7 @@ Get a `GPIOPin` by {{< glossary_tooltip term_id="pin-number" text="pin number" > **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_board = Board.from_robot(robot=robot, name="my_board") +my_board = Board.from_robot(robot=machine, name="my_board") # Get the GPIOPin with pin number 15. pin = await my_board.gpio_pin_by_name(name="15") diff --git a/static/include/components/apis/generated/encoder.md b/static/include/components/apis/generated/encoder.md index b2cb355fd5..2fa24b1e43 100644 --- a/static/include/components/apis/generated/encoder.md +++ b/static/include/components/apis/generated/encoder.md @@ -21,7 +21,7 @@ Supported by `viam-micro-server`. **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_encoder = Encoder.from_robot(robot=robot, name='my_encoder') +my_encoder = Encoder.from_robot(robot=machine, name='my_encoder') # Get the position of the encoder in ticks position = await my_encoder.get_position(PositionType.POSITION_TYPE_TICKS_COUNT) @@ -82,7 +82,7 @@ Supported by `viam-micro-server`. **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_encoder = Encoder.from_robot(robot=robot, name='my_encoder') +my_encoder = Encoder.from_robot(robot=machine, name='my_encoder') # Reset the zero position of the encoder. await my_encoder.reset_position() @@ -138,7 +138,7 @@ Supported by `viam-micro-server`. **Example:** ```python {class="line-numbers linkable-line-numbers"} -my_encoder = Encoder.from_robot(robot=robot, name='my_encoder') +my_encoder = Encoder.from_robot(robot=machine, name='my_encoder') # Get whether the encoder returns position in ticks or degrees. properties = await my_encoder.get_properties() diff --git a/static/include/components/apis/generated/input_controller.md b/static/include/components/apis/generated/input_controller.md index 2c3f843278..7572aadb14 100644 --- a/static/include/components/apis/generated/input_controller.md +++ b/static/include/components/apis/generated/input_controller.md @@ -46,6 +46,8 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Example:** ```go {class="line-numbers linkable-line-numbers"} +myController, err := input.FromRobot(machine, "my_input_controller") + // Get the list of Controls provided by the controller. controls, err := myController.Controls(context.Background(), nil) ``` @@ -76,7 +78,7 @@ This method returns the current state of the controller as a map of [Event Objec ```python {class="line-numbers linkable-line-numbers"} # Get the controller from the machine. my_controller = Controller.from_robot( - robot=myRobotWithController, name="my_controller") + myRobotWithController, "my_controller") # Get the most recent Event for each Control. recent_events = await my_controller.get_events() @@ -103,6 +105,8 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Example:** ```go {class="line-numbers linkable-line-numbers"} +myController, err := input.FromRobot(machine, "my_input_controller") + // Get the most recent Event for each Control. recent_events, err := myController.Events(context.Background(), nil) ``` diff --git a/static/include/components/apis/generated/servo.md b/static/include/components/apis/generated/servo.md index b253b4370f..0705829b4d 100644 --- a/static/include/components/apis/generated/servo.md +++ b/static/include/components/apis/generated/servo.md @@ -80,7 +80,6 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```dart {class="line-numbers linkable-line-numbers"} -// Move the servo from its origin to the desired angle of 30 degrees. await myServo.move(30); ``` diff --git a/static/include/robot/apis/generated/robot.md b/static/include/robot/apis/generated/robot.md index 24bc1706f1..3a8b58ca24 100644 --- a/static/include/robot/apis/generated/robot.md +++ b/static/include/robot/apis/generated/robot.md @@ -132,14 +132,14 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ ### DiscoverComponents -Get a list of discovered potential component configurations. Only implemented for webcam cameras in builtin components. Returns module names for modules. +Get a list of discovered component configurations. {{< tabs >}} {{% tab name="Python" %}} **Parameters:** -- `queries` ([List[viam.proto.robot.DiscoveryQuery]](https://python.viam.dev/autoapi/viam/proto/robot/index.html#viam.proto.robot.DiscoveryQuery)) (required): The list of component models to lookup potential component configurations for. +- `queries` ([List[viam.proto.robot.DiscoveryQuery]](https://python.viam.dev/autoapi/viam/proto/robot/index.html#viam.proto.robot.DiscoveryQuery)) (required): The list of component models to lookup potential configurations for. **Returns:** @@ -248,7 +248,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Returns:** -- [(\*framesystem.Config)](https://pkg.go.dev/go.viam.com/rdk/robot/framesystem#Config): The configuration of the given machine’s frame system. +- [(*framesystem.Config)](https://pkg.go.dev/go.viam.com/rdk/robot/framesystem#Config): The configuration of the given machine’s frame system. - [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred. **Example:** @@ -309,9 +309,9 @@ pose = Pose( y=2.0, # Y coordinate in mm z=3.0, # Z coordinate in mm o_x=0.0, # X component of orientation vector - o_y=1.0, # Y component of orientation vector + o_y=0.0, # Y component of orientation vector o_z=0.0, # Z component of orientation vector - theta=25.0 # Orientation angle in degrees + theta=0.0 # Orientation angle in degrees ) pose_in_frame = PoseInFrame( @@ -347,8 +347,8 @@ import ( "go.viam.com/rdk/spatialmath" ) -baseOrigin := referenceframe.NewPoseInFrame("base-1", spatialmath.NewZeroPose()) -cameraToBase, err := machine.TransformPose(context.Background(), baseOrigin, "camera-1", nil) +baseOrigin := referenceframe.NewPoseInFrame("test-base", spatialmath.NewZeroPose()) +movementSensorToBase, err := machine.TransformPose(context.Background(), baseOrigin, "my-movement-sensor", nil) ``` For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/robot#Robot). diff --git a/static/include/services/apis/generated/motion.md b/static/include/services/apis/generated/motion.md index 195aac2c62..e7cc1c5ec8 100644 --- a/static/include/services/apis/generated/motion.md +++ b/static/include/services/apis/generated/motion.md @@ -583,6 +583,8 @@ Stop a [base](/components/base/) component being moved by an in progress [`MoveO **Example:** ```python {class="line-numbers linkable-line-numbers"} +motion = MotionClient.from_robot(robot=machine, name="builtin") + # Assuming a `move_on_globe()` started the execution # Stop the base component which was instructed to move by `move_on_globe()` # or `move_on_map()` diff --git a/static/include/services/apis/generated/vision.md b/static/include/services/apis/generated/vision.md index e6dbdd656b..5e3a412cf0 100644 --- a/static/include/services/apis/generated/vision.md +++ b/static/include/services/apis/generated/vision.md @@ -22,11 +22,10 @@ Get a list of detections from the next image from a specified camera using a con **Example:** ```python {class="line-numbers linkable-line-numbers"} -# Grab the detector you configured on your machine -my_detector = VisionClient.from_robot(machine, "my_detector") +my_detector = VisionClient.from_robot(robot, "my_detector") -# Get detections from the next image from the camera -detections = await my_detector.get_detections_from_camera("cam") +# Get detections for the next image from the specified camera +detections = await my_detector.get_detections_from_camera("my_camera") ``` For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/vision/client/index.html#viam.services.vision.client.VisionClient.get_detections_from_camera). @@ -99,7 +98,7 @@ Get a list of detections from a given image using a configured [detector](/servi **Parameters:** -- `image` ([viam.media.video.ViamImage](https://python.viam.dev/autoapi/viam/components/camera/index.html#viam.components.camera.ViamImage)) (required): The image to get detections from. +- `image` ([viam.media.video.ViamImage](https://python.viam.dev/autoapi/viam/components/camera/index.html#viam.components.camera.ViamImage)) (required): The image to get detections for. - `extra` (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call. - `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call. @@ -114,16 +113,13 @@ Get a list of detections from a given image using a configured [detector](/servi **Example:** ```python {class="line-numbers linkable-line-numbers"} -# Grab camera from the machine -cam = Camera.from_robot(machine, "cam") - -# Get the detector you configured on your machine -my_detector = VisionClient.from_robot(machine, "my_detector") +my_camera = Camera.from_robot(robot, "my_camera") +my_detector = VisionClient.from_robot(robot, "my_detector") # Get an image from the camera -img = await cam.get_image() +img = await my_camera.get_image() -# Get detections from that image +# Get detections for that image detections = await my_detector.get_detections(img) ``` @@ -222,12 +218,11 @@ Get a list of classifications from the next image from a specified camera using **Example:** ```python {class="line-numbers linkable-line-numbers"} -# Grab the classifier you configured on your machine -my_classifier = VisionClient.from_robot(machine, "my_classifier") +my_classifier = VisionClient.from_robot(robot, "my_classifier") -# Get the 2 classifications with the highest confidence scores from the next image from the camera +# Get the 2 classifications with the highest confidence scores for the next image from the camera classifications = await my_classifier.get_classifications_from_camera( - "cam", 2) + "my_camera", 2) ``` For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/vision/client/index.html#viam.services.vision.client.VisionClient.get_classifications_from_camera). @@ -302,7 +297,7 @@ Get a list of classifications from a given image using a configured [classifier] **Parameters:** -- `image` ([viam.media.video.ViamImage](https://python.viam.dev/autoapi/viam/components/camera/index.html#viam.components.camera.ViamImage)) (required): The image to get detections from. +- `image` ([viam.media.video.ViamImage](https://python.viam.dev/autoapi/viam/components/camera/index.html#viam.components.camera.ViamImage)) (required): The image to get detections for. - `count` ([int](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (required): The number of classifications desired. - `extra` (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call. - `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call. @@ -314,16 +309,13 @@ Get a list of classifications from a given image using a configured [classifier] **Example:** ```python {class="line-numbers linkable-line-numbers"} -# Grab camera from the machine -cam = Camera.from_robot(machine, "cam") - -# Get the classifier you configured on your machine -my_classifier = VisionClient.from_robot(machine, "my_classifier") +my_camera = Camera.from_robot(robot, "my_camera") +my_classifier = VisionClient.from_robot(robot, "my_classifier") # Get an image from the camera -img = await cam.get_image() +img = await my_camera.get_image() -# Get the 2 classifications with the highest confidence scores +# Get the 2 classifications with the highest confidence scores for the image classifications = await my_classifier.get_classifications(img, 2) ``` @@ -429,10 +421,9 @@ Get a list of 3D point cloud objects and associated metadata in the latest pictu import numpy as np import open3d as o3d -# Grab the object segmenter you configured on your machine -my_segmenter = VisionClient.from_robot(machine, "my_segmenter") +my_segmenter = VisionClient.from_robot(robot, "my_segmenter") # Get the objects from the camera output -objects = await my_segmenter.get_object_point_clouds("cam") +objects = await my_segmenter.get_object_point_clouds("my_camera") # write the first object point cloud into a temporary file with open("/tmp/pointcloud_data.pcd", "wb") as f: f.write(objects[0].point_cloud) @@ -492,7 +483,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s ```dart {class="line-numbers linkable-line-numbers"} // Example: -var ptCloud = await myVisionService.objectPointClouds("cam"); +var ptCloud = await myVisionService.objectPointClouds('myCamera'); ``` For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/VisionClient/objectPointClouds.html). @@ -525,12 +516,11 @@ Used for visualization. **Example:** ```python {class="line-numbers linkable-line-numbers"} -# Grab the detector you configured on your machine my_detector = VisionClient.from_robot(machine, "my_detector") -# capture all from the next image from the camera +# Get the captured data for a camera result = await my_detector.capture_all_from_camera( - "cam", + "my_camera", return_image=True, return_detections=True, ) @@ -748,11 +738,10 @@ Fetch information about which vision methods a given vision service supports. **Example:** ```python {class="line-numbers linkable-line-numbers"} -# Grab the detector you configured on your machine -my_detector = VisionClient.from_robot(machine, "my_detector") +my_detector = VisionClient.from_robot(robot, "my_detector") properties = await my_detector.get_properties() -properties.detections_supported # returns True -properties.classifications_supported # returns False +detections_supported = properties.detections_supported +classifications_supported = properties.classifications_supported ``` For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/vision/client/index.html#viam.services.vision.client.VisionClient.get_properties).