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

Publish inferred transitions #46

Merged
merged 4 commits into from
Sep 30, 2020
Merged

Conversation

norro
Copy link
Collaborator

@norro norro commented Sep 23, 2020

Publishes inferred transitions of node modes and system states+modes.

The main change of this PR is that

  1. mode inference can now explicitly infer and record the state/mode changes of systems and the mode changes of nodes, see ModeInference::infer_transitions
  2. mode manager publishes these transitions in a regular interval, see ModeManager::publish_transitions on the same topics that lifecycle nodes use

The effect is that

  1. transitions of systems are now published and visible in the same way transitions of nodes are published anyway (lifecycle nodes do that on their own), namely /{system name}/transition_event and
  2. mode transitions are now published and visible in the same way state transitions are published, namely /{node or system name}/mode_event

This is now closer to the according TransitionEvent of lifecycle_msgs,
which includes the start_state and goal_state of a transition.

Signed-off-by: Arne Nordmann <arne.nordmann@de.bosch.com>
* Adds caching of latest reported states/modes of all systems
* Adds infer_transitions method that compares currently inferred
states/modes to cached ones and returns transitions, if detected

#42

Signed-off-by: Arne Nordmann <arne.nordmann@de.bosch.com>
Signed-off-by: Arne Nordmann <arne.nordmann@de.bosch.com>
@norro norro self-assigned this Sep 23, 2020
@norro norro linked an issue Sep 23, 2020 that may be closed by this pull request
Mode manager is now publishing transitions that are inferred by the mode
inference, i.e. state and mode transitions of systems, mode transitions
of nodes.
State transitions of nodes don't have to be published as lifecycle nodes
do this on their own.

#42

Signed-off-by: Arne Nordmann <arne.nordmann@de.bosch.com>
@norro norro changed the title [WiP] publish inferred transitions Publish inferred transitions Sep 29, 2020
@norro
Copy link
Collaborator Author

norro commented Sep 29, 2020

@chcorbato do you want to have a look at this, before I merge it?

@norro norro changed the base branch from master to dev September 29, 2020 17:33
Copy link

@chcorbato chcorbato left a comment

Choose a reason for hiding this comment

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

To clarify, the main change in this pull request is that inferred transitions are now published instead of offered via services @norro ?

Copy link

@chcorbato chcorbato left a comment

Choose a reason for hiding this comment

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

LGTM!

@norro norro merged commit c883230 into dev Sep 30, 2020
@norro norro deleted the feature/42-publish-inferred-transitions branch September 30, 2020 08:47
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.

Publish inferred state/mode transitions
2 participants