Discussion:
[Rock-dev] rock-display crash when trying to display Vector3d as subfield
Leif Christensen
2014-10-21 19:34:02 UTC
Permalink
Hi,

I'm writing a std::vector<base::samples::IMUSensors> to a port.
rock-display can display the Vector3d members of each entry in the
vector, but trying to vizualize one of them with Plot2d crashes
/home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:430:in `block in subfield': undefined method `raw_get' for #<Typelib::ContainerType::DeepCopyArray:0x0000000556e6e0> (NoMethodError)
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:423:in `each'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:423:in `subfield'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:348:in `block in on_data'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:299:in `block in on_data'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:51:in `call'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:51:in `call'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/ports.rb:101:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:305:in `block in really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:301:in `each'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:301:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/ports.rb:300:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:305:in `block in really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:301:in `each'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:301:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:294:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:287:in `block in add_listener'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:158:in `call'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:158:in `call'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:615:in `block in step'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:704:in `call'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:704:in `handle_errors'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:615:in `step'
from /home/leifole/dev/rock/magneto/gui/vizkit/lib/vizkit/vizkit.rb:142:in `block in exec'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:2427:in `call'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:2427:in `invoke'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `qt_metacall'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `method_missing'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `exec'
from /home/leifole/dev/rock/magneto/gui/vizkit/lib/vizkit/vizkit.rb:146:in `exec'
from /home/leifole/dev/rock/magneto/gui/vizkit/bin/rock-display:107:in `<main>'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:622:in `step'
from /home/leifole/dev/rock/magneto/gui/vizkit/lib/vizkit/vizkit.rb:142:in `block in exec'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:2427:in `call'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:2427:in `invoke'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `qt_metacall'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `method_missing'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `exec'
from /home/leifole/dev/rock/magneto/gui/vizkit/lib/vizkit/vizkit.rb:146:in `exec'
from /home/leifole/dev/rock/magneto/gui/vizkit/bin/rock-display:107:in `<main>'
In task_context_proxy.rb, the function subfield(sample,field) of class
SubGroupProxy does some checks on types, but only after calling
sample.raw_get . Do I have to do some typelib magic?

Btw, visualizing Vector3d members of IMUSensors not in a container works
fine.

Regards,
Leif
--
Leif Christensen

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

Phone: +49 (0)421 17845-4149
Fax: +49 (0)421 17845-4150
E-Mail: leif.christensen 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
-----------------------------------------------------------------------
Sylvain Joyeux
2014-10-21 21:30:03 UTC
Permalink
My guess is that SubPortProxy#on_data should not call super but
on_raw_data. The whole subfield access can only work when using
on_raw_data.

Try replacing with this (untested, might have some syntax errors ...)

def on_data(policy = Hash.new)
on_raw_data(policy) do |sample|
sample = Typelib.to_ruby(sample) if sample
yield(sample)
end
end

On Tue, Oct 21, 2014 at 5:34 PM, Leif Christensen
Post by Leif Christensen
Hi,
I'm writing a std::vector<base::samples::IMUSensors> to a port.
rock-display can display the Vector3d members of each entry in the
vector, but trying to vizualize one of them with Plot2d crashes
/home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:430:in `block in subfield': undefined method `raw_get' for #<Typelib::ContainerType::DeepCopyArray:0x0000000556e6e0> (NoMethodError)
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:423:in `each'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:423:in `subfield'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:348:in `block in on_data'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:299:in `block in on_data'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:51:in `call'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:51:in `call'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/ports.rb:101:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:305:in `block in really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:301:in `each'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:301:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/ports.rb:300:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:305:in `block in really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:301:in `each'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:301:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:294:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:287:in `block in add_listener'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:158:in `call'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:158:in `call'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:615:in `block in step'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:704:in `call'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:704:in `handle_errors'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:615:in `step'
from /home/leifole/dev/rock/magneto/gui/vizkit/lib/vizkit/vizkit.rb:142:in `block in exec'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:2427:in `call'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:2427:in `invoke'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `qt_metacall'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `method_missing'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `exec'
from /home/leifole/dev/rock/magneto/gui/vizkit/lib/vizkit/vizkit.rb:146:in `exec'
from /home/leifole/dev/rock/magneto/gui/vizkit/bin/rock-display:107:in `<main>'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:622:in `step'
from /home/leifole/dev/rock/magneto/gui/vizkit/lib/vizkit/vizkit.rb:142:in `block in exec'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:2427:in `call'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:2427:in `invoke'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `qt_metacall'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `method_missing'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `exec'
from /home/leifole/dev/rock/magneto/gui/vizkit/lib/vizkit/vizkit.rb:146:in `exec'
from /home/leifole/dev/rock/magneto/gui/vizkit/bin/rock-display:107:in `<main>'
In task_context_proxy.rb, the function subfield(sample,field) of class
SubGroupProxy does some checks on types, but only after calling
sample.raw_get . Do I have to do some typelib magic?
Btw, visualizing Vector3d members of IMUSensors not in a container works
fine.
Regards,
Leif
--
Leif Christensen
DFKI Bremen
Robotics Innovation Center
Robert-Hooke-Stra?e 5
28359 Bremen, Germany
Phone: +49 (0)421 17845-4149
Fax: +49 (0)421 17845-4150
E-Mail: leif.christensen 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
-----------------------------------------------------------------------
_______________________________________________
Rock-dev mailing list
Rock-dev at dfki.de
http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev
Leif Christensen
2014-10-22 09:36:04 UTC
Permalink
Fix works fine on my system, thanks! Created a corresponding pull
request on github rock-core/tools-orocosrb.

Best,
Leif
Post by Sylvain Joyeux
My guess is that SubPortProxy#on_data should not call super but
on_raw_data. The whole subfield access can only work when using
on_raw_data.
Try replacing with this (untested, might have some syntax errors ...)
def on_data(policy = Hash.new)
on_raw_data(policy) do |sample|
sample = Typelib.to_ruby(sample) if sample
yield(sample)
end
end
On Tue, Oct 21, 2014 at 5:34 PM, Leif Christensen
Post by Leif Christensen
Hi,
I'm writing a std::vector<base::samples::IMUSensors> to a port.
rock-display can display the Vector3d members of each entry in the
vector, but trying to vizualize one of them with Plot2d crashes
/home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:430:in `block in subfield': undefined method `raw_get' for #<Typelib::ContainerType::DeepCopyArray:0x0000000556e6e0> (NoMethodError)
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:423:in `each'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:423:in `subfield'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:348:in `block in on_data'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:299:in `block in on_data'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:51:in `call'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:51:in `call'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/ports.rb:101:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:305:in `block in really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:301:in `each'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:301:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/ports.rb:300:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:305:in `block in really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:301:in `each'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:301:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/task_context_proxy.rb:294:in `really_add_listener'
from /home/leifole/dev/rock/magneto/tools/orocos.rb/lib/orocos/async/object_base.rb:287:in `block in add_listener'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:158:in `call'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:158:in `call'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:615:in `block in step'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:704:in `call'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:704:in `handle_errors'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:615:in `step'
from /home/leifole/dev/rock/magneto/gui/vizkit/lib/vizkit/vizkit.rb:142:in `block in exec'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:2427:in `call'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:2427:in `invoke'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `qt_metacall'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `method_missing'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `exec'
from /home/leifole/dev/rock/magneto/gui/vizkit/lib/vizkit/vizkit.rb:146:in `exec'
from /home/leifole/dev/rock/magneto/gui/vizkit/bin/rock-display:107:in `<main>'
from /home/leifole/dev/rock/magneto/tools/utilrb/lib/utilrb/event_loop.rb:622:in `step'
from /home/leifole/dev/rock/magneto/gui/vizkit/lib/vizkit/vizkit.rb:142:in `block in exec'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:2427:in `call'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:2427:in `invoke'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `qt_metacall'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `method_missing'
from /usr/lib/ruby/vendor_ruby/1.9.1/Qt/qtruby4.rb:469:in `exec'
from /home/leifole/dev/rock/magneto/gui/vizkit/lib/vizkit/vizkit.rb:146:in `exec'
from /home/leifole/dev/rock/magneto/gui/vizkit/bin/rock-display:107:in `<main>'
In task_context_proxy.rb, the function subfield(sample,field) of class
SubGroupProxy does some checks on types, but only after calling
sample.raw_get . Do I have to do some typelib magic?
Btw, visualizing Vector3d members of IMUSensors not in a container works
fine.
Regards,
Leif
--
Leif Christensen
DFKI Bremen
Robotics Innovation Center
Robert-Hooke-Stra?e 5
28359 Bremen, Germany
Phone: +49 (0)421 17845-4149
Fax: +49 (0)421 17845-4150
E-Mail: leif.christensen 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
-----------------------------------------------------------------------
_______________________________________________
Rock-dev mailing list
Rock-dev at dfki.de
http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev
--
Leif Christensen

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

Phone: +49 (0)421 17845-4149
Fax: +49 (0)421 17845-4150
E-Mail: leif.christensen 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
-----------------------------------------------------------------------
Loading...