def computeDebrisStanceFrame(aff):

    debrisReferenceFrame = om.findObjectByName('debris reference frame')
    debrisWallEdge = om.findObjectByName('debris plane edge')

    if debrisReferenceFrame and debrisWallEdge:

        debrisReferenceFrame = debrisReferenceFrame.transform

        affGroundFrame = computeGroundFrame(aff, debrisReferenceFrame)

        updateFrame(affGroundFrame, 'board ground frame', parent=getDebugFolder(), visible=False)

        affWallEdge = computeGroundFrame(aff, debrisReferenceFrame)

        framePos = np.array(affGroundFrame.GetPosition())
        p1, p2 = debrisWallEdge.points
        edgeAxis = p1 - p2
        edgeAxis /= np.linalg.norm(edgeAxis)
        projectedPos = p1 + edgeAxis * np.dot(framePos - p1, edgeAxis)

        affWallFrame = vtk.vtkTransform()
        affWallFrame.PostMultiply()

        useWallFrameForRotation = True

        if useWallFrameForRotation:
            affWallFrame.SetMatrix(debrisReferenceFrame.GetMatrix())
            affWallFrame.Translate(projectedPos - np.array(debrisReferenceFrame.GetPosition()))

            stanceWidth = 0.20
            stanceOffsetX = -0.35
            stanceOffsetY = 0.45
            stanceRotation = 0.0

        else:
            affWallFrame.SetMatrix(affGroundFrame.GetMatrix())
            affWallFrame.Translate(projectedPos - framePos)

            stanceWidth = 0.20
            stanceOffsetX = -0.35
            stanceOffsetY = -0.45
            stanceRotation = math.pi/2.0

        stanceFrame, _, _ = getFootFramesFromReferenceFrame(affWallFrame, stanceWidth, math.degrees(stanceRotation), [stanceOffsetX, stanceOffsetY, 0.0])

        return stanceFrame
dataset/ETHPy150Open RobotLocomotion/director/src/python/director/segmentation.py/computeDebrisStanceFrame/swapped operands of `-`