Skip to content
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

make rcl_lifecycle_com_interface optional in lifecycle nodes #882

Merged
merged 9 commits into from
Mar 23, 2021

Conversation

Karsten1987
Copy link
Contributor

connects to ros2/rclcpp#1506

@Karsten1987
Copy link
Contributor Author

@fujitatomoya I've opted for introducing two more sets of init/fini, namely ..publisher_init, ..publisher_fini, ..services_init, ..services_fini. I've incorporated these appropriately in the goto fail: sections in order to deduplicate code.

As discussed in the rclcpp ticket, that allows us to explicitly initialize the transition event publisher without initializing the services. Let me know what you think.

@fujitatomoya
Copy link
Collaborator

As discussed in the rclcpp ticket, that allows us to explicitly initialize the transition event publisher without initializing the services.

it looks okay. i am okay to go with this approach.

but I'd like to get back to discussion if lifecycle_com_interface includes /<node_name>/transition_event. as far as i see from the current implementation, it does. in that case, publication should be disabled along with services? this can be done, disabling all communication path, and we can check state_machine_ see if publisher is initialized and then update publish_update.

CC: @ivanpauno @clalancette @wjwwood

@Karsten1987
Copy link
Contributor Author

My/Our use case here is actually pretty straight forward. We'd like to disable external access to state changes. That is, we'd like to block all incoming communication which modifies the state machine. That however does not prevent any outgoing traffic, such as a publication on the transition event topics. In fact, I believe it should stay active in order to let other nodes in the network know about the triggered transitions.

Now, granted, with this definition we could also split the services further, where each individual service could be activated or not. That is, we only disable the change_state service, but leave the get_state et. al. services alive.

@clalancette
Copy link
Contributor

@fujitatomoya Since you had some initial comments, I assigned this one to you to take a look at. If you don't have time for this, please feel free to unassign yourself.

@fujitatomoya
Copy link
Collaborator

@Karsten1987

overall, i am good to go with this. there are three unused_warning https://build.ros2.org/job/Rpr__rcl__ubuntu_focal_amd64/471/gcc/new/, probably we could change where to log the error messages? what do you think?

@Karsten1987 Karsten1987 force-pushed the optional_com_interface branch 2 times, most recently from 5ebf076 to fd84146 Compare March 2, 2021 02:49
@Karsten1987
Copy link
Contributor Author

@fujitatomoya I think I've addressed the unused warnings. I tried to mention it in the line comments, however I do believe we don't have to log twice and can ignore the return value of the fini calls in the fail section. The called function itself logs the reason of failure.

I did however have to add another flag to the com_interface for bookkeeping whether the com interface was initialized or not. That was necessary to make the call to is_initialized successful in both cases.

I'll link CI to the overall issue ticket once more: ros2/rclcpp#1506 (comment)

Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me.

@fujitatomoya
Copy link
Collaborator

@clalancette just in case, could you also take a look when you got time?

Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Karsten1987 and others added 4 commits March 19, 2021 19:21
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Knese Karsten <karsten@openrobotics.org>
@Karsten1987
Copy link
Contributor Author

This is good for another review. CI can be found on the top level issue: ros2/rclcpp#1506 (comment)

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit inline, but otherwise looks pretty good to me.

rcl_lifecycle/include/rcl_lifecycle/rcl_lifecycle.h Outdated Show resolved Hide resolved
Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

rcl_lifecycle/src/rcl_lifecycle.c Outdated Show resolved Hide resolved
Karsten1987 and others added 2 commits March 23, 2021 09:09
Co-authored-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
@Karsten1987
Copy link
Contributor Author

CI is green (ros2/rclcpp#1506 (comment)), merging.
Thanks for the review.

@Karsten1987 Karsten1987 merged commit e9b588d into master Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants