Skip to content

Conversation

@pepisg
Copy link

@pepisg pepisg commented Jan 9, 2026

Hi! Thanks a lot for open sourcing this package!

I was setting up some tests involving nav2 costmaps and wanted to expose an argument to chose wether to launch rviz on nav2's launch. This is useful in my case because I want to debug the tests while i create them, but don't want to use rviz when running on my CI system.

I modified the cli to support this.

Sorry in advance if there's already a way of doing this that I missed.

@troygibb
Copy link
Contributor

troygibb commented Jan 9, 2026

Hey @pepisg thanks for the contribution!! Can you provide an example of how you would set this up within a replay test? Off the bat, I'd like to nest these args somewhere specific to the test. But an example would help clarify the correct usage pattern

@pepisg
Copy link
Author

pepisg commented Jan 13, 2026

It would look something like this:

class Run:
    def generate_launch_description(
        self, replay_run_params: ReplayRunParams
    ) -> LaunchDescription:

        launch_rviz = "True" if _args.launch_rviz else "False"
        launch_args = {
            "launch_rviz": launch_rviz,
        }
        return LaunchDescription(
            [
                IncludeLaunchDescription(
                    PythonLaunchDescriptionSource(str(nav2_launch_file)),
                    launch_arguments=launch_args.items(),
                ),
            ]
        )

which then I'd launch as:

ros2 run replay_testing replay_test my_test.py --launch-rviz

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