Skip to content

capture_telemetry

Runs at once Any mode Open to every client

Record the robot's per-tick data into a file on the robot. The robot's recorder saves every control tick's values from 5 s before the request to seconds after it: the joints' positions, speeds, accelerations, jerks and torques, raw and filtered; the commanded and target values; the tool centre point's pose, speed and acceleration; the external torques and forces; the feedforward torques; the drives' error flags; the loop's timing and the real-time link. The file is temp_data/captures/<UTC time>_<name>.npz on the robot; the dashboard's Recordings tab, Captures, plots it and downloads it. The real-time loop does no extra work for it.

The call returns at once, when the request is placed. The robot's activity log says CAPTURE_STARTED, then CAPTURE_SAVED once the file is written. One capture runs at a time; stop_capture() ends it early.

Syntax

robot.capture_telemetry(seconds=10.0, name='')

Arguments

Name Type Default Description
seconds float 10.0 How long to record after the request, in seconds, 1 to 60.
name str '' A label for the file name. Letters, digits, - and _ are kept, anything else becomes -, up to 32 characters; an empty one is "capture".

Returns

Any

{"seconds", "name", "folder"}: the length, the label as the file name will carry it, and the captures' folder on the robot.

Examples

robot.capture_telemetry(5, "start_pose")
robot.move_joints(90, -105, 165, 0, -30, 180)
robot.wait_idle()

Further details

Note

While another capture runs, the recorder refuses this one in its activity log only (CAPTURE_REFUSED); the call still returns normally. The robot keeps the 10 newest captures and deletes older ones. The 5 s before the request and the 10 kept are the Capture settings of the dashboard's Recordings tab (config/system.xml <recorder>).

Usage restrictions 2 codes

This command runs at once; it is not queued. The robot accepts it in any mode and state, from every client.

It answers with one of these codes when it does not carry the command out:

  • [6003] Invalid arguments — seconds is not from 1 to 60
  • [6021] Capture not started — the recorder process is not running; nothing is recorded

In Python, a code above raises CommandRejected; its number is the code. The call raises:

  • CommandRejected: The robot refused it; the code says why (see Errors).
  • RobotTimeout: The robot did not answer within 5 s.
  • RobotConnectionError: The client is not connected.
  • ValueError: seconds is not a number. Nothing is sent.
  • TypeError: seconds is None. Nothing is sent.

If the connection drops while the call waits for the robot's answer, it raises CommandRejected with the code CONNECTION_LOST (DISCONNECTED after disconnect()); while it waits for the robot's status, RobotConnectionError.

Like every immediate command, it also answers BAD_ARGS when a raw client sends a value the robot cannot read at all, and INTERNAL when it fails inside the robot.

Protocol

A client that does not use robotclient sends this over the TCP command protocol (port 29000) for the example above:

{"id": "c1", "cmd": "capture_telemetry", "args": [5.0, "start_pose"]}

See also