Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "interface.register_action: use Roby::Task as default return t…
…ype" This breaks actions defined via action_state_machine which no longer start when called from the ruby shell. Probably because Roby::Task is just a MetaClass. This reverts commit 7ec9de2.
- Loading branch information
495fb8b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is problematic because at the moment http://rock-robotics.org/stable/api/tools/roby/tutorial/shell.html is no longer working. The reason is a wrong default type see 7ec9de2.
495fb8b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm lost. Is the problem caused by the original commit or its revertion
495fb8b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of background ... then we can start looking for the best solution.
The reason why actions by default generate their own return type is so that instanciated actions in the plan actually give information on the intent (i.e. you get a Move task instead of a plain Roby::Task). It's actually not needed by Roby itself. I'm getting into the opinion that it's probably making more harm than good and would support just ripping it off.
Thoughts ?
495fb8b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem was solved by the 7ec9de2 but this was introducing a new bug causing action_state_machines no longer to start when called from the ruby shell. Therefore, I reverted 7ec9de2. Ideally, any thing that is a Roby::Task should work if no return type is specified. And I really do like the information you are encoding with the new class.
One solution might be to accept any Roby::Task as ancestor for this kind of classes because they are not adding any functionality.
495fb8b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea why not ?
The information is lost if you return anything else than the new class. And one can always set the return type to a specific Roby task explicitely.
495fb8b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My explanation was that Roby::Task is missing something that is added by Roby::Task.new_submodel. I can have a look if you have no idea why this is happening.
495fb8b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ... action state machines ... right.
Roby::Task instances cannot run. It's an abstract task model. For "normal" actions, it is moot as one never returns a Roby::Task. For action state machines, the toplevel task is generated by the framework.
We could in principle validate that the toplevel task is not abstract .... but that's "generically speaking" wrong (one could creat an action that instanciates a state machine with an abstract root task and then replace it with a non-abstract one)