Skip to end of banner
Go to start of banner

MovePerformed

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

If you have not read the information explaining the custom feature, then please refer to this page before reading onwards: Customize the Robot's Path

This page gives a short overview of the variable MovePerformed; and then a more in depth look at how the variable can be used in Pally:


In Short: MovePerformed

MovePerformed

A boolean value that Pally uses to check if it should move the robot with the path created by Pally.

This value must be set to True in the afterGrab- and afterRelease-callbacks if the custom path feature is in use.

Possible values

  • True - Pally will move the robot from the pickup position to the target position (and back again)

  • False - Pally will not move the robot from the pickup position to the target position (and back again)

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

The MoveToTarget() and MoveBack() functions must then be called in the afterGrab- and afterRelease-callbacks respectively.

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 planned movements of the robot from the pickup position to the target position (and back again).

In the Pally code, the logic looks like this:

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

global MovePerformed = False

# USERCALLBACK
usercallback_afterRelease()

if (not MovePerformed):
  MoveFromTarget(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:

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 .

  • No labels