[Rock-dev] logging ruby task ports

Alexander Duda Alexander.Duda at dfki.de
Mon Feb 4 17:25:49 CET 2013


On 02/04/2013 04:48 PM, Felix Rehrmann wrote:
> Hi Alex,
>
> thanks for your quick reply, but that does not solve the problem - still
> getting the same result.
>
> Felix

Felix and I had a short look into the logger implementation and it shows 
that the logger is only accessing
PeerTasks (in this case only tasks which are in the same deployment).

Alex

>
> Am 04.02.2013 16:39, schrieb Alexander Duda:
>> On 02/04/2013 04:22 PM, Felix Rehrmann wrote:
>>> Hi all,
>>>
>>> I wrote a ruby task to which I add ports that should be logged by the
>>> Logger of a given deployment. But the logger says that the given name is
>>> not a proper name (the task can be seen in rock-display).
>>> Details:
>>> The task definition and logger access:
>>>
>>> require 'orocos'
>>>
>>> include Orocos
>>>
>>> Orocos.initialize
>>>
>>> task = Orocos::RubyTaskContext.new('motion_proxy')
>>>
>>> Orocos.load_typekit "base"
>>> Orocos.load_typekit_for "/AriaTypes/samples/Velocity"
>>>
>>> # create ports
>>> task.create_input_port("motion_in","/base/MotionCommand2D")
>>> task.create_input_port("duration","/base/Time")
>>> task.create_input_port("velocity_in","/AriaTypes/samples/Velocity")
>>> task.create_output_port("motion_out","/base/MotionCommand2D")
>>> task.create_output_port("velocity_out","/AriaTypes/samples/Velocity")
>>>
>>> # logging
>>> begin
>>>         logger = Orocos::TaskContext.get 'seekur_Logger'
>>>         if logger.reportPort(task.name, task.motion_out.name)
>>>             puts "Logging to #{logger.name}"
>>>         else
>>>             puts "Could not report the port #{task.motion_out.name} of this
>>> task to #{logger.name}"
>>>             logger = nil
>>>         end
>>> rescue
>>>         logger = nil
>>>         puts "Not logging! Task seekur_Logger must be available!"
>>> end
>>>
>>> The reportPort operations returns false and in the Logger log one can find:
>>> 113.000 [ ERROR  ][OrbRunner] no such component /motion_proxy
>>>
>>> Would be nice if somebody had an idea what goes wrong.
>>>
>>> Thanks
>>>
>>> Felix
>>>
>> The Task name is wrong. You get the right one with:
>>
>> logger.reportPort(task.basename, task.motion_out.name)
>>
>> Alex
>> _______________________________________________
>> Rock-dev mailing list
>> Rock-dev at dfki.de
>> http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev
>



More information about the Rock-dev mailing list