36 lines
1.5 KiB
XML
36 lines
1.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Programs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.staubli.com/robotics/VAL3/Program/2">
|
|
<Program name="startDetection" access="public">
|
|
<Parameters xmlns="http://www.staubli.com/robotics/VAL3/Param/1">
|
|
<Parameter name="x_nTolPercent" type="num" xsi:type="element" />
|
|
</Parameters>
|
|
<Code><![CDATA[begin
|
|
//-----------------------------------------------------------------------
|
|
//Header begin
|
|
//Description of program
|
|
// Reads the current joint force values to compare them to the trained ones (a tolerance can be added).
|
|
// If the force on a joint becomes greater than the trained value for this joint +
|
|
// the tolerance, the robot is stopped and the motion stack is emptied.
|
|
// The monitoring is active when the robot is inside the specified zone (function setInZone()).
|
|
// This functions sets the boolean “bContact” when an overrun is detected.
|
|
//
|
|
//Input parameters
|
|
// num x_nTolPercent :
|
|
// role : tolerance percentage to apply to the trained values.
|
|
//
|
|
//Example
|
|
// call startDetection(20)
|
|
//
|
|
//History
|
|
// Creation : 23-04-08 - f.Rob
|
|
// Modification: 11-03-09 - ffab
|
|
//Header end
|
|
//-----------------------------------------------------------------------
|
|
// Wait the previous task is ended
|
|
bInZone=false
|
|
wait(taskStatus("train")==-1 and taskStatus("detect")==-1)
|
|
// Create the task
|
|
taskCreate "detect",100,detect(x_nTolPercent)
|
|
end]]></Code>
|
|
</Program>
|
|
</Programs> |