# create target - grasping keyframe has position of pcb, search for next keyframe in sequence that is pick keyframe. Need position of PCB in picking key frame. Will estimate transformation based on pose of PCB and grasping state in the actual scene and in the keyframe. Will apply this transformation to PCB transformation in the picking keyframe. call ros service - input PCB transform in ... -> transformation -> store in kif for now
# call OMG to do pick of PCB with context.KeyFrame as parameter -> specified return values
# transform: Need the cover transformation - in robot system
# apply above transform to the PCB position in the move keyframe
# only relative positions
# call OMG to move - parameter: target position of pcb in robot coordinate system
pass
deffolding_align():
# AssemblyType/id=folding, description=align
# need to apply transformation of cover to get pcb target in robot coordinate system
# call move operation for align target using OMG service
pass
deffolding_contact():
# AssemblyType/id=folding, description=contact
# need to apply transformation of cover to get pcb target in robot coordinate system
# call move action from OMG for contacting cover
# need feedback from force sensor:
# 1. get contact feedback before reaching target
# 2. reaching target without contact - should move further until contact (with limit) - HRI feedback?
# Mockup - if state terminates without contact call identify object again and locate pcb
# Strategy what to do with object detector information in case of no contact - go back to align with corrected parameters
# If there is contact - first call folding controller and then ask HRI to verify if contact is ok
pass
deffolding_callfoldingcontroller():
# No keyframe - incorporate automatically in sequence of a folding/contact state
# call foldingcontroller with appropriate parameters as specified by KTH
pass
deffolding_calldeformationcontroller():
# For later (after november)
pass
deffolding_verifyfold():
# No keyframe
# Call HRI to prompt user to examine the assembly status - specified outcome yes, no
pass
defcompleted_assembly():
# No keyframe
# Let go of pcb - open gripper
# If not ok - transition back to align
pass
defretract():
# AssemblyType=general, description=retract
# retract from current pose in specified direction
pass
defgotoinitialposition():
# Go to initial position
pass
deffinish(context):
pass
# Context
# Python hashtable called "dict" - contains an attribute dom - which is dom object of the keyframe xml, as well as attributes specified in a comma-separated string sent with the state machine