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

Primary state error transitions #436

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from

Conversation

thebyohazard
Copy link

This PR shows an example of the new self-transitioning functionality implemented in required PRs ros2/rcl_interfaces#97, ros2/rcl#618, and ros2/rclcpp#1064. Ideally, I think the lifecycle_service_client should react to the lifecycle_talker having an error rather than just knowing it will happen as that would be more true to a real world example, but for a demo and proof of concept, maybe it's better to keep it simpler.

// raise_error() can be called from an inactive or active state.
if(count == 32){
RCLCPP_ERROR(get_logger(),"An error has arisen in the node and it needs reconfiguration.");
raise_error();
Copy link
Collaborator

Choose a reason for hiding this comment

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

check if the current state in ACTIVE before raise_error() ?

* TRANSITION_CALLBACK_ERROR or any uncaught exceptions to "finalized"
*/
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn
on_error(const rclcpp_lifecycle::State & state)
Copy link
Collaborator

Choose a reason for hiding this comment

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

indent is not correct?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for that. Fixed

@hidmic hidmic added the enhancement New feature or request label Apr 16, 2020
…tion

Signed-off-by: thebyohazard <patrick@jlpengineering.com>
@thebyohazard thebyohazard force-pushed the lifecycle_primary_state_error_transitions branch from 8c40675 to c2b2cb9 Compare April 16, 2020 14:58
Signed-off-by: thebyohazard <patrick@jlpengineering.com>
@norro
Copy link

norro commented Nov 23, 2020

What is the state of this PR?

@fujitatomoya
Copy link
Collaborator

not sure, @thebyohazard any update you would do?

@audrow audrow changed the base branch from master to rolling June 28, 2022 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants