[Rock-dev] roby shell
Chris Mueller
christoph.mueller at dfki.de
Fri Jan 13 13:40:10 CET 2012
Does this helps?
def self.anon_model_factory(parent_model, name,
add_anonmodel = true)
Class.new(parent_model) do
singleton_class.class_eval do
define_method(:remote_name) {
puts "HERE #{name}"
name
}
def self.local_model
#....
if !ancestors.empty?
parent_model = local_model(ancestors)
puts "NAME #{name} - #{parent_model}\n #{ancestors}"
model = unknown_model_factory[parent_model, name]
@@remote_to_local[id] = model
@@local_to_remote[model] = [name, id]
HERE Orocos::RobyPlugin::Deployments::AvalonSimulation
HERE Orocos::RobyPlugin::Deployments::AvalonSimulation
HERE Orocos::RobyPlugin::Deployments::AvalonSimulation
NAME Orocos::RobyPlugin::Deployments::OrogenDefaultEkfSlam__Task -
Orocos::RobyPlugin::Deployment
[[Roby::Task, 0x7f5309ce0348 at druby://musashi:48902],
[Roby::PlanObject, 0x7f5309ce05c8 at druby://musashi:48902],
[Roby::BasicObject, 0x7f5309ce0640 at druby://musashi:48902], [Object,
0x7f5309d86a68 at druby://musashi:48902]]
HERE Orocos::RobyPlugin::Deployments::OrogenDefaultEkfSlam__Task
HERE Orocos::RobyPlugin::Deployments::OrogenDefaultEkfSlam__Task
HERE Orocos::RobyPlugin::Deployments::OrogenDefaultEkfSlam__Task
NAME Orocos::RobyPlugin::Deployments::AvalonControlSimulation -
Orocos::RobyPlugin::Deployment
[[Roby::Task, 0x7f5309ce0348 at druby://musashi:48902],
[Roby::PlanObject, 0x7f5309ce05c8 at druby://musashi:48902],
[Roby::BasicObject, 0x7f5309ce0640 at druby://musashi:48902], [Object,
0x7f5309d86a68 at druby://musashi:48902]]
HERE Orocos::RobyPlugin::Deployments::AvalonControlSimulation
HERE Orocos::RobyPlugin::Deployments::AvalonControlSimulation
HERE Orocos::RobyPlugin::Deployments::AvalonControlSimulation
NAME - Orocos::RobyPlugin::Deployment
[[Roby::Task, 0x7f5309ce0348 at druby://musashi:48902],
[Roby::PlanObject, 0x7f5309ce05c8 at druby://musashi:48902],
[Roby::BasicObject, 0x7f5309ce0640 at druby://musashi:48902], [Object,
0x7f5309d86a68 at druby://musashi:48902]]
HERE
HERE
NAME Orocos::RobyPlugin::EkfSlam::Task -
#<Orocos::RobyPlugin::TaskContext services: >
[[Orocos::RobyPlugin::Component,
0x7f5301ee0d58 at druby://musashi:48902], [Roby::Task,
0x7f5309ce0348 at druby://musashi:48902], [Roby::PlanObject,
0x7f5309ce05c8 at druby://musashi:48902], [Roby::BasicObject,
0x7f5309ce0640 at druby://musashi:48902], [Object,
0x7f5309d86a68 at druby://musashi:48902]]
HERE Orocos::RobyPlugin::EkfSlam::Task
HERE Orocos::RobyPlugin::EkfSlam::Task
HERE Orocos::RobyPlugin::EkfSlam::Task
On 09.01.2012 15:16, Sylvain Joyeux wrote:
> On 01/09/2012 02:49 PM, Chris Müller wrote:
>> def self.inherited(klass)
>> puts "#{klass}"
>> Task.all_models<< klass
>> end
> Wrong spot. inherited is called at class creation (that's a Ruby
> feature), before the class gets properly initialized, which is why
> #to_s and #name fails there.
>
> #remote_name is defined and used for models that are available
> remotely, but not locally. It gets created and initialized in
> anon_model_factory in roby/distributed/protocol.rb:409, which is
> called by DRobyModel.local_model
>
> To track it down, I would look in those two methods to display the
> data stored in the ancestors array. That should give a hint as to what
> causes the problem.
More information about the Rock-dev
mailing list