Skip to content

Why do we need the EventHandlers in launch files? #961

@christophfroehlich

Description

@christophfroehlich

As @emersonknapp started the discussion in a PR, I'd like move this discussion here.

First of all, I'd say the usage of EventHandlers has some historical reason where the spawners were not that powerful, or even not existing and the ros2cli was used in launchfiles (similar to the test included in example_1).
Nowadays, the spawner can handle multiple controllers at once if they have the same desired lifecylce state. Then this all is quite deterministic. Unless any controller is part of a controller chain, the order of spawning them is not important from the framework side.

But we saw flakiness in the tests, that's why even the order of spawners is important, see #547 and the linked rclpy issue. I'd say we could re-evaluate this, this might not happen if we merge all spawners to a single one where possible.

We also use this pattern to delay the startup of rviz, otherwise the console output is polluted with failing tf lookups unless the joint_state_broadcaster is up. What would be a better and still convenient solution for that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions