Examples¶
The SDK source has a set of ready-to-run scripts under python/examples/. Get the scripts working first, then model your own program on them.
Run the commands below from the SDK source directory: with the collection environment that is third_party/taccap-gripper in the data-collection repository;
with a standalone install it is TacCap-Gripper.
Every script selects a gripper with left, right or a full serial number, which can be omitted when only one gripper is attached. When a leader and a follower gripper are attached on the same side, use the full serial number.
A script interrupts any other program using a gripper when it starts, so do not run example scripts while collection or control is running.
Scripts at a glance¶
| Script | Purpose | Moves the motor or rewrites the gripper? |
|---|---|---|
calibrate.py |
Leader gripper travel calibration | Rewrites the gripper |
leader_normalized_position.py |
Read the leader gripper's opening | Read-only |
fisheye_cal.py |
View / write fisheye intrinsics | show is read-only, the rest rewrite the gripper |
read_intrinsics.py |
Export the wrist camera intrinsics | Read-only |
wrist_camera.py |
Wrist camera viewer | Read-only |
ota_update.py |
Gripper firmware upgrade | Flashes firmware |
motor_ota_update.py |
Motor firmware upgrade | Flashes firmware |
Every script accepts --help to list its arguments. The follower gripper's scripts (self-check, keyboard control, impedance and force-position control and so on) are in Follower gripper → Example scripts.
Follower gripper¶
See Follower gripper → Example scripts.
Leader gripper¶
python python/examples/calibrate.py right
python python/examples/leader_normalized_position.py right
The calibration procedure is in Calibration and self-check.
Wrist camera¶
python python/examples/wrist_camera.py --list # list cameras and their serial numbers
python python/examples/wrist_camera.py <camera serial> --undistort # undistorted image
Firmware¶
For a follower gripper see Firmware and motor upgrades; for a leader gripper see Firmware OTA upgrade.
Migrating from older versions¶
Programs written against 0.1.x / 0.2.x are mainly affected by these changes when upgrading to 0.4.x:
- The follower gripper now uses controllers:
ImpedanceControllerorForcePositionController, configured withfor_spec(). The oldControlLoop,set_position()and similar interfaces have been removed. - Positive velocity and torque now consistently mean the closing direction.
- Follower gripper firmware must be 1.2.5 or later; below 1.2.11 you are prompted to upgrade.
- The example scripts now select a gripper with a positional argument
left/right/ serial number, and the old control-type example scripts have been removed. - The wrist camera frames delivered by gripper objects are now RGB by default.
When upgrading from 0.3.x to 0.4.x:
- Force-position control now uses a single torque-limited control law, which holds more steadily when grasping;
snapshot().holdingbecomes true about 150ms later than before, so revalidate any program that relies on it. - When closing to 0, the final state may be either
HOLDING_FORCEorHOLDING_POSITION; both are normal. - During operation,
set_target(opening, grip_force)with a grip force above 1.1N·m now raises an error instead of being silently accepted. - New
g.motor.motor_version()reads the motor firmware version (from gripper firmware 1.2.14 on, this works regardless of the motor's communication mode).
Upgrading from 0.4.1 to 0.4.3 (no API changes):
ForcePositionControllerno longer stutters when following a streamed target, at the cost of about 10–15ms more tracking lag.- A stall short of a target that is still moving enters
HOLDING_FORCEabout 150ms later than before; review programs that rely on it to detect a grasp. - The bundled follower firmware moves to 1.2.16; upgrade the firmware.
The full list of changes is in the SDK's CHANGELOG.