-
Notifications
You must be signed in to change notification settings - Fork 194
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
Lifecycle design #335
base: gh-pages
Are you sure you want to change the base?
Lifecycle design #335
Conversation
@SteveMacenski Since Nav2 is a heavy user of lifecycle, would you mind giving this a look? We'd be very interested in your feedback. |
It'll be next week at this point for me, but yes I will! The only thing I see immediately that I would ask a question about is the throwing of exceptions. Who, if anyone, is able to catch that error in the state transition? It would be unacceptable if that was uncatchable by the user / rclcpp such that the server crashed. |
@clalancette @SteveMacenski This wasn't supposed to be a public-facing PR, but rather to first go through a last round of internal reviews (I should have targeted our fork rather than the official repo) I won't take it down but I converted it to draft. |
|
||
To transition out of a primary state requires action from an external supervisory process, with the exception of an error being triggered in the `Active` 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.
I think this remark has value to keep (unless you just moved it elsewhere)
|
||
### Primary State: Unconfigured | ||
### Primary State Definitions and Expected Behaviors | ||
Primary States allow for assumptions and expected behavior of the Lifecycle Node with respect to the node’s [Managed Entities](#managed-entities). |
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 have no idea what this sentences are trying to communicate. I also don't understand what the second sentence in this block is trying to say that shouldn't have already been made clear when introducing the idea of transition states.
This is the life cycle state the node is in immediately after being instantiated. | ||
This is also the state in which a node may be retuned to after an error has happened. | ||
In this state there is expected to be no stored state. | ||
Note "processing" refers to Managed Entities receiving/sending messages, those messages being propagated through the `ROS 2` stack, and user callbacks processing these messages with respect to the executor. |
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 understand fully what this is communicating, but I think its overly technocratic.
"Processing in managed entities means messages, services, actions, etc are being processed, whereas not processing indicates that messages are not being sent or received by the middleware."
|
||
The main purpose of this state is to allow a node to be (re-)configured (changing configuration parameters, adding and removing topic publications/subscriptions, etc) without altering its behavior while it is running. | ||
#### **Primary State: `Inactive`** | ||
This state represents a node that is performing minimal processing with allocated Managed Entities. |
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.
What is "minimal processing" the original documents' seems more clear (maybe just update this with the entity language)
This state represents a node that is not currently performing any processing.
The main purpose of this state is to allow a node to be (re-)configured (changing configuration parameters, adding and removing topic publications/subscriptions, etc) without altering its behavior while it is running. | ||
#### **Primary State: `Inactive`** | ||
This state represents a node that is performing minimal processing with allocated Managed Entities. | ||
Thus, as defined in the [Managed Entities](#managed-entities) section, the Managed Entities will not be added to the `ROS` graph with data retention to topics following that of an unallocated Persistent Entity. |
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.
If pre-defined and within the definition, it needs not be restated repeatedly. Especially when the sentence prior basically just says "not processing"
If the user accepts and successfully handles the cancellation request, the state will follow the `CallbackReturn::FAILURE` path of the state machine. | ||
This follows the "fallback" behavior of a transition. | ||
If the user accepts and unsuccesfully handles the cancellation request, the state will follow the `CallbackReturn::ERROR` path of the state machine. | ||
An ignored cancellation request becomes inactive and failed the instant a transition is inactive. |
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.
An ignored cancellation request becomes inactive and failed the instant a transition is inactive. | |
An ignored cancellation request becomes inactive and failed the instant a transition is inactive. |
I would think that we'd basically transition back down to what the cancel would have done for us if it were processed properly. E.g. If transitioning to Active and cancel is ignored, we just force the state machine back down to Configured.
Or, if cancel accepted + processed puts it always back in the unconfigured state, then an ignored cancel request would transition the system back down the unconfigured automatically so it seems as if it were handled regardless
|
||
### Destroy Transition | ||
#### **Operation `raise_error()`** | ||
This operation transitions the node from the primary states `{Unconfigured, Inactive, Active}` to `ErrorProcessing`. |
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.
What exceptions can I throw that will do this? I think that needs to be explicit (e.g. std::runtime_error)
|
||
### Create Transition | ||
### Return Values |
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 get that for transition states, but is that true for primary states as well? So no exception catching to cause us to go into error processing if an uncaught exception is thrown in a primary state? I think that's untrue given how the primary states work, so I think this needs clarification that we're only referring to transition states.
It will publish every time that a transition is triggered, whether successful or not. | ||
### Supported Interfaces | ||
|
||
This section outlines Persistent Entities created by the backend of Lifecycle nodes. These Persistent Entities make up the external facing management interface of a Lifecycle node. Each of these external interfaces must also include an internal equivalent (i.e., a function the user can call from within the node itself). |
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.
L373 - L383 I have no idea what you're trying to communicate or why its an important thing to distinctly discuss
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.
Actually, this entire subsection "Supported Interfaces" I don't understand. Something is really unclear about what the intention is. There's some stuff about the ROS interfaces (e.g. topics/services) which I ack as standard practice, but no idea what anything before "The following interface behaviors will be supported" seems unrelated.
Also, all the interfaces are CamelCase and if these are supposed to be topics, then theey should be snake_case. If these are interface message types, that's unclear.
|
||
## Managed Entities | ||
|
||
Managed entities transition with the state machine, being automatically allocated and spun. |
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.
Huh (on this whole subsection)
More general thoughts
There are lots of things in here that are overly technocratic that even someone that uses lifecycle nodes every day it takes me 2-3 sometimes 4 times reading through to actually understand what you mean. I'd recommend looking over the original document where the same points were addressed previously that were sufficiently technical (might benefit from more detail) but written in language that I can grokk. |
No description provided.