Skip to content

Workaround to implement RenderPanel of Rviz2 to custom Qt5 Application

License

Notifications You must be signed in to change notification settings

MartiBolet/Custom_Qt5_Rviz2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom_Qt5_Rviz2

UPDATE: The proper way of doing this is done in this repository from @mjeronimo.

In this repository there is an example of how to implement the RenderPanel of rviz2. This is a workaround and it's not the best solution but it's the only way I found that work. The two repositories are for distribution ros2 foxy. For this to work, I made a small changes to the rviz source code, these can be found on my fork. This example tries to be a ROS2 version of this tutorial.

Screenshot of MyViz working

Compile & run

To compile the project:

cd $HOME
# Download
mkdir myviz_ws && cd myviz_ws
git clone https://github.com/MartiBolet/rviz
git clone https://github.com/MartiBolet/Custom_Qt5_Rviz2
cd rviz
git checkout -b develop_integration_with_qt origin/develop_integration_with_qt
# Build
cd $HOME/myviz_ws
colcon build
# Install
source ./install/setup.bash

TIP when testing: After compiling rviz for the first time, you can add COLCON_IGNORE files inside the individual rviz packages. This will allow you to not recompile all when you make a small change.

Run:

ros2 run myviz myviz

Error libGL error: failed to create drawable

If there is an error like libGL error: failed to create drawable and the RenderPanel doesn't show anything, try to:

export LIBGL_ALWAYS_SOFTWARE=1

From this answer and this tutorial

Contributors:

Co-workers: @albertarla, @iggyrrieta. All contributions are welcome and open to discussion.

License

Apache License 2.0

About

Workaround to implement RenderPanel of Rviz2 to custom Qt5 Application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published