[Rock-dev] Usual behavior for import_types_from in supervision?

Christoph Müller christoph.mueller at dfki.de
Mon Jul 25 16:11:29 CEST 2011


Hi all,

i'm currently refactoring some structures in the supervision and got for 
myself an usual behaviour by calling "import_types_from". I'm not sure 
if this is a bug or a wrong usage from me side for this case.

Here's a simplified szenario, what i've observed:

========================================
Assume we have the following orogen module "X":
========================================

# x.orogen
name "x"

import_types_from "tasks/structs/sample.h"

task_context "Task" do
   output_port "sample", "/x/data"  # where x::data struct is defined in 
tasks/structs/sample.h
end

========================================
Supervision
========================================

In supervision i want to define a simple SampleProvider for this case e.g.:

# tasks/data_services/providers.rb
import_types_from "x" # In order to know /x/data type

data_service_type "SampleProvider"
   output_port "sample", "/x/data"
end

---------------------------

#tasks/orogen/x.rb
class X::Task
   provides Srv::SampleProvider
end


When i try to start the supervision, i'll get the following backtrace:

= uninitialized constant 
Orocos::RobyPlugin::DataServices::SampleProvider (NameError)
| ./tasks/orogen/x.rb
| ./tasks/data_services/providers.rb:1
| ./scripts/run:3

=> What here actually happens:
import_types_from "x" finds the file: tasks/orogen/x.rb
and tries to load it before the SampleProvider declaration is calling. 
In my case i was expecting
it should load it's original orogen module instead its representation in 
the supervision located
in the tasks/orogen folder.

Greetings
Chris






More information about the Rock-dev mailing list