def spawnTargetAffordance(self):
        for obj in om.getObjects():
             if obj.getProperty('Name') == 'target':
                 om.removeFromObjectModel(obj)

        targetFrame = transformUtils.frameFromPositionAndRPY([0.6,0.2,0.6],[180,0,90])

        folder = om.getOrCreateContainer('affordances')
        z = DebugData()
        z.addLine(np.array([0,0,0]), np.array([-self.boxLength,0,0]), radius=0.02) # main bar
        z.addLine(np.array([-self.boxLength,0,0]), np.array([-self.boxLength,0,self.boxLength]), radius=0.02) # main bar
        z.addLine(np.array([-self.boxLength,0,self.boxLength]), np.array([0,0,self.boxLength]), radius=0.02) # main bar
        z.addLine(np.array([0,0,self.boxLength]), np.array([0,0,0]), radius=0.02) # main bar
        targetMesh = z.getPolyData()

        self.targetAffordance = vis.showPolyData(targetMesh, 'target', color=[0.0, 1.0, 0.0], cls=affordanceitems.FrameAffordanceItem, parent=folder, alpha=0.3)
        self.targetAffordance.actor.SetUserTransform(targetFrame)
        self.targetFrame = vis.showFrame(targetFrame, 'target frame', parent=self.targetAffordance, visible=False, scale=0.2)
        self.targetFrame = self.targetFrame.transform

        params = dict(length=self.boxLength, otdf_type='target', friendly_name='target')
        self.targetAffordance.setAffordanceParams(params)
        self.targetAffordance.updateParamsFromActorTransform()
dataset/ETHPy150Open RobotLocomotion/director/src/python/director/mappingdemo.py/MappingDemo.spawnTargetAffordance/original