For information on the latest version, please have a look at 1.33.5.
set_tool_shape
This function activates a specific tool shape configuration among those registered in the Teach Pendant. It allows the robot to recognize the physical geometry of the mounted tool for collision detection or simulation purposes. This feature is available only in M2.4 version or higher.
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. 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.
Definition
DRFLEx.h within class CDRFLEx, public section
bool set_tool_shape(string strSymbol) {
return _set_tool_shape(_rbtCtrl, strSymbol.c_str());
};
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
strSymbol |
string |
The name of the tool shape to activate. |
Return
Value |
Description |
|---|---|
0 |
Failed — the specified tool shape was not found or activation failed. |
1 |
Success — the tool shape has been successfully activated. |
Example
// Activate a pre-registered tool shape
drfl.set_tool_shape("tool_shape#1");
This example activates the tool shape named “tool_shape#1” that was previously registered in the Teach Pendant, allowing the controller to apply the correct geometric model of the mounted tool.