Previous
obstacles_depth
Changed in RDK v0.2.36 and API v0.1.118
obstacles_distance
is a segmenter that takes point clouds from a camera input and returns the average single closest point to the camera as a perceived obstacle.
It is best for transient obstacle avoidance.
For example, if you have an ultrasonic distance sensor as viam:ultrasonic:camera
, this model will query the sensor "num_queries"
times, and then take the average point from those measurements and return that as an obstacle.
First, make sure your camera is connected to your machine’s computer and both are powered on. Then, configure the service:
Navigate to the CONFIGURE tab of your machine’s page in the Viam app.
Click the + icon next to your machine part in the left-hand menu and select Service.
Select the vision
type, then select the obstacles distance
model.
Enter a name or use the suggested name for your service and click Create.
In your vision service’s configuration panel, fill in the attributes field with the following:
Add the vision service object to the services array in your raw JSON configuration:
The following parameters are available for a obstacles_distance
segmenter:
Parameter | Required? | Description |
---|---|---|
num_queries | Optional | How many times the model should call GetPointCloud() before taking the average of the measurements and returning the single closest point. Accepts an integer between 1 and 20 .Default: 10 |
The following code uses the GetObjectPointClouds
method to run a segmenter vision model on an image from the machine’s camera "cam1"
:
To learn more about how to use segmentation, see the Python SDK docs.
To learn more about how to use segmentation, see the Go SDK docs.
To see more code examples of how to use Viam’s vision service, see our example repo.
For general configuration and development info, see:
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!