[Rock-dev] Problem using different configurations with Roby

Allan E. Conquest allan.conquest at dfki.de
Fri Jan 20 16:05:51 CET 2012


Hi,

I want to use the configuration 'wall_servoing' for the 'sonar' device
only when the 'wall' mission is active, as introduced by the define (see
below). In the general case, the default configuration is fine.

The problem occurs when I change the define to use the specific
configuration. Below, I listed a small overview of the setup, the
working define (only default config) and the define with my desired
configuration which leads to the added error message.

Statements:

#device setup for the simulation
device(Dev::MarsSonar, :as => 'sonar', :using =>
AvalonSimulation::SonarTop).
         period(0.1)

data_service_type 'SonarScanProvider' do
    output_port 'sonarscan', '/base/samples/SonarBeam'
end

composition 'WallDetector' do
    event :wall_servoing
    event :searching_wall
    event :checking_wall
    event :detected_corner

    add Srv::SonarScanProvider
    add SonarFeatureEstimator::Task, :as => 'scans'
    add Srv::Orientation
    add_main WallServoing::Task , :as => 'detector'
    autoconnect

    export detector.position_command, :as => 'relative_position_command'
    provides Srv::RelativePositionDetector
end


Configuration file AvalonSimulation::SonarTop.yml

--- name:default
start_angle: 3.141592654
end_angle: -3.141592654
resolution: 0.1
maximum_distance: 50.0
ping_pong_mode: false
--- name:wall_servoing
start_angle: 0.78
end_angle: -0.78
ping_pong_mode: true


Working default define:

define('wall', Cmp::VisualServoing.use(Cmp::WallDetector.use('sonar')))


Problem with new define:

wall_sonar = device('sonar').use_conf('default', 'wall_servoing')
define('wall', Cmp::VisualServoing.use(Cmp::WallDetector.use(wall_sonar)))


Produced error message:

Orocos: Engine#resolve failed and rolled back
Orocos: Retrying to remove obsolete tasks ...

= Orocos::RobyPlugin::AvalonSimulation::SonarTop:0x7f2d5cc3c5b8{conf =>
[default, wall_servoing], mars_sonar_name => sonar}[] has no output port
called sonarscan (ArgumentError)
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/connection_graphs.rb:149:in
`ensure_has_output_port',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/connection_graphs.rb:270:in
`connect_ports',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/connection_graphs.rb:269:in
`each',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/connection_graphs.rb:269:in
`connect_ports',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/compositions.rb:2177:in
`instanciate',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/compositions.rb:2176:in
`each',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/compositions.rb:2176:in
`instanciate',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/instance_spec.rb:1078:in
`instanciate',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/compositions.rb:1910:in
`instanciate_child',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/compositions.rb:2076:in
`instanciate',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/compositions.rb:2059:in
`delete_if',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/compositions.rb:2059:in
`instanciate',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/instance_spec.rb:345:in
`instanciate',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/engine.rb:110:in
`instanciate',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/engine.rb:740:in
`add_instance',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/engine.rb:723:in
`instanciate',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/engine.rb:722:in
`each',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/engine.rb:722:in
`instanciate',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/engine.rb:1067:in
`compute_system_network',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/engine.rb:1463:in
`resolve',
|   /home/allan/dev/AVALON/tools/roby/lib/roby/plan.rb:724:in
`in_transaction',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/engine.rb:1445:in
`resolve',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/scripts/instanciate.rb:203,
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/scripts/instanciate.rb:188:in
`each',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/scripts/instanciate.rb:188,
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/scripts/common.rb:193:in
`run',
|   /home/allan/dev/AVALON/tools/roby/lib/roby/exceptions.rb:339:in
`display_exception',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/scripts/common.rb:173:in
`run',
|  
/home/allan/dev/AVALON/tools/orocos.rb/lib/orocos/roby/scripts/instanciate.rb:185,
|   /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require',
|   /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require',
|   scripts/orocos/instanciate:3


The tasks providing Srv::SonarScanProvider have differently named output
ports but this is no problem with the default configuration (which is
done omitting the use_conf command).

Can somebody please give me a hint how to do it right?

Kind regards,

Allan


More information about the Rock-dev mailing list