[Rock-dev] Use of 3D plugin with 3D widget

Alexander Duda Alexander.Duda at dfki.de
Fri Nov 16 17:41:04 CET 2012


On 11/16/2012 05:24 PM, Pierre Letier wrote:
> Le 11/16/2012 4:49 PM, Alexander Duda a écrit :
>> On 11/16/2012 03:41 PM, Pierre Letier wrote:
>>> Dear,
>>>
>>> I followed the tutorial about 3D Data Visualization. I have a question
>>> regarding the use of plugin with 3D widget. it is said that we can
>>> register several plugins on the same widget. However, when the 
>>> plugin is
>>> created, I don't see any reference to the widget.
>>>
>>> My problem is that I created a gui through Qt Designer where I putted a
>>> 3D widget and a 2Dplot. For the last, I don't have any problem to 
>>> access
>>> it and update the plot with incoming data. However for the 3D widget,
>>> when I create the plugin in ruby, it creates a new window with another
>>> 3D widget. How can I specify that the 3D plugin has to be associated
>>> with the 3D widget of my gui ?
>>>
>>> For the 2Dplot widget and the 3D widget, is it possible to modify the
>>> update rate of the rendering ? What is the limitation ?
>>>
>>> Thank you
>>>
>> Vizkit is using its own 3d Widget to display the 3d plugins as it 
>> does not know that the custom
>> gui has already one. Unfortunately there is currently no nice way to 
>> tell vizkit to use the one from a custom gui. But nevertheless you 
>> can force it by adding the following statement after you
>> required vizkit in your ruby script.
>>
>> Vizkit.instance_variable_set(:@vizkit3d_widget,your_gui.your_vizkit3d_widget) 
>>
>>
>> Greets Alex
>>
> Thanks, it works.  In the mean time, I more or less succeeded also by 
> using "your_gui.your_vizkit3d_widget.addPlugin(rbs_plugin)" with 
> rbs_plugin a reference to the plugin defined by 
> Vizkit.default_loader.RigidBodyStateVisualization. Although I have the 
> 3D rendering in my gui, I have still the other window.
>
> I guess if I have several 3D widgets in my gui, I can you this 
> statement to switch from to to the other ?
Yes, but switching online might have some problems if you are using the 
transformer stack from rock.

>
> Could you also say me if it is possible to modify the graphical update 
> rate of the widgets like 2Dplot and 3D widget ?

You can change the default update frequency with:
Vizkit::OQConnection.update_frequency = 10  # [Hz]

Or you can also set it per connection which is explained here:
https://www.rock-robotics.org/stable/documentation/graphical_user_interface/200_simple_gui.html

Alex

-- 
Dipl.-Ing. Alexander Duda
Unterwasserrobotik

DFKI Bremen
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Phone: +49 (0)421 178-456620
Fax:   +49 (0)421 178-454150
E-Mail: alexander.duda at dfki.de

Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.:    DE 148646973
Steuernummer:  19/673/0060/3



More information about the Rock-dev mailing list