RobotLocomotion / director

A robotics interface and visualization framework, with extensive applications for working with http://drake.mit.edu
BSD 3-Clause "New" or "Revised" License
178 stars 86 forks source link

How to know director installed properly? #609

Closed hoangcuongbk80 closed 6 years ago

hoangcuongbk80 commented 6 years ago

I downloaded and built the Director source code using make superbuild, then I tested with the flowing code:

from ddapp.consoleapp import ConsoleApp from ddapp.debugVis import DebugData import ddapp.visualization as vis

app = ConsoleApp() view = app.createView() view.showMaximized()

d = DebugData() d.addSphere(center=(0,0,0), radius=0.5)

sphere = vis.showPolyData(d.getPolyData(), 'sphere') sphere.setProperty('Color', [0,1,0])

app.start()

And get the error: ImportError: No module named ddapp.consoleapp

The test code from: https://openhumanoids.github.io/director/tutorials/visualization/draw_shapes.html

patmarion commented 6 years ago

oops, sorry that example code is out of date. the main module was renamed from ddapp to director several years ago but that code was missed. i just merged a PR to fix it:

https://github.com/RobotLocomotion/director/pull/610

Here is the command line that should work, assuming you've pulled master to get the latest version:

build/install/bin/directorPython docs/sphinx/tutorials/visualization/drawShapes.py

There are lots of other examples in the src/python/tests folder. For example, here are some command lines:

build/install/bin/directorPython src/python/tests/testDebugVis.py

build/install/bin/directorPython src/python/tests/testMainWindowApp.py

build/install/bin/directorPython src/python/tests/testImageView.py 

# double click the frame widget to enable interaction
build/install/bin/directorPython src/python/tests/testFrameTrace.py

build/install/bin/directorPython src/python/tests/testDepthScanner.py

# note some test files will open application windows and then exit immediately
# but you can modify the test file to avoid exitting
build/install/bin/directorPython src/python/tests/testObjectModel.py
build/install/bin/directorPython src/python/tests/testPropertiesPanel.py

To run all the tests automatically:

cd build/src/director-build
ctest
hoangcuongbk80 commented 6 years ago

Perfect! Thanks a lot.