Ask Your Question
0

How to make rviz2 startup navigation automatically

asked 2022-04-20 08:45:01 -0500

WarTurtle gravatar image

Hey, in my project, I open multiple instances of rviz2, one for each robot. Every time, I need to press the "Startup" button in Rviz for the map to show and I can publish an initial pose from a seperate script.

image description

I want this to happen from the launch file and I thought the autostart launch parameter would do this, but it does not, or maybe I'm doing something wrong.

There also does not seem to be a difference in the .rviz configuration file after pressing startup.

Any ideas?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-04-20 08:53:01 -0500

ljaniec gravatar image

I think autostart launch parameter should be good enough, can you share you launchers?

You can base your launcher on this one here: https://github.com/SteveMacenski/nav2...

Concretely this part:

bringup_cmd = IncludeLaunchDescription(
    PythonLaunchDescriptionSource(
        os.path.join(nav2_launch_dir, 'bringup_launch.py')),
    launch_arguments={'slam': slam,
                      'map': map_yaml_file,
                      'use_sim_time': use_sim_time,
                      'params_file': params_file,
                      'autostart': 'True'}.items())
edit flag offensive delete link more

Comments

1

Yes, mine looks the same with autostart set to True. My problem was that I have separated the global planner from the rest of the nav stack and launching that and rviz on a separate machine from the simulation.

After enabling autostart on the simulation machine, it worked... I wonder what lifecycle node is needed for rviz to do it?

WarTurtle gravatar image WarTurtle  ( 2022-04-22 04:06:46 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-04-20 08:45:01 -0500

Seen: 82 times

Last updated: Apr 20