design icon indicating copy to clipboard operation
design copied to clipboard

Define external life cycle management interface

Open gbiggs opened this issue 8 years ago • 9 comments

The previous version of the document only gave an ambiguous description of the external interface used to manage a node's life cycle. This pull request describes the interface in detail, including topic names, and message and service definitions.

gbiggs avatar Nov 09 '16 16:11 gbiggs

Some high level feedback for now:

  • Do we need a specific service for every requested transition? Having a single service which takes an argument would make the API more flexible (since it would work for any state machine defined).
  • Currently ROS 2 does neither have the concept of a namespace nor latching. While we hope to support something similar in the future it might be problematic to refer to those terms in the design doc for now.

Regarding the Travis error: every sentence in the markdown files should start on a new line. Hopefully if you update the patch the ugly error should go away.

dirk-thomas avatar Nov 09 '16 17:11 dirk-thomas

Both good points. Thanks, Dirk. I've made changes for both.

gbiggs avatar Nov 09 '16 19:11 gbiggs

I'd like to propose to rename create and destroy into init and deinit respectively. I am having trouble with the word create, since we don't have a factory which creates nodes and we encourage users to inherit from a generic base class. That being said, a create function is more like a constructor and a destroy is a destructor which never really gets called externally.

Concretely speaking, this would result in an non-op constructor, getting called when a user instantiates a new node. The respective init function, then, which is responsible for enabling all pub/sub etc, can get triggered externally.

Karsten1987 avatar Nov 10 '16 05:11 Karsten1987

I don't feel that renaming them to init and deinit is correct. These two functions are more intended to be provided by a container system that has a factory to create and destroy nodes on demand, rather than by the nodes themselves. This is why they are not included in the node's external interface specification. If a managed node is created by a user in their own main(), then there will be no create and destroy calls.

If I clarify the document to make this clear, would that be satisfactory?

gbiggs avatar Nov 10 '16 08:11 gbiggs

If I clarify the document to make this clear, would that be satisfactory?

+1; that would be a useful improvement.

jack-oquin avatar Nov 10 '16 14:11 jack-oquin

Overall, this document looks good to me.

Maybe I just missed it, but where and how does the management interface return the current state?

jack-oquin avatar Nov 10 '16 14:11 jack-oquin

The current state is broadcast on a topic, and is also accessible via a service.

gbiggs avatar Nov 11 '16 14:11 gbiggs

I clarified that create and destroy are functions of a container system, but I think the document could do with more detail on what a container is and what interface it should provide. However, that needs more discussion about what, if anything, we want to do with containers.

gbiggs avatar Nov 11 '16 14:11 gbiggs

@gbiggs Can you please address the pending comments.

dirk-thomas avatar Apr 10 '17 17:04 dirk-thomas