-
Notifications
You must be signed in to change notification settings - Fork 433
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
Add LifecycleSubscription #2715
base: rolling
Are you sure you want to change the base?
Conversation
dce2aa1
to
113024c
Compare
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.
{ | ||
} | ||
|
||
/// TODO: Hold onto the data that arrives before activation, and deliver that on activation. |
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.
besides this, i think subscription should not be discovered in the graph if that is in unconfigure
state. if that comes to inactive
state (means it is configured), subscription will be discovered in the ROS 2 network. and then hold onto the data in the rmw message queue not to take them out and dispose as described here.
for doing that, probably we need to have state control (configured, inactive) in SubscriberBase class and underlying implementations, and then on_configure
callback, we can configure the subscription to be discovered. (on_activate
, it can take the data out of the queue.) i am not sure how exactly we want to design this at this moment, but we would want to add some comments here too. (this feature is similar with LazySubscription
concept.)
note that this requirement should also go to LifecyclePublisher
as well.
what do you think?
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 does sound good to me. 👍
Is this something that has to be done in this PR or can a future PR be made instead? I will add a TODO if the latter is the case.
} | ||
} | ||
|
||
void empty_callback(const test_msgs::msg::Empty 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.
i think one of the most important test case is missing here.
inactive
state callback should not be called. if called, asserts the test.active
state, callback should be called. if not called, asserts the test.
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.
Done in 8ab376b.
113024c
to
adaf96c
Compare
Co-authored-by: Adam Milner <milner@elroyair.com> Signed-off-by: Aarav Gupta <amronos275@gmail.com>
adaf96c
to
8ab376b
Compare
This PR uses most of the changes made in #2254, fixes some of the issues in that PR, and adds a test.