Teleop IK Example
Minimal teleop input to EmbodiK IK.
What It Demonstrates
examples/03_teleop_ik.py is a public adapter example. It keeps the IK setup
hidden in examples/example_helpers/teleop_ik_backend.py so the script can focus
on the important teleop wiring:
- Read a relative controller pose.
- Convert the controller delta into an end-effector target pose.
- Call
backend.solve_step(goal_pose). - Visualize or send the returned joint positions.
If no Seer controller is connected, the same IK path runs from the draggable
/ik_target transform in the browser.
Button Mapping
- Hold A: stream controller motion into IK.
- Trigger travel: stream the gripper command continuously.
- Button B: reset robot and controller reference.
Core Pattern
The example intentionally leaves detailed IK tuning outside the public script:
backend = TeleopIKBackend(cfg, enable_collision=True)
controller = SeerController("/dev/ttyUSB0")
controller.connect()
arm_stream_start_pose = backend.get_pose()
while True:
controller.process_buttons()
if controller.streaming:
delta_pos, delta_wxyz = controller.relative_pose()
goal_pose = apply_controller_delta(
arm_stream_start_pose,
delta_pos,
delta_wxyz,
scale=1.5,
)
result = backend.solve_step(goal_pose)
q_command = result.joints
The backend uses the same registered-task IK path as the other examples:
solve_position_step() with a frame task, posture bias, adaptive dt, and optional
self-collision constraints.
Running
Install and copy the example bundle once using the Installation Guide. Then run:
For repository development, use Pixi:
The example defaults to the Panda preset; pass --robot <key> to use another
configured model. Seer/xvisio support is activated only when you pass
--enable-teleop; otherwise the same IK path is driven by the browser
transform control.
Useful flags:
pixi run -e teleop python examples/03_teleop_ik.py --enable-teleop
# optional port override
pixi run -e teleop python examples/03_teleop_ik.py --enable-teleop --controller-port /dev/ttyUSB1
pixi run -e teleop python examples/03_teleop_ik.py --no-collision
Notes
- Seer controller mode requires
xvisio, host runtime support, and an explicit--enable-teleop;--controller-portonly overrides the default/dev/ttyUSB0port. - Install the teleop Pixi environment once with
pixi install -e teleop. - With no controller connected, drag
/ik_targetin the browser to exercise the samebackend.solve_step(goal_pose)path. - For floating-base torso-oriented validation, use
examples/floating_base_torso_hierarchy.py.