[Rock-dev] [rock] #442: roby/syskit: Cleanup of Syskit::InstanceRequirements::Task
rock
noreply at opendfki.de
Wed Apr 23 14:30:21 CEST 2014
#442: roby/syskit: Cleanup of Syskit::InstanceRequirements::Task
--------------------+------------------
Reporter: thro02 | Owner:
Type: defect | Status: new
Priority: major | Milestone:
Component: base | Resolution:
Keywords: syskit |
--------------------+------------------
Changes (by sylvain.joyeux):
* priority: normal => major
Comment:
This '''is''' a limitation of Roby. The issue is that, from the p.o.v. of
Roby's GC, the planned_by task is associated with task it is planning and
therefore should not be cleared:
This is what happens:
- monster_interface::InterfaceModule has been added as a mission
It is planned by Syskit::InstanceRequirements::Task::0x01
- monster_interface::InterfaceModule is being added as a dependency of a
SetPosture task (through the action), planned by
Syskit::InstanceRequirements::Task::0x02
- syskit merges both monster_interface::InterfaceModule tasks, leading to
the resulting merged task being planned by both 0x01 and 0x02
- SetPosture finishes
- both planning tasks are associated with a mission, and therefore should
not be removed.
The proper solution is to add more merge tracking to Roby, so that Roby
realizes that the planning task is associated with the dependency
relation, NOT the task. Not trivial
Instead of trying to tweak the GC (which can very easily have unintended
consequences), I would suggest to do the proper thing manually, namely:
{{{
task = Sherpa::Tasks::SetPosture.new(arguments)
monster = task.depends_on(
monster_interface::InterfaceModule, :role => 'monster_interface')
planner = monster.planning_task
task.on :stop do |event|
planner.remove_planned_task(planner.planned_task)
end
task
}}}
Since, within the action, the merge does not happen yet, you could also
create a generic method that traverses the whole dependency tree, finds
planning tasks and removes them if the toplevel action task finishes.
--
Ticket URL: <https://rock.opendfki.de/ticket/442#comment:1>
rock <https://rock.opendfki.de>
rock: the robot construction kit
More information about the Rock-dev
mailing list