[rviz & rviz2] Can not open rviz2 successfully

Greetings,

Now I’m trying the unit 2 of course “Advanced ROS2 Navigation”, and I can not open rviz2.

I understand the different between ROS1 and ROS2.

To make the environment clearly, I check the contents below are not in the file “~/.bashrc”:

source /opt/ros/noetic/setup.bashrc
source /opt/ros/galactic/setup.bashrc

And do the instruction below:

$ unset ROS_DISTRO
$ unset PYTHONPATH

Finally, I find the magic and interesting things:

  • I can run rviz successfully without sourcing the file “/opt/ros/noetic/setup.bash”
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user'
[ INFO] [1682387027.024471034]: rviz version 1.14.20
[ INFO] [1682387027.024533696]: compiled against Qt version 5.12.8
[ INFO] [1682387027.024556536]: compiled against OGRE version 1.9.0 (Ghadamon)
  • I can find rviz2 but can not run rviz2 with some error
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user'
[rospack] Error: package 'rviz_common' not found
[librospack]: error while executing command
[INFO] [1682387039.477222067] [rviz2]: Stereo is NOT SUPPORTED
[INFO] [1682387039.477358811] [rviz2]: OpenGl version: 4.5 (GLSL 4.5)
[rospack] Error: package 'rviz_common' not found
[librospack]: error while executing command

So my question is why I can run rviz without sourcing anything? And is that the problem result in launching “navigation.launch.py” error with the node “rviz2”?

Which instructions are you following exactly? Where is that mentioned in the notes? I can run both rviz and rviz2 successfully when I load the course, without sourcing anything.

Hi @bayodesegun

These instructions below do not be mentioned in the notes.

$ unset ROS_DISTRO
$ unset PYTHONPATH

Because I could not run rviz2 successfully for a few days, I tried to make a empty environment for testing with the instructions I mentioned above .

But now I can run successfully withot sourcing anything and error .

I want to know are these courses with default operating environment or not?

And if I had the same problem, how do I know the question is my operating or the default operating environment?

Okay, thanks for clarifying.

If you have any problem with the course environment, the first suspect is the default operating environment of the course.

In any case, you can just contact us if not sure, and we’ll resolve it for you.

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