camera.takePicture

Captures an equirectangular image, saving lat/long coordinates to EXIF (if your camera features its own GPS or GPS is enabled on connected mobile phones). Call camera.setOptions prior to this command call if needed. This command was modified in API level 2.

Parameters

  • sessionId: Unique session identifier obtained from the camera.startSession command. This field was deprecated in API level 2.

Results

  • API level 1
    • fileUri: URI of the captured image. Manufacturers decide whether to use absolute or relative URIs; for example, "http://android.com/robots.txt" is an absolute URI while "robots.txt" is a relative URI. Clients may treat this as an opaque identifier.
  • API level 2
    • fileUrl: Absolute URL of the captured image, which can be used to download directly from the HTTP server of the camera. Please note this command doesn’t return fileUrl immediately since the capture (including in-camera stitching) usually takes a while (varies from seconds to minutes) to complete. The progress of the command is obtained by polling the camera periodically using the /osc/commands/status API and fileUrl is the result returned when the command finishes. When delayProcessing is true, it is the absolute URL of the preview image, which can be used as input in processPicture to process the image, otherwise, it is the absolute URL of the final processed image.

Errors

  • missingParameter: sessionId is missing. This error code was deprecated in API level 2.
  • invalidParameterName: The parameter name is unrecognized, e.g. sessionId is not recognized in API level 2.
  • invalidParameterValue: The input parameter name is recognized, but its value is invalid; for example, the sessionId doesn't exist, is no longer active, or its data type is incorrect. This error code was deprecated in API level 2.
  • disabledCommand: Command is currently disabled; for example, the camera is in video shooting mode. This error code was added in API level 2.

Command I/O

Command Input (API level 1)
{
    "parameters": {
        "sessionId": "12ABC3"
    }
}
Command Output (API level 1)
{
    "results": {
        "fileUri": "file URI"
    }
}
Command Output (Error) (API level 1)
{
    "error": {
        "code": "invalidParameterValue",
        "message": "Parameter sessionId doesn't exist."
    }
}
Command Input (API level 2)
none
Command Output (API level 2)
{
    "results": {
        "fileUrl": "Absolute file URL"
    }
}
Command Output (Error) (API level 2)
{
    "error": {
        "code": "disabledCommand",
        "message": "Command is currently disabled."
    }
}