Unit 3 Advanced Launch Files error

Hello, I have two problems in the unit 3 “Advanced Launch Files > Use other launches inside launches”

The first one is that the file start_rviz.launch.py is not completed, the package_description must be declared. I did it with the following line (I think that is not the right solution)

package_description = "launch_tests_pkg"

So my first problem is that after saving the rviz config in "ros2_ws/src/launch_tests_pkg/rviz_config/
And after I relaunch the main.launch.py, there is no config loaded. I guess it’s due to I’m saving in "ros2_ws/src/launch_tests_pkg/rviz_config/ instead of “/install/launch_tests_pkg/share…”
What am I doing wrong?

image image

My second problem is that I can’t visualize the Robot Model. Any idea?

Thank you!

Hello @ShikurM56 ,

  1. Your solution is OK. You can also substitute it directly in the same line:
rviz_config_dir = os.path.join(get_package_share_directory(
        'launch_tests_pkg'), 'rviz_config', 'launch_part.rviz')
  1. About the config not being loaded, I think the problem is related to a wrong line in the setup.py file, which should be:

(os.path.join('share', package_name, 'rviz_config'), glob('rviz_config/*')),

  1. Finally, the problem of not visualizing the model is related to a missing source. You should do the following source before starting RViz:

source /home/simulations/ros2_sims_ws/install/setup.bash

This sources the workspace where the models are contained.

I’ve updated all this in the notebook. Please give it a look and try it again, it should work OK now.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.