-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define external life cycle management interface #99
base: gh-pages
Are you sure you want to change the base?
Conversation
Some high level feedback 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. |
Both good points. Thanks, Dirk. I've made changes for both. |
I'd like to propose to rename 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. |
I don't feel that renaming them to If I clarify the document to make this clear, would that be satisfactory? |
+1; that would be a useful improvement. |
Overall, this document looks good to me. Maybe I just missed it, but where and how does the management interface return the current state? |
The current state is broadcast on a topic, and is also accessible via a service. |
I clarified that |
articles/node_lifecycle.md
Outdated
It is expected that a common pattern will be to have a container class which loads a managed node implementation from a library and through a plugin architecture automatically exposes the required management interface via methods and the container is not subject to the lifecycle management. | ||
However, it is fully valid to consider any implementation which provides this interface and follows the lifecycle policies a managed node. | ||
Conversely, any object that provides these services but does not behave in the way defined in the life cycle state machine is malformed. | ||
The interface shall be provided in a namespace named "infra/lifecycle" underneath the node's namespace. |
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.
As we don't have namespaces in ROS2.0 for the moment, I believe this paragraph can not be merged as is. Currently, the topics and services are advertised with *__get_state
, *__change_state
and *__transition_event
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.
Which is still a kind of namespace - just not with a /
but with __
.
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.
Now that namespace support is being implemented, is this paragraph acceptable?
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.
It should probably make use of the leading _
in topic names to make it "hidden":
http://design.ros2.org/articles/topic_and_service_names.html#hidden-topic-or-service-names
Otherwise, it uses a namespace as currently written, so I'm not sure what else you might be referring to.
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 was referring to @dirk-thomas 's comment that it doesn't use an actual namespace (separated with a /
) but uses __
to mimic a namespace. The proposal from @Karsten1987 is to change the topics used by the lifecycle interface to not use namespaces.
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.
That's what I was getting at.
And on going to add the underscore to make it a hidden interface, I found myself unsure where to add it. On infra
or on lifecycle
? Is infra
going to be a widely-used thing for ROS infrastructure topics? (I hope it is.)
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 don't know how I feel about infra
over infrastructure
or impl
or ros
, or even just letting individual things create their own "impl" namespaces. For example, maybe the common namespace for these things should be just ~/_lifecycle/
. But in general, namespacing the plumbing is something I think we should be doing.
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 in favour of having all infrastructure stuff under a single namespace because it makes things tidier, but I can see the argument of "who defines/controls what is 'infrastructure' enough to go in there?".
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 can see that angle too. It seems to be a bit a bikeshed thing atm. I'm fine with leaving it as-is because we can always come back and change it later once we get more of these "infrastructure" topics and services in place. Perhaps then a better pattern with emerge.
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.
OK, I make the infra
namespace hidden. We can wait a while and see if anything else starts using this same namespace. If not, we can remove it.
articles/node_lifecycle.md
Outdated
uint8 SHUTTING_DOWN=12 | ||
uint8 ACTIVATING=13 | ||
uint8 DEACTIVATING=14 | ||
uint8 ERROR_PROCESSING=15 |
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.
we can link to the actual msg: https://github.com/ros2/rcl_interfaces/blob/master/lifecycle_msgs/msg/State.msg
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.
Should the msg file follow the specification, or should the specification reference the msg? One needs to be considered the master definition, and the other needs to be kept in sync with it.
Although I prefer keeping the specification document as the master definition, when considering maintenance, having the spec link to the msg file would be easier.
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 don't mind either way. Linking to the spec might have the problem of tracking changes over time. Then again it may be just as hard to represent that in this document as well. So I don't see that one way is strictly better than the other. At least with the interface file being the sole authority, you can avoid some duplication of information if you choose.
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.
Having thought about it more, I prefer keeping the spec as the master definition. In theory there could be other implementations. I will add a link, though.
articles/node_lifecycle.md
Outdated
|
||
### Life cycle state changes topic | ||
|
||
When the node's life cycle changes, it shall broadcast the following message on the `infra/lifecycle/state_change` topic. |
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.
`<node_name>__transition_event'
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.
See above about namespaces.
articles/node_lifecycle.md
Outdated
|
||
### Current life cycle state service | ||
|
||
The node's current life cycle state shall be available via the `infra/lifecycle/get_state` service. |
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.
<node_name>__get_state
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.
See above about namespaces.
articles/node_lifecycle.md
Outdated
|
||
### Transition request service | ||
|
||
The service `infra/lifecycle/change_state` service shall be provided by the life cycle interface. |
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.
<node_name>__change_state
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.
See above about namespaces.
@gbiggs Can you please address the pending 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.