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

wait for fmu before mode registration #47

Merged
merged 1 commit into from
Jul 22, 2024
Merged

Conversation

GuillaumeLaine
Copy link
Member

@GuillaumeLaine GuillaumeLaine commented Jul 22, 2024

Ensure that the FMU is available before running the message compatibility check.

In systems where the FMU's ROS messages are received via relay rather than direct connection to the FMU, ROS message discovery is delayed. In such cases, the message compatibility check can then timeout. Ensuring FMU topics are discovered first prevents this issue.

@@ -50,7 +51,9 @@ bool ModeExecutorBase::doRegister()

assert(!_registration->registered());

if (!messageCompatibilityCheck(_node, {ALL_PX4_ROS2_MESSAGES}, _topic_namespace_prefix)) {
if (!waitForFMU(node(), 15s) ||
Copy link
Member Author

Choose a reason for hiding this comment

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

The mode executor could check if its owned mode is set to skip the message check?
This would require adding a getter to the Mode class though

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's only used for unit tests

@GuillaumeLaine GuillaumeLaine requested a review from bkueng July 22, 2024 14:20
Copy link
Collaborator

@bkueng bkueng left a comment

Choose a reason for hiding this comment

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

Can you add a PR description for the case where this is required?

@@ -50,7 +51,9 @@ bool ModeExecutorBase::doRegister()

assert(!_registration->registered());

if (!messageCompatibilityCheck(_node, {ALL_PX4_ROS2_MESSAGES}, _topic_namespace_prefix)) {
if (!waitForFMU(node(), 15s) ||
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's only used for unit tests

@bkueng bkueng merged commit bfebd82 into main Jul 22, 2024
9 checks passed
@bkueng bkueng deleted the registration_wait_for_fmu branch July 22, 2024 16:10
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.

2 participants