Rosanswers logo

Taken from my question here: http://stackoverflow.com/questions/43595155/rviz-does-not-recognize-my-plugin

I am missing something as I struggle to get the tutorial rviz plugin to show up within rviz. I have the source for the visualization_tutorials. Within that git repo, there is the rviz_plugin_tutorials. I can successfully build this within a ROS workspace, with the output showing up in rviz_workspace/devel/lib as librviz_plugin_tutorials.so.

I have read that rviz uses pluginlib to load plugins that have the appropriate plugin_description.xml and use the PLUGINLIB_EXPORT_CLASS macro appropriately.

I don't understand how this mechanism is supposed to work. After building the plugin, all you have are the library (.so file) and the package and plugin .xml files. How is running 'rosrun rviz rviz' supposed to allow rviz to find this new library and plugin description file? That's my fundamental misunderstanding. I don't see the tutorial plugin when I run rviz and running rospack doesn't show the tutorial plugin:

honeywell@UGV-Laptop-1:~/rviz_workspace$ rospack plugins --attrib=plugin rviz rviz /opt/ros/kinetic/share/rviz/plugin_description.xml honeywell@UGV-Laptop-1:~/rviz_workspace$

Thanks for any help

EDIT: rviz is running from /opt/ros/kinetic/bin/rviz. Am I supposed to copy my plugin_description.xml and librviz_plugin_tutorials.so somewhere other than where the workspace has them?

Originally posted by Rich von Lehe on ROS Answers with karma: 26 on 2017-04-24

Post score: 0


1 Answer 1


Rosanswers logo

Answered my own question at the stackoverflow link. It was a rookie mistake.

From SO:

Rookie mistakes being made here by me. I did two things to solve my problem, then realized only one was needed.

  1. Installed rviz source and built it. After doing this and performing 'rosrun rviz rviz' the problem still remained. No new plugin.
  1. Realized I had not sourced devel/setup.bash for this workspace. Doing this and then running rviz produced the desired results.

I went back and removed rviz from src and removed the devel folder and it all still worked, so it seems it's not necessary to work with rviz built from source.

Originally posted by Rich von Lehe with karma: 26 on 2017-04-24

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by gvdhoorn on 2017-04-25:
I've edited your question to include the text from your answer over at SO. This way future readers don't need to site-hop to understand what the problem (and the solution) was.

Comment by gvdhoorn on 2017-04-25:
Thanks for reporting what your eventual solution was btw, much appreciated.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.