Note |
---|
If you have not read the information explaining the custom path feature, then please refer to this page before reading onwards: Customize the Robot's Path |
...
Table of Contents | ||
---|---|---|
|
...
In Short: TaskCompleted
TaskCompletedA boolean value that |
TaskCompleted = False
after the beforeRelease-callback, Pally will assume that no boxes were carried from the pickup to the target position on the pallet, leading Pally to try this same position in the next run.The user can override the value for TaskCompleted
in the beforeRelease-callback. It is however recommend to let Pally handle the logic for this. See the ‘In Detail: TaskCompleted’ section on how to configure the gripper such that Pally gets reliable input to set TaskCompleted
.controls whether the main Pally program should proceed to the next box position on the pallet, or repeat the same box position again. This is useful in the following scenarios:
The variable should be controlled by the user code in the beforeRelease-callback if required: Possible values
|
|
Example
There are two cases for TaskCompleted
:
If a Schmalz FXCB Foam gripper is used, and the Vacuum lost signal is tool_input[1] - then Pally will verify that the vacuum is present by checking if the vacuum is not lost. Pally will use this information to set the value for
TaskCompleted
.If another gripper, that has no vacuum sensor is used, then leave the Vacuum lost signal at -Always-LOW. Pally will then always set
TaskCompleted
toTrue
.
The default value is True unless lost vacuum is reported by the “vacuum lost” signal. Example
|
In Detail: TaskCompleted
The boolean variable TaskCompleted
is used to verify that the robot has placed box(es) on the pallet, such that empty runs are not counted as successful runs. Even though it and the program can proceed to the next position or not.
It is possible to manually set the value for this variable, which should then be done in the beforeRelease-callback, it is recommended to let Pally handle the logic to set the value of TaskCompleted
.
Pally will set TaskCompleted
(to either True
or False
) based on if it detects sufficient vacuum level in the gripper before it releases the box. This, as the vacuum level in the gripper will signal to Pally that the gripper is lifting a box (i.e a successful run). If the vacuum level in the gripper is low, then it signals that there is no box present on the gripper (i.e an empty run).
...
The logic in the Pally code gives more insight as to how the TaskCompleted
variable is used and altered:
Code Block | ||
---|---|---|
| ||
#global ChecksTaskCompleted the= vacuumHasVacuum() level before# releasingUSER boxCALLBACK has_vacuum = HasVacuumusercallback_beforeRelease() global TaskCompleted# =control has_vacuumthe gripper, #turn USERCALLBACK usercallback_beforeRelease() off vacuum ReleaseBox() if (TaskCompleted): # LOG_INFO("box released: ", rf_cntPos)box has reached the pallet, can proceed to next box SetCurrentTaskCompleted() else: if# (notbox has_vacuum): not reached the LOG_WARNING("vacuum not detected, retrying box: ", rf_cntPos) end CancelCurrentTask() endpallet, repeat last position CancelCurrentTask() end # USER CALLBACK usercallback_afterRelease() |
The logic in the Pally code shows how the TaskCompleted
is set based on the vacuum level (but it can also be overwritten in the beforeRelease-callback), and then used to verify if boxes were moved or not
...
As shown in the code snippet from above, setting the TaskCompleted = True
in the beforeRelease-callback, will ensure that all movements of the robot are treated as successful runs - where Pally assumes that the boxes in the current task have been placed on the pallet. If TaskCompleted = False
after the beforeRelease-callback, then Pally will not count the current task as completed. This will lead to Pally re-trying to place the box(es) in the current task.
Info |
---|
Please note: the TaskCompleted variable cannot be used along the path from the pick position towards the drop position. The first callback where TaskCompleted has a valid value is BeforeRelease. |
Info |
---|
Please note: even if a box is lost on the way from the pick position to the drop position, the robot will continue its motion to the drop position. Vacuum sensor is not being monitored constantly along the path. To do this, you can create your own thread and monitor the vacuum sensor input directly. |