Skip to content

Updating docs for new ControlClient APIs - #796

Open
MaciejKaszynski wants to merge 5 commits into
eclipse-score:mainfrom
etas-contrib:update-lcm-docs
Open

MaciejKaszynski wants to merge 5 commits into
eclipse-score:mainfrom
etas-contrib:update-lcm-docs

Conversation

@MaciejKaszynski

@MaciejKaszynski MaciejKaszynski commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Updating docs for new ControlClient APIs

  • Also added example code into the docs.

}

// activate a different run target
const auto result = client->activate_run_target(score::mw::lifecycle::RunTargetName{"Running"}, true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess a problem with this scenario is that it will always go into the race condition of possibly aborting the initial transition that started state manager in the first place.

I think this can probably not be avoided as long as we only have the "force" activation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if it would be enough if we do literal include of the specific sections from the existing control daemon example for depicting the API interaction.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The examples/control_application/control_daemon.cpp has the same issue as I don't think there is any syncing between the callback and the main thread. I didn't use the control_daemon.cpp because of the custom IPC that is there which I don't think should be in the exmaple.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the control_daemon.cpp happens to avoid this race condition because it does not directly initiate a transition after reporting kRunning, but only upon request via IPC.

I was wondering if it makes sense to reuse the examples we already have and only include certain parts into the documentation for explanation. From the sphinx docs it seemed possible like this:

// start-activate-doc
const auto result = client->activate_run_target(score::mw::lifecycle::RunTargetName{runTargetName}, true);
if (result.has_value())
{
    std::cerr << "Successfully requested Run Target " << runTargetName << std::endl;
}
else
{
    std::cerr << "Requesting Run Target " << runTargetName
              << " failed with error: " << result.error().Message() << std::endl;
}
// end-activate-doc

And then in the documentation include only the parts between the comment markers

.. literalinclude:: examples/control_application/control_daemon.cpp
   :start-after: start-activate-doc
   :end-before: end-activate-doc

Benefit would be:

  • single set of examples in the repo, no duplication
  • examples are built and also executed, so we are sure they are working

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But I also see a benefit of having these skeleton examples, so feel free to decide.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But then we'd have to copy the /examples source code into the docs folder. Docs can't see anything outside the source_dir so we'd have to copy and the actual code wouldn't run and we could get out of sync.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I fixed with atomics now

Comment thread score/launch_manager/docs/product_documentation/examples/BUILD

For more information about the ``mw::com`` configuraiton please refer
to their documentation and tutorial at documentaiton
https://eclipse-score.github.io/communication/v0.5.0/score/mw/com/doc/tutorial/chapter_2/README.html#separate-configuration-files-for-provider-and-consumer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we use a link to latest version?
Otherwise we will need to keep updating the link every time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah wasn't really sure what to do because if we do latest there is a chance they will move pages and the link will not be valid.
would you say having latest is better?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure. But I am pretty sure we forget to align this link every release 😅
@TimoSteuerwaldETAS has some experience with automatic link checking for documentation, may we can roll this out in the repo?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have added the link checker here: https://github.com/etas-eng/vsps_lifecycle_docs/blob/main/build_docs.sh
There it is executed now during each build. Andreas recommended to execute it once per week, but for the internal repo, as there is not much traffic anyways, I think it is fine to keep it as it is.

For the public repo I would first give it a try and check how much it increases build time. Depending on that we can set the frequency for this check.

Comment thread score/launch_manager/docs/product_documentation/integration.rst
Comment thread score/launch_manager/docs/product_documentation/integration.rst Outdated
Comment thread score/launch_manager/docs/product_documentation/integration.rst Outdated
Comment thread score/launch_manager/docs/product_documentation/integration.rst
@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview for this pull request is available at:
pr-796: https://eclipse-score.github.io/lifecycle/pr-796/

Comment thread score/launch_manager/docs/product_documentation/integration.rst
Comment thread score/launch_manager/docs/product_documentation/integration.rst Outdated
Comment thread score/launch_manager/docs/product_documentation/integration.rst Outdated
Comment thread score/launch_manager/docs/product_documentation/integration.rst Outdated
Comment thread score/launch_manager/docs/product_documentation/integration.rst Outdated
interface.
The **State Manager** is itself a managed component.
Before calling ``activate_run_target``, it must report the Running state to the
Launch Manager via the **Lifecycle API**.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if it is clear to the user what we refer to with "Lifecycle API" and "Lifecycle Interface".
Maybe we should clarify somewhere that this term refers to 3 APIs:
The C++ report_running function, the rust report_running function and this run_application stuff

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it's clear now, since it can use any of them.

Comment thread score/launch_manager/BUILD Outdated
@NicolasFussberger

Copy link
Copy Markdown
Contributor

Few small comments, but generally looks good to me.

@SimonKozik SimonKozik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks OK to me

This branch is waiting to be deployed

1 waiting deployment
workflow-approval — 5447a327 Waiting Oct 16, 2026 by MaciejKaszynski via Build and test x86_64-qnx / approval #1535
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

4 participants