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: MovePerformed
MovePerformedA boolean value that Pally uses to check if it should move the robot |
on the path created by Pally. |
Possible values
|
Possible values
True
- Pally will move the robot from the pickup position Example
|
In Detail: MovePerformed
The MovePerformed
variable is only of importance when the custom path feature is in use. If this boolean variable is set to True
, then Pally will skip its next planned movement. Depending on where the variable is set to True the following movements will be skipped:
onNextTask: skip movement to the pick position (available in Pally 2.9.0 and later)
afterGrab: skip movement from the pick position to the target position on the pallet
afterRelease: skip movement from the target position back to the waiting position
of the robot to- and from the pickup position, to the target position (and back again).
In the Pally code, the logic looks like this:
Code Block | ||
---|---|---|
| ||
global MovePerformed = False # USERCALLBACK usercallback_onNextTask() if (not MovePerformed): MoveToPickup(path) end # USERCALLBACK usercallback_beforeGrab() |
If MovePerformed
is set to True
in the onNextTask-callback, then Pally will not call on the function to move the robot
...
to the
...
Example
If a customPath.script
is defined with two functions MoveToTarget()
and MoveBack()
, and rf_custom_path = True
; then MovePerformed
must be set at the end of both MoveToTarget()
and MoveBack()
as follows:
MovePerformed = True
...
pick position
Code Block | ||
---|---|---|
| ||
global MovePerformed = False
# USERCALLBACK
usercallback_afterGrab()
if (not MovePerformed):
MoveToTarget(path)
end |
If MovePerformed
is set to True
in the afterGrab-callback, then Pally will not call on the function to move the robot to the target position
Code Block | ||
---|---|---|
| ||
global MovePerformed = False
# USERCALLBACK
usercallback_afterRelease()
if (not MovePerformed):
MoveBackFromTarget(path)
end |
If MovePerformed
is set to True
in the afterRelease-callback, then Pally will not call on the function to move the robot back from the target position
The following example of a customPath.script
shows how the MovePerformed
variable is set to True
at the end of the customized move functions, on lines 80 and 94:
Code Block | ||
---|---|---|
| ||
p_boxfree = p[0,0,0,0,0,0]
p_boxfree2= p[0,0,0,0,0,0]
p_boxfree3= p[0,0,0,0,0,0]
p_exit= p[0,0,0,0,0,0]
j_exit = [0,0,0,0,0,0]
p_approach = p[0,0,0,0,0,0]
p_waypoint = p[0,0,0,0,0,0]
rf_custom_path = True
def MoveToTarget():
if (rf_custom_path):
# move up
p_boxfree = pose_trans(get_actual_tcp_pose(), p[0,0,-rf_box_free,0,0,0])
# move closer to the robot
p_boxfree2= p_boxfree
d = sqrt(rf_camera[0] * rf_camera[0] + rf_camera[1] * rf_camera[1]) / sqrt(p_boxfree2[0] * p_boxfree2[0] + p_boxfree2[1] * p_boxfree2[1])
p_boxfree2[0] = p_boxfree2[0] * d
p_boxfree2[1] = p_boxfree2[1] * d
# move up
p_boxfree3= p_boxfree2
if (MoveTarget[2] + ProductHeight > p_boxfree3[2]):
p_boxfree3[2] = MoveTarget[2] + ProductHeight
end
# move away from the conveyor and rotate
if (PalletNr == 1):
p_exit = pose_trans(p[-0.35, 0, 0, 0, 0, 0], p_boxfree3)
else:
p_exit = pose_trans(p[0.35, 0, 0, 0, 0, 0], p_boxfree3)
end
p_exit[3] = MoveTarget[3]
p_exit[4] = MoveTarget[4]
p_exit[5] = MoveTarget[5]
# approach the pallet
if (PalletNr == 1):
p_approach = pose_trans(p[0.05, -0.05, 0.05, 0, 0, 0], MoveTarget)
else:
p_approach = pose_trans(p[-0.05, -0.05, 0.05, 0, 0, 0], MoveTarget)
end
# this may be actual for the top layer:
# the approach should be closer than usual to have enough reach
if (not is_within_safety_limits(p_approach)):
# should not use normally
p_approach = MoveTarget
end
# a waypoint before approach
p_waypoint = p_approach
if (p_waypoint[2] < p_boxfree[2]):
p_waypoint[2] = p_boxfree[2]
end
if (p_waypoint[2] < MoveTarget[2] + ProductHeight + rf_approach[2]):
p_waypoint[2] = MoveTarget[2] + ProductHeight + rf_approach[2]
end
movel(p_boxfree, a=rf_max_acceleration, v=rf_speed, r=GetBlend(p_boxfree, p_boxfree2))
movel(p_boxfree2, a=rf_max_acceleration, v=rf_speed, r=GetBlend(p_boxfree2, p_boxfree3))
movel(p_boxfree3, a=rf_max_acceleration, v=rf_speed, r=GetBlend(p_boxfree3, p_exit))
movel(p_exit, a=rf_max_acceleration, v=rf_speed, r=0.01)
j_exit = get_actual_joint_positions()
if (is_within_safety_limits(p_waypoint)):
movej(p_waypoint, a=rf_max_acceleration, v=rf_speed, r=0.01)
movel(p_approach, a=rf_max_acceleration, v=rf_speed, r=GetBlend(p_approach, MoveTarget))
else:
movej(p_approach, a=rf_max_acceleration, v=rf_speed, r=0.01)
end
movel(MoveTarget, a=rf_precise_acceleration, v=rf_precise_speed, r=0)
MovePerformed=True
end
end
def MoveBack():
if (rf_custom_path):
if (is_within_safety_limits(p_waypoint)):
movel(p_waypoint, a=rf_max_acceleration, v=rf_speed, r=GetBlend(p_waypoint, p_exit))
else:
movel(p_approach, a=rf_max_acceleration, v=rf_speed, r=GetBlend(p_approach, p_exit))
end
movej(j_exit, a=rf_max_acceleration, v=rf_speed, r=0.01)
movel(p_boxfree3, a=rf_max_acceleration, v=rf_speed, r=GetBlend(p_boxfree3, p_boxfree2))
movel(p_boxfree2, a=rf_max_acceleration, v=rf_speed, r=0)
MovePerformed=True
end
end |
An example of a customPath.script
, notice the use of MovePerformed
at lines 80 and 94
To review how to use the custom path feature, refer to Customize the Robot's Path .