def spawnDoorAffordance(self):

        groundFrame = self.computeGroundFrame(self.robotModel)

        doorOffsetX = 0.7
        doorOffsetY = 0.0

        doorGroundFrame = transformUtils.frameFromPositionAndRPY([doorOffsetX, 0.0, 0.0], [0.0, 0.0, 0.0])
        doorGroundFrame.PostMultiply()
        doorGroundFrame.Concatenate(groundFrame)

        stanceFrame = transformUtils.frameFromPositionAndRPY([0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
        stanceFrame.PostMultiply()
        stanceFrame.Concatenate(groundFrame)

        doorWalkFrame = transformUtils.frameFromPositionAndRPY([doorOffsetX + 0.6, 0.0, 0.0], [0.0, 0.0, 0.0])
        doorWalkFrame.PostMultiply()
        doorWalkFrame.Concatenate(groundFrame)


        doorWidth = 36 * 0.0254
        doorHeight = 81 * 0.0254
        doorDepth = 0.5 * 0.0254

        doorSide = 1 if self.graspingHand == 'left' else -1
        handleHeightFromGround = 35 * 0.0254
        handleDistanceFromEdge = 1.625 * 0.0254
        handleDistanceFromDoor = 1.75 * 0.0254
        handleLength = 4.125 * 0.0254
        handleDepth = 0.25 * 0.0254

        doorJamWidth = 0.5
        doorJamDepth = 4.5 * 0.0254


        handleFrame = transformUtils.frameFromPositionAndRPY([-handleDistanceFromDoor - doorDepth/2.0 - handleDepth/2, doorSide*(doorWidth/2.0 - handleDistanceFromEdge - handleLength/2.0), handleHeightFromGround], [0.0, 0.0, 0.0])
        handleFrame.PostMultiply()
        handleFrame.Concatenate(doorGroundFrame)


        doorFrame = transformUtils.frameFromPositionAndRPY([0.0, 0.0, doorHeight/2.0], [0.0, 0.0, 0.0])
        doorFrame.PostMultiply()
        doorFrame.Concatenate(doorGroundFrame)


        leftDoorJamFrame = transformUtils.frameFromPositionAndRPY([0.0, (doorWidth/2.0 + doorJamWidth/2.0), doorHeight/2.0], [0.0, 0.0, 0.0])
        leftDoorJamFrame.PostMultiply()
        leftDoorJamFrame.Concatenate(doorGroundFrame)

        rightDoorJamFrame = transformUtils.frameFromPositionAndRPY([0.0, -(doorWidth/2.0 + doorJamWidth/2.0), doorHeight/2.0], [0.0, 0.0, 0.0])
        rightDoorJamFrame.PostMultiply()
        rightDoorJamFrame.Concatenate(doorGroundFrame)



        desc = dict(classname='BoxAffordanceItem', Name='door handle',
           pose=transformUtils.poseFromTransform(handleFrame), Dimensions=[handleDepth, handleLength, 0.02], Color=[0.0, 1.0, 0.0])
        handleAffordance = segmentation.affordanceManager.newAffordanceFromDescription(desc)

        desc = dict(classname='BoxAffordanceItem', Name='door',
           pose=transformUtils.poseFromTransform(doorFrame), Dimensions=[doorDepth, doorWidth, doorHeight], Color=[0.5, 0.5, 0.5])
        doorAffordance = segmentation.affordanceManager.newAffordanceFromDescription(desc)

        desc = dict(classname='BoxAffordanceItem', Name='left door jam',
           pose=transformUtils.poseFromTransform(leftDoorJamFrame), Dimensions=[doorJamDepth, doorJamWidth, doorHeight], Color=[0.7, 0.0, 0.0])
        leftDoorJamAffordance = segmentation.affordanceManager.newAffordanceFromDescription(desc)

        desc = dict(classname='BoxAffordanceItem', Name='right door jam',
           pose=transformUtils.poseFromTransform(rightDoorJamFrame), Dimensions=[doorJamDepth, doorJamWidth, doorHeight], Color=[0.7, 0.0, 0.0])
        rightDoorJamAffordance = segmentation.affordanceManager.newAffordanceFromDescription(desc)


        doorGroundFrame = vis.showFrame(doorGroundFrame, 'door ground frame', parent=doorAffordance)
        stanceFrame = vis.showFrame(stanceFrame, 'door stance frame', parent=doorAffordance)

        doorWalkFrame = vis.showFrame(doorWalkFrame, 'door walk frame', visible=False, parent=doorAffordance)


        doorFrame = doorAffordance.getChildFrame()
        handleFrame = handleAffordance.getChildFrame()

        leftDoorJamFrame = leftDoorJamAffordance.getChildFrame()
        rightDoorJamFrame = rightDoorJamAffordance.getChildFrame()

        self.doorFrameSync = vis.FrameSync()
        self.doorFrameSync.addFrame(doorGroundFrame)
        self.doorFrameSync.addFrame(stanceFrame, ignoreIncoming=True)
        self.doorFrameSync.addFrame(doorWalkFrame, ignoreIncoming=True)
        self.doorFrameSync.addFrame(doorFrame, ignoreIncoming=True)
        self.doorFrameSync.addFrame(leftDoorJamFrame, ignoreIncoming=True)
        self.doorFrameSync.addFrame(rightDoorJamFrame, ignoreIncoming=True)

        self.doorHandleFrameSync = vis.FrameSync()
        self.doorHandleFrameSync.addFrame(doorFrame)
        self.doorHandleFrameSync.addFrame(handleFrame, ignoreIncoming=True)


        self.findDoorHandleAffordance()
        self.doorGroundFrame = doorGroundFrame
        self.doorHandleStanceFrame = stanceFrame
        self.doorWalkFrame = doorWalkFrame
dataset/ETHPy150Open RobotLocomotion/director/src/python/director/doordemo.py/DoorDemo.spawnDoorAffordance/original