[Rock-dev] Port plotting in orogen

Alexander Duda Alexander.Duda at dfki.de
Wed Jun 8 17:39:41 CEST 2011


On Wed, 2011-06-08 at 15:44 +0200, Alexander Duda wrote:
> On Wed, 2011-06-08 at 15:37 +0200, Sylvain Joyeux wrote:
> > On 06/08/2011 03:19 PM, Ruun wrote:
> > > Hi everyone,
> > >
> > > i need to analyse some port data provided by an orogen module over the
> > > time.
> > >
> > > Does the rock toolchain provides a component, that can be connected to
> > > a port and starts a gui e.g. via vizkit in order to collect the data and
> > > visualize
> > > them in a plotting widget? (So i can see the current curves for the current
> > > collected samples).
> > >
> > > That would be a great help.
> > The standard way to do this in rock is to NOT use a component, but 
> > simply a ruby script that uses vizkit. It works pretty well.
> > 
> > vizkit already has a plotting widget that can be used to that effect 
> > (I'm sorry, I don't know the details of its usage ;-))
> 
> I am currently working on a documentation which will be placed on
> rock-robotics.org the next week.

I just wrote another example to explain someone how to use the plot
widget in combination with the log replay. Maybe it is use full for some
one else (I will put it on rock-dev.org as well).

#!/usr/bin/env ruby
require 'vizkit'
require 'orocos/log'

replay = Orocos::Log::Replay.open(ARGV)
widget = Vizkit.default_loader.PlotWidget
counter = 0;

replay.task_name.port_name.connect_to do |sample,_| 
    widget.addData(counter.to_f,sample.data_point.to_f,0)
    counter += 1
    sample
end
widget.show
Vizkit.control replay
Vizkit.exec


-- 
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