[Rock-dev] How to explicit assign task ports to service ports?

Christian Rauch Christian.Rauch at dfki.de
Tue Sep 3 15:48:26 CEST 2013


I forgot to mention that I am on next. I therefore changed line 315 
according to your suggestion, i.e.:
{{{
def method_missing(m, *args, &block)
     if m.to_s =~ /^(\w+)_port$/
         port_name = $1.to_s
         mapped_port_name = 
@composition_task.map_child_port(@child_name, port_name)
         [...]
}}}

The same error occurs and the backtrace is:
{{{
15:47:25.897 (Roby) uncaught exception in an event handler of the start 
event of Trigger::GyroMonitor:0x4da12c8
15:47:25.897 (Roby) called during the propagation of [15:47:25.620 @8] 
Trigger::GyroMonitor:0x4da12c8{conf => [default]}[]/start
15:47:25.897 (Roby) 
/home/seekurjr/virgo_next/tools/orocos.rb/lib/orocos/ports_searchable.rb:68:in 
`find_port': /wrappers/VectorX</double> is provided by multiple ports 
prediction_value: dbg_prediction_valueN, prediction_value (ArgumentError)
15:47:25.897 (Roby) 
/home/seekurjr/virgo_next/tools/orocos.rb/lib/orocos/ports_searchable.rb:68:in 
`find_port'
15:47:25.897 (Roby)   ./models/blueprints/triggers.rb:87:in `block in 
<class:GyroMonitor>'
15:47:25.898 (Roby)
15:47:25.898 (Roby) EE: will kill the following tasks because of 
unhandled exceptions:
15:47:25.898 (Roby)   Trigger::GyroMonitor:0x4da12c8{conf => [default]}[]
15:47:25.919 (Robot seekurjr) cleaning up 
Logger::Logger:0x4c2f408{orocos_name => seekur_monitor_Logger, conf => 
[default]}[]
}}}

Regards,
Christian


Am 03.09.2013 15:26, schrieb Matthias Goldhoorn:
> i assume this is a mistake within the attribute_missing implementation
> of composition...
>
> try to add (.to_s) to syskit/lib/syskit/composition.rb line 256
>
> 256                         port_name = $1.to_s
>
> and re-run your application. There should also no need to call
> .to_orocos_port
>
> Please attach if this does not solve your problem the whole backtrace..
>
> Matthias
>
>
>
>
> On 03.09.2013 14:57, Christian Rauch wrote:
>> Hello,
>>
>> I assigned a service to a task:
>> {{{
>> provides Trigger::PredictorSrv,
>>            'prediction' =>  'prediction_value',
>>            :as =>  'predictor'
>> }}}
>>
>> whose service port "prediction" is later on accessed by
>> "gyro_prediction_child.as(PredictorSrv).prediction_port.to_orocos_port".
>>
>> Doing this results in this error:
>> {{{
>> |
>> /home/seekurjr/virgo_next/tools/orocos.rb/lib/orocos/ports_searchable.rb:68:in
>> `find_port': /wrappers/VectorX</double>  is provided by multiple ports
>> prediction_value: dbg_prediction_valueN, prediction_value (ArgumentError)
>> }}}
>>
>> I assume here, that the task port name "prediction_value" that I gave
>> explicitly in the definition is used as a search term (two ports of the
>> task match that substring and have same type) instead as the port I want.
>>
>> Is this the desired behaviour? Can I deactivate this behaviour and have
>> syskit use that port, that I explicitly gave in my service assignment?
>>
>> Regards,
>> Christian
>>
>>
>
>

-- 
  Christian Rauch
  Space Robotics

  Universität Bremen
  FB 3 - Mathematik und Informatik
  AG Robotik
  Robert-Hooke-Straße 5
  28359 Bremen, Germany

  Tel:     +49 (0)421 178 45-6619
  Empfang: +49 (0)421 178 45-6611
  Fax:     +49 (0)421 178 45-4150
  E-Mail:  Christian.Rauch at dfki.de

  Weitere Informationen: http://www.informatik.uni-bremen.de/robotik



More information about the Rock-dev mailing list