Ticket #39 (assigned feature)

Opened 4 years ago

Last modified 2 years ago

Plugin dependencies

Reported by: tim Owned by: tim
Priority: major Milestone: 0.5
Component: Fawkes Version:
Keywords: Base Cc:
Git Branch:

Description

Currently the only dependency that we have is that VisionAspect threads depend on a thread being active with the VisionMasterAspect. But for the future we may even more such dependencies.

Additionally currently there is no easy way to fulfill the dependency. It can only be detected that the dependency is not met and the plugin cannot be loaded. There is no way to load the plugin that could fulfill this dependency.

The idea is to extend Plugin by a requires() method that returns a list of plugin names. Then a policy can decide if loading a plugin where dependencies cannot be fulfilled should fail or if the plugin loaded should try to fulfill the dependencies by loading these plugins.

An example are vision apps, like fvretriever. You could then load fvretriever and it would have fvbase as a dependency. The plugin loader could see this and load fvbase before fvretriever to fulfill the dependency. If this is not possible (or for example auto dependency resolution is disabled in the config) the loading of fvretriever would fail.

The aspect dependencies remain necessary. For example fvretriever could not name fvbase as a requirement. Loading the plugin would be attempted and without the aspect dependencies the loading would succeed, but running would not meet the guarantees of aspects and the application were likely to crash.

This idea does assume that for most plugins it's easy to define the dependencies and that in general there will be only one plugin providing the functionality, for example the vision master. If that changes it may be necessary to have a more flexible dependency description, but for the beginning the simple solution should suffice.

Change History

Changed 4 years ago by tim

What just came to my mind is that we should allow for an "XOR" relation. I came to this while thinking about the Nao: there the lower hardware can either be simulated (by the naosim plugin) or on the real robot (naohw plugin to come). Thus if we define a naomotion plugin which provides basic walking/kicking actions etc. we need an "either A or B" relation. Something like:

naomotion::requires() = "naosim|naohw"

Now if naomotion is loaded it is checked if one of naosim or naohw is loaded. If it is not it will load the first one mentioned. If this fails (for example if the simulator is not running and thus it is likely that we are on the real hardware) the plugin loader tries to load naohw. If this fails as well the plugin dependencies are not met and thus the naomotion plugin cannot be loaded. Both of naosim and naohw cannot be loaded anyway since they would write to the very same interface which is not possible.

If the plugins are written properly they fail if the simulator respective the real hardware is not available and so the loader would automagically do the right thing.

Changed 4 years ago by tim

  • milestone set to Basic Platform

Changed 3 years ago by tim

  • status changed from new to assigned

Added tags for describing the dependencies of a plugin in r1600. They are not evaluated by the plugin loaded yet, work is ongoing.

Changed 2 years ago by tim

  • milestone changed from 0.3 to 0.5

Reassigning to milestone 0.5, more realistic time frame.

Note: See TracTickets for help on using tickets.

This list contains all users that will be notified about changes made to this ticket.

These roles will be notified: Reporter, Subscriber, Participant

  • Fawkes Trac List(Always)
  • Tim Niemueller(Reporter, Owner, Participant)