예제 #1
0
      ('Select parent...', onSelectAffordanceParent),
      ]

    return actions


viewbehaviors.registerContextMenuActions(getAffordanceContextMenuActions)


app = mainwindowapp.construct()
view = app.view


affordanceManager = affordancemanager.AffordanceObjectModelManager(view)

if affordancemanager.lcmobjectcollection.USE_LCM:
    affordanceitems.MeshAffordanceItem.getMeshManager().collection.sendEchoRequest()
    affordanceManager.collection.sendEchoRequest()

objectPicker = pointpicker.ObjectPicker(view=view, callback=onAffordancePick, getObjectsFunction=affordanceManager.getAffordances)


panel = affordancepanel.AffordancePanel(view, affordanceManager)
dock = app.app.addWidgetToDock(panel.widget, QtCore.Qt.RightDockWidgetArea)

printButton = QtGui.QPushButton('Print URDF')
printButton.connect('clicked()', printAffordanceUrdf)
panel.ui.spawnTab.layout().addWidget(printButton)

app.app.start()
예제 #2
0

def testSDF():
    print("Testind SDF loader")
    n_pre = len(affordanceManager.getAffordances())

    dataDir = app.getTestingDataDirectory()
    filename = os.environ['DRC_BASE'] + '/software/models/worlds/tabledemo.sdf'
    sc = sceneloader.SceneLoader()
    print("Loading " + filename)
    sc.loadSDF(filename)

    n_post = len(affordanceManager.getAffordances())
    print("Number of affordances loaded: " + str(n_post - n_pre))
    assert n_post > n_pre


testCollection()
testAffordanceToUrdf()
loadTableTopPointCloud()
segmentTableTopPointCloud()
testSDF()

from director import affordancepanel
panel = affordancepanel.AffordancePanel(view, affordanceManager,
                                        robotStateJointController,
                                        raycastDriver)
panel.widget.show()

app.start()