API Example - Using the Image Service

This example program demonstrates how to list the different image sources available to query. Additionally, this example program shows how to capture an image from one or more different image source, decode the response data, and save each image locally in a file named after the image source.

Setup Dependencies

This example requires the bosdyn API and client to be installed, and must be run using python3. Using pip, these dependencies can be installed using:

python -m pip install -r requirements.txt

As well, the example program takes multiple optional arguments on the command line when running the example. The command line argument --list will print the different sources to the command line screen. Specify each source from which images should be captured using the command line argument --image-sources. To specify more than one image source you must repeat the command line argument for each source; for example, --image-sources SOURCE1 --image-sources SOURCE2.

Running the Example

To run the example:

python get_image.py --username USER --password PASSWORD ROBOT_IP