def generateFeetForDebris(affs=None):

    affs = affs or om.getObjects()
    affs = [aff for aff in affs if isinstance(aff, BlockAffordanceItem)]

    stanceWidth = 0.20

    nameMap = {
              'board A'  : '02_2x6_1',
              'board B'  : '03_2x6_3',
              'board C'  : '04_4x4x40_4',
              'board E'  : '07_4x4x20_4',
              'board F'  : '09_2x4_4',
              'board G'  : '10_4x4x40_2',
              'board H'  : '12_2x4_3',
              }

    stances = {
              '02_2x6_1' : (-0.323615,-0.334221,0.66,1.54697),
              '03_2x6_3' : (-0.48553,-0.437538,0.7,1.57),
              '04_4x4x40_4' : (-0.65425,-0.527123,0.66,1.58678),
              '07_4x4x20_4' : (-0.378337,-0.364018,0.66,1.62164),
              '09_2x4_4' : (-0.353197,-0.450592,0.79,1.54697),
              '10_4x4x40_2' : (-0.581364,-0.0076541,0.82,1.58029),
              '12_2x4_3' : (-0.353395,-0.450592,0.79,1.54649),
              '14_2x4_1' : (-0.598935,-0.498268,0.66,1.56923),
              }


    referenceFrame = vtk.vtkTransform()
    referenceFrame.Translate(0, 0, 5.0)

    stanceRotation = 0.0
    stanceOffset = [-0.48, -0.08, 0]

    for aff in affs:
        name = aff.getProperty('Name')
        if name not in nameMap:
            print 'name not found:', name
            continue

        affGroundFrame = computeGroundFrame(aff, referenceFrame)
        stanceOffsetX, stanceOffsetY, pelvisHeight, stanceRotation = stances[nameMap[name]]

        stanceFrame, lfootFrame, rfootFrame = getFootFramesFromReferenceFrame(affGroundFrame, stanceWidth, math.degrees(stanceRotation), [stanceOffsetX, stanceOffsetY, 0.0])

        publishTriad(stanceFrame)

        showFrame(affGroundFrame, name + ' ground frame', parent='board debug', scale=0.15, visible=True)
        lfootFrame = showFrame(lfootFrame, name + ' lfoot frame', parent='board debug', scale=0.07)
        rfootFrame = showFrame(rfootFrame, name + ' rfoot frame', parent='board debug', scale=0.07)

        lfoot, rfoot = loadFeet()
        lfoot = showPolyData(lfoot, name + ' l_foot', parent='board debug')
        lfoot.actor.SetUserTransform(lfootFrame.transform)
        rfoot = showPolyData(rfoot, name + ' r_foot', parent='board debug')
        rfoot.actor.SetUserTransform(rfootFrame.transform)


        #for obj in [lfootFrame, rfootFrame]:
        #    obj.addToView(app.getDRCView())
dataset/ETHPy150Open RobotLocomotion/director/src/python/director/debristask.py/generateFeetForDebris/original