set_sound¶
Runs at once Any mode Takes control
Change the robot's sound settings and save them. Each setting named is written into the <sound> block of config/system.xml, changing only that value: every comment stays, and a copy of the file is kept in temp_data/xml_backups/ first. The robot uses the new values at once and at every start. Settings not named keep theirs.
Syntax¶
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
**settings |
Any |
{} |
Any of these: boot, homing_done, error, identify and programs, each 1 or 0 (or True / False), switch the five sounds on or off: the chime when the robot is ready after it starts, the chime when homing ends, the tune when an error latches, identify_arm(), and programs' beep() and play_tune(). axis: the axis of the robot's own sounds, "q" (louder: the tone is a small torque at its pitch) or "d" (no torque, quieter); programs' tones always play on "d". current_ma: the loudness as a current, 10 to 1000 mA (a drive's tone never takes more than that drive's own current limit). drive: the drive that plays, 1 for J1 up to the last joint, one more for a CAN gripper. limit_mv: the most voltage the sound may use, 500 to 6000 mV. boot_tune, homing_done_tune, error_tune and identify_tune: the tune each of the robot's own sounds plays, a name from the library (see play_sound()). |
Default values¶
From config/system.xml. As shipped: all five sounds on, axis
"q", current_ma 290 mA, drive 2 (J2), limit_mv 3600 mV (the
values chosen on PAR6 by ear); the tunes boot_tune "arpeggio",
homing_done_tune "rise", error_tune "low_double",
identify_tune "fanfare". A tune missing from the file is that
sound's default (boot_tune "power_up").
Returns¶
Nothing.
Examples¶
Usage restrictions 5 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
- [6003] Invalid arguments — no setting named, an unknown setting, a value out of range, or a tune not in the library
- [6013] Internal error — the file could not be written, or the edited file did not read back the values; the file is left unchanged
- [6025] RTI not running or not answering — rTI did not answer within 1 s: it is not running or not responding. The file is already saved
- [6026] Refused by RTI — rTI did not take a setting. The message says why
In Python, a code above raises CommandRejected; its number is the code. The call raises:
CommandRejected: The robot refused it: an unknown setting or a value out of range, another client holds control, or the file could not be changed. 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: