Method: Roby::Application#require_models

Defined in:
lib/roby/app.rb

#require_modelsObject

Loads the models, based on the given robot name and robot type



1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
# File 'lib/roby/app.rb', line 1898

def require_models
    # Set up the loaded plugins
    call_plugins(:require_config, self, deprecated: "define 'require_models' instead")
    call_plugins(:require_models, self)

    require_handlers.each do |handler|
        isolate_load_errors("while calling #{handler}") do
            handler.call
        end
    end

    define_actions_module
    if auto_load_models?
        auto_require_planners
    end
    define_main_planner_if_needed

    additional_model_files.each do |path|
        require File.expand_path(path)
    end

    action_handlers.each do |act|
        isolate_load_errors("error in #{act}") do
            app_module::Actions::Main.class_eval(&act)
        end
    end

    if auto_load_models?
        auto_require_models
    end

    # Set up the loaded plugins
    call_plugins(:finalize_model_loading, self)

    plan.refresh_relations
end