Created rviz plugins don't show up on rviz plugin selector
I want to write a plugin for rviz. As a first step in this process, I tried to follow the tutorial below in order to have a base level plugin to work on in order to develop my own.
http://docs.ros.org/en/melodic/api/rviz_plugin_tutorials/html/display_plugin_tutorial.html (note that this link is listed on http://wiki.ros.org/rviz_plugin_tutorials)
However, I can't get any of these tutorials to work, I have tried other laptops with their ubuntu partition and it still doesn't work. I have also used the following plugin packages, and while no error was printed on the console, the plugin name would not show up on the selector on rviz, only the teleop plugin would show up (but I think this is a built in feature).
https://github.com/ros-visualization/visualization_tutorials/tree/noetic-devel/rviz_plugin_tutorials
Info: I am using ROS Melodic on Ubuntu 18.04.5 LTS (Bionic Beaver). The files I have used are exclusively the ones in the links above. I can provide additional information if necessary.
Asked by katsostak on 2021-08-20 05:41:43 UTC
Answers
The tutorial you linked appears to be for an older version of ros, so some of it is out of date, and the important setup.bash
step is not even mentioned.
You should download the git source code, build it, and see it work before you try to create something custom. Also, make sure you do not have the tutorial apt
package installed from the ros repository, because it will be difficult to tell which code you are actually executing. For me, the following created a working demo on melodic:
# it is ok if purge wants to also remove pkg ros-melodic-desktop
sudo apt purge ros-melodic-rviz-plugin-tutorials
mkdir -p ~/catkin_ws_plugin/src
cd ~/catkin_ws_plugin/src
git clone https://github.com/ros-visualization/visualization_tutorials
cd visualization_tutorials
git checkout -b melodic 0.10.5
cd ../..
catkin_make
source devel/setup.bash
rosrun rviz rviz
Asked by Mike Scheutzow on 2021-08-22 09:16:47 UTC
Comments
Thank you for your answer, could you be a bit more specific as to what your working demo looks like after running this? If you look at the plugin_descriptoon.xml file in rviz_plugin_tutorials/src you will notice that three plugins (Teleop, Imu, PlantFlag) should show up on the "Add New panel" panel, do Teleop, Imu, and plantflag show up for you after running that? If not how do I get them to show up?
On another note, Changing the description of the Teleop plugin does change its description on the plugin selector, so I think that only the Teleop plugin out of the three shows up but I don't know what is causing this
Asked by katsostak on 2021-08-23 03:59:28 UTC
rviz appears to have 3 different styles of plugin, and this demo shows each of them. One is accessed using the "Add" button at the bottom of the "Displays" panel on the left, one is added by menu item Panel | Add New Panel, and the last is added by the blue plus symbol at the right end of the toolbar.
Asked by Mike Scheutzow on 2021-08-23 07:50:20 UTC
Comments
Just to check: did you
source /path/to/your/catkin_ws/devel/setup.bash
after building your workspace?Without that, any plugins built from source in your Catkin workspace will not be picked up.
Asked by gvdhoorn on 2021-08-22 02:02:34 UTC