panel_test.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import roslib; roslib.load_manifest('rviz')
00004 import sys
00005 import rviz
00006 from QtGui import *
00007 from QtCore import *
00008 
00009 app = QApplication( sys.argv )
00010 
00011 def do_top():
00012     global frame
00013     frame.setTargetFrame( "<Fixed Frame>" );
00014     frame.setViewString( "1.5548 2.3904 10 0 0 0" )
00015 
00016 def do_side():
00017     global frame
00018     frame.setTargetFrame( "<Fixed Frame>" );
00019     frame.setViewString( "0.0903987 1.5854 10 0 0 0" )
00020 
00021 def do_quit():
00022     print 'Quitting.'
00023     app.quit()
00024 
00025 def fun():
00026     global frame
00027 
00028     top = QPushButton( "Top" )
00029     top.clicked.connect( do_top )
00030 
00031     side = QPushButton( "Side" )
00032     side.clicked.connect( do_side )
00033 
00034     quit_btn = QPushButton( "Quit" )
00035     quit_btn.clicked.connect( do_quit )
00036 
00037     button_layout = QVBoxLayout()
00038     button_layout.addWidget( top )
00039     button_layout.addWidget( side )
00040     button_layout.addWidget( quit_btn )
00041 
00042     frame = rviz.VisualizationPanel()
00043 
00044     main_layout = QHBoxLayout()
00045     main_layout.addLayout( button_layout )
00046     main_layout.addWidget( frame )
00047 
00048     main_window = QWidget()
00049     main_window.setLayout( main_layout )
00050     main_window.show()
00051 
00052     app.exec_()
00053 
00054 fun()
00055 
00056 sys.exit()


rviz
Author(s): Dave Hershberger, Josh Faust
autogenerated on Mon Jan 6 2014 11:54:32