For information on the latest version, please have a look at 1.33.5.
set_tcp (Manual Mode)
This section explains how to use set_tcp in Manual mode to activate a predefined Tool Center Point (TCP) configuration.
The TCP defines the effective reference point for all task-space motions, including linear moves, force control, and orientation-based operations. Accurate TCP activation is essential for precise path execution and safe automated workflows.
This function selects a TCP configuration previously created using add_tcp.
Available in Manual mode. In any other mode the function returns false and prints this command can only be used in manual mode. please change to manual mode as robot mode. The mode check uses the value returned by get_robot_mode.
Caution
On a real robot the safety board also refuses the call while the robot is moving; the motion is quick-stopped and a running program is stopped.
Typical usage
Switch between multiple TCPs for different tools or gripper fingers.
Select a TCP optimized for picking, inserting, or assembly tasks.
Adjust control behavior when the working point is offset from the flange.
Validate spatial accuracy before motion.
Note
strSymbolmust match a TCP name registered withadd_tcp.Switching TCPs during motion is not recommended; apply at safe poses.
The TCP affects all task-space motion planning and force-control logic.
Example: Activating a TCP Before Motion
// Activate TCP with symbol "TCP_GRIPPER_CENTER"
if (!drfl.set_tcp("TCP_GRIPPER_CENTER")) {
printf("Failed to activate TCP.\n");
return -1;
}
// Execute motion using the selected TCP
float approach[6] = {400.f, 200.f, 300.f, 180.f, 0.f, 0.f};
float vel[2] = {80.f, 40.f}, acc[2] = {300.f, 100.f};
drfl.movel(approach, vel, acc);
In this example, a pre-registered TCP is activated and used for subsequent linear movements.
Tips
Use precise values (Smart Setup recommended) for best accuracy.
Store multiple TCPs when one tool has several usable operation points.
Check current TCP with
get_tcp()before executing critical tasks.