Set Controller Interface TCP as Active
SUMMARY
"controller_interface_tcp" is a reserved, built-in TCP name exposed by the controller itself, distinct from any user-registered TCP such as those created with Add TCP. Assigning it to robot.active_tcp is a special case of Change Active TCP: it hands TCP authority back to whatever frame the controller's own interface currently reports, and pushes the change live when connected.
The Skill
robot.active_tcp = "controller_interface_tcp"The Code
Safety first!
A real robot will faithfully do whatever you ask of it - so please take a moment to clear the workspace, keep an E-Stop within reach, and be ready to disconnect.
Operating real hardware is at your own risk.
"""
Sets the controller interface TCP as the active TCP and reports the resulting pose.
Supports Universal Robots (UR).
Usage:
python set_controller_interface_tcp_as_active.py [--ip <ROBOT_IP>]
"""
import argparse
from loguru import logger
from telekinesis.synapse.robots.manipulators import universal_robots
def main(ip: str) -> None:
"""Set the controller-interface TCP as active."""
#===================== Create Robot ==========================================
robot = universal_robots.UniversalRobotsUR10E(name='UR10e')
# ==================== Visualization (Optional) =============================
robot.visualize_rerun(live=True)
try:
#===================== Connect Robot ==========================================
if ip:
robot.connect(ip=ip)
# ==================== Run Skill ============================================
# Get all registered TCPs
tcps = robot.get_tcps()
logger.info(f"Registered TCPs: {tcps}")
# Current Active TCP, transform w.r.t default tcp, and current TCP pose
logger.info(f"Active TCP: {robot.active_tcp}"
f" \nActive TCP transform: {robot.get_active_tcp_transform()}"
f" \n TCP pose: {robot.get_cartesian_pose()}")
# Set the controller-interface TCP as active
robot.active_tcp = "controller_interface_tcp"
# Get updated Active TCP, transform w.r.t default tcp, and TCP pose
logger.info(f"Active TCP after setting controller_interface_tcp: {robot.active_tcp}"
f" \nActive TCP transform: {robot.get_active_tcp_transform()}"
f" \n TCP pose: {robot.get_cartesian_pose()}")
except (ConnectionError, OSError) as e:
logger.error(f"Error occurred: {e}")
finally:
robot.disconnect()
robot.shutdown()
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Set the controller-interface TCP as active on a real UR10E.")
parser.add_argument("--ip", type=str, default=None,
help="UR robot IP address for real hardware, e.g. 192.168.1.100")
args = parser.parse_args()
main(ip=args.ip)Running the Example
python set_controller_interface_tcp_as_active.py --ip 192.168.1.100For all options:
python set_controller_interface_tcp_as_active.py --helpParameter Configuration
This skill takes no input parameters. "controller_interface_tcp" is a fixed, reserved name assigned to active_tcp, not a value you tune.
Returns
| Type | Description |
|---|---|
None | Assigning to active_tcp returns nothing - it is a property setter with a side effect (pushes to hardware when connected). Read robot.active_tcp afterward to confirm it now reports "controller_interface_tcp", or call robot.get_cartesian_pose() to see the pose resolved against it. |
Raises
| Exception | Condition |
|---|---|
ValueError | "controller_interface_tcp" is not yet a known frame in the kinematic model - it is only registered once connect() has imported it from the controller, so assigning it before connecting (or on a brand that never registers it) raises this |
Where to Use the Skill
- Aligning with controller-side tooling - Match the TCP used by the robot's teach pendant or native interface when handing control back and forth between Synapse and the controller.
- Verifying controller state - Confirm what pose the controller's own interface reports, independent of any TCPs registered through Synapse with Add TCP.
When Not to Use the Skill
- You want to switch to a user-registered TCP - use Change Active TCP with the TCP's own name instead.
- The TCP hasn't been registered yet -
"controller_interface_tcp"is a reserved built-in name; for a custom tool frame, register it first with Add TCP. - You just need to read the current pose without changing anything - use Get Cartesian Pose.