<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi,<br>
<br>
connect_to is not supported for task proxies. Have a look at <br>
<a class="moz-txt-link-freetext" href="http://www.rock-robotics.org/master/documentation/graphical_user_interface/200_simple_gui.html">http://www.rock-robotics.org/master/documentation/graphical_user_interface/200_simple_gui.html</a>
for an overview how to use the async API.<br>
<br>
In the particular case use either <br>
<br>
task.port("odometry_samples").on_data do |data| <br>
widget.orientationView.update(data,"odometry_samples") <br>
end <br>
<br>
or the connect logic:<br>
l = lambda do |sample|<br>
widget.orientationView.update(sample,"odometry_samples") <br>
end<br>
connect PORT(:odometry_samples),l<br>
<br>
Alex<br>
<br>
On 04/29/2013 05:13 PM, "Raúl Domínguez" wrote:<br>
</div>
<blockquote
cite="mid:1343043967.46528.1367248430348.JavaMail.open-xchange@ox6.dfki.de"
type="cite">
<meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
<div> Hello, </div>
<div> </div>
<div> I am working with the master branch just updated. </div>
<div> </div>
<div> Running this script: </div>
<div> </div>
<div> """ </div>
<div> require 'vizkit' <br>
<br>
Orocos::CORBA.name_service.ip = "seekurjr" <br>
Orocos.initialize <br>
<br>
# load GUI created with the Qt Designer <br>
widget = Vizkit.load "gui/heading.ui" <br>
widget.show <br>
<br>
</div>
<div> # connect the widget with the task "simple_task" <br>
widget.connect_to_task "seekurjr/seekur_odometry" do |task| <br>
<br>
<br>
task.port("odometry_samples").connect_to do |data,port_name|
<br>
widget.orientationView.update(data,port_name) <br>
end <br>
<br>
end <br>
<br>
</div>
<div> widget.connect_to_task "seekurjr/seekur_corridor_servoing"
do |task| <br>
<br>
# generate a new sample each time the button is clicked <br>
# and show a message box if there is a connection error <br>
g = lambda{widget.headingSpinBox.value} <br>
c = lambda{|msg| Qt::MessageBox.warning(widget,"ComErr",msg)
if msg != "OK"} <br>
headingSendButton.connect SIGNAL(:clicked),
PORT(:heading),:getter => g,:callback => c <br>
<br>
# disable the GUI until the task is reachable <br>
task.on_reachable {widget.setEnabled(true)} <br>
task.on_unreachable {widget.setEnabled(false)} <br>
end <br>
<br>
#run qt main loop <br>
Vizkit.exec <br>
""" </div>
<div> </div>
<div> Gives the following error when clicking the
headingSendButton: </div>
<div> </div>
<div> </div>
<div> """ </div>
<div>
/home/virgo/virgo_rock/tools/orocos.rb/lib/orocos/async/ports.rb:374:in
`connect_to': wrong number of arguments (0 for 2)
(ArgumentError) <br>
from
/home/virgo/virgo_rock/tools/orocos.rb/lib/orocos/async/ports.rb:374:in
`call' <br>
from
/home/virgo/virgo_rock/tools/orocos.rb/lib/orocos/async/ports.rb:374:in
`write' <br>
from
/home/virgo/virgo_rock/tools/utilrb/lib/utilrb/event_loop.rb:313:in
`call' <br>
from
/home/virgo/virgo_rock/tools/utilrb/lib/utilrb/event_loop.rb:313:in
`defer' <br>
from
/home/virgo/virgo_rock/tools/utilrb/lib/utilrb/event_loop.rb:161:in
`call' <br>
from
/home/virgo/virgo_rock/tools/utilrb/lib/utilrb/event_loop.rb:161:in
`call' <br>
from
/home/virgo/virgo_rock/tools/utilrb/lib/utilrb/event_loop.rb:612:in
`step' <br>
from
/home/virgo/virgo_rock/tools/utilrb/lib/utilrb/event_loop.rb:700:in
`call' <br>
from
/home/virgo/virgo_rock/tools/utilrb/lib/utilrb/event_loop.rb:700:in
`handle_errors' <br>
from
/home/virgo/virgo_rock/tools/utilrb/lib/utilrb/event_loop.rb:612:in
`step' <br>
from
/home/virgo/virgo_rock/gui/vizkit/ruby/lib/vizkit/vizkit.rb:125:in
`exec' <br>
from /usr/lib/ruby/1.8/Qt/qtruby4.rb:2427:in `call' <br>
from /usr/lib/ruby/1.8/Qt/qtruby4.rb:2427:in `invoke' <br>
from /usr/lib/ruby/1.8/Qt/qtruby4.rb:469:in
`qt_metacall' <br>
from /usr/lib/ruby/1.8/Qt/qtruby4.rb:469:in
`method_missing' <br>
from /usr/lib/ruby/1.8/Qt/qtruby4.rb:469:in `exec' <br>
from
/home/virgo/virgo_rock/gui/vizkit/ruby/lib/vizkit/vizkit.rb:129:in
`exec' <br>
from heading_viz.rb:36 <br>
from
/home/virgo/virgo_rock/tools/utilrb/lib/utilrb/event_loop.rb:619:in
`step' <br>
from
/home/virgo/virgo_rock/gui/vizkit/ruby/lib/vizkit/vizkit.rb:125:in
`exec' <br>
from /usr/lib/ruby/1.8/Qt/qtruby4.rb:2427:in `call' <br>
from /usr/lib/ruby/1.8/Qt/qtruby4.rb:2427:in `invoke' <br>
from /usr/lib/ruby/1.8/Qt/qtruby4.rb:469:in
`qt_metacall' <br>
from /usr/lib/ruby/1.8/Qt/qtruby4.rb:469:in
`method_missing' <br>
from /usr/lib/ruby/1.8/Qt/qtruby4.rb:469:in `exec' <br>
from
/home/virgo/virgo_rock/gui/vizkit/ruby/lib/vizkit/vizkit.rb:129:in
`exec' <br>
from heading_viz.rb:36 </div>
<div> """ </div>
<div> </div>
<div> </div>
<div> Thanks, </div>
<div> Raúl </div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Rock-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Rock-dev@dfki.de">Rock-dev@dfki.de</a>
<a class="moz-txt-link-freetext" href="http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev">http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
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: <a class="moz-txt-link-abbreviated" href="mailto:alexander.duda@dfki.de">alexander.duda@dfki.de</a>
Weitere Informationen: <a class="moz-txt-link-freetext" href="http://www.dfki.de/robotik">http://www.dfki.de/robotik</a>
-----------------------------------------------------------------------
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
</pre>
</body>
</html>