Skip to content

reload_recipes

Runs at once Any mode Takes control

Read the telemetry recipe files again and use them at once. The robot reads every .xml file in its data_recipe/ folder and replaces the recipes it holds with the ones that parse: a new file becomes usable by set_recipe(), an edited one takes effect, a removed one is dropped. A file that does not parse is skipped, with a line in the robot's log; when none parses, the recipes in force stay. No restart and no homing are needed.

Syntax

robot.reload_recipes()

Arguments

None.

Returns

Nothing.

Examples

robot.reload_recipes()
robot.set_recipe("diagnostics")

Further details

Note

When the file of the recipe in use is removed and the recipes are reloaded, the data streams carry only the joint positions and the tick, while the status field recipe still names the old recipe. Choose another one with set_recipe().

Usage restrictions 4 codes

This command runs at once; it is not queued. The robot accepts it in any mode and state, from the client that holds control or when no client does.

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

  • [6101] Control held by another client — another client holds control; the message names it
  • [7003] Recipe folder unreadable — the recipe folder does not exist, or the robot could not read it or a file in it; the recipes in force stay
  • [6025] RTI not running or not answering — rTI did not answer within 1 s: it is not running or not responding. The command may still have taken effect
  • [6026] Refused by RTI — rTI could not use the recipes the robot read. The message says why; the recipes in force stay

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

  • CommandRejected: The robot refused it: the folder could not be read, or another client holds control. Or RTI refused it or did not answer within 1 s (Errors:).
  • RobotTimeout: The robot did not answer within 5 s.
  • RobotConnectionError: The client is not connected.

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": "reload_recipes", "args": []}

See also