Rviz_common not found while launching rviz2

When trying to launch rviz2 from the terminal this error appears:

StandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user'
[rospack] Error: package 'rviz_common' not found
[librospack]: error while executing command
[INFO] [1679346239.158524633] [rviz2]: Stereo is NOT SUPPORTED
[INFO] [1679346239.159060529] [rviz2]: OpenGl version: 3.1 (GLSL 1.4)
[rospack] Error: package 'rviz_common' not found
[librospack]: error while executing command
[rospack] Error: package 'rviz_common' not found
[librospack]: error while executing command
[INFO] [1679346239.221666333] [rviz2]: Stereo is NOT SUPPORTED
rviz2: malloc.c:2379: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Aborted (core dumped)

Hi @w.ronaldo.cd ,

Did Rviz2 launch successfully or not?

Try sourcing ros version on the terminal before you start Rviz2.
source /opt/ros/galactic/setup.bash
ROS2 Navigation course currently uses Galactic.


Hi Girish,
Thanks it worked. Rviz2 was not launching successfully, now it is working. I did the following:
1. source /opt/ros/galactic/setup.bash
2. cd ros2_ws
3. colcon build --packages-select path_planner_server
4. source install/setup.bash

Could you explain me, what source /opt/ros/galactic/setup.bash exactly does?

Best regards,

Hi @w.ronaldo.cd ,

It prepares the terminal to execute general set of commands related to the software that is being sourced. With that command you are sourcing the Galactic version of ROS2 from its installation directory which is /opt/ros/galactic. The setup.bash is a ROS2 specific script that enables all the functions and abilities of ROS2 to be utilized on the terminal on which you have sourced it.

In simple terms, ROS2 has command line functions like ros2 topic, ros2 service, ros2 action, ros2 node, ros2 lifecycle, ros2 component, ros2 launch, etc. For these functions to be available and to be recognized when typed, you must source ROS2 version with the above command.
This is basically like an #include in C++ or import in Python, but for the terminal.

I hope I have explained it well. Let me know if this is still unclear.


Thank you Girish, it is clear.

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