rqt Plugin Tutorial Not Working
Hello - I am new to ROS. I followed this tutorial to create a rqt_mypkg python plugin. I am using Ubuntu 20.04 and ROS Noetic. After completing the tutorial, when I run the plugin with 'rqt --standalone rqt_mypkg' I get the following errors:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-public'
qt_gui_main() found no plugin matching "rqt_mypkg" try passing the option "--force-discover"
As I followed the steps in the tutorial, I coped the contents of each file from the tutorial and pasted into files on my system.
Things I've tried:
- deleted ~/.config/ros.org/rqt_gui.ini
- tried the --force-discover option on the 'rqt --standalone rqt_mypkg' command
- made sure to run source <workspace>/catkin/devel/setup.bash (actually it is in my .bashrc plus I manually ran the command)
- 'rqt --list-plugins does not list my rqt_mypkg plugin
- when I run 'rqt', the GUI pops up but I don't see rqt_mypkg anywhere in the menus
- the command 'rosrun rqt_mypkg rqt_mypkg' gives an error: "[rospack] Error: package 'rqt_mypkg' not found"
UPDATE #1: Do the errors have to do with my directory structure?
There is an existing ROS package in /home/user/ros. I can run catkin_make in /home/user/ros to compile and build that package. When I started the plugin tutorial, I did Step 1, the catkin_create_pkg command, in /home/user/ros. So I now have /home/user/ros/rqt_mypkg. I followed the tutorial exactly and all my rqt files are in /home/user/ros/rqt_mypkg. If I try to run catkin_make in /home/user/ros/rqt_mypkg, I get the message seen below, so instead I run catkin_make in /home/user/ros:
Base path: /home/user/ros/rqt_mypkg The specified base path "/home/user/ros/rqt_mypkg" contains a package but "catkin_make" must be invoked in the root of workspace
Is it correct that I created the the new plugin rqt_pkg underneath the ros project?
UPDATE #2: This is my current directory structure. The original workspace "ros" which is a fully functioning project that I am just trying to add a plugin to. 'rqt_mypkg' is the directory structure I added as I was doing the plugin tutorial.
ros/
build/
lots of files in here
devel/
lots of files in here
src/
CMakeLists.txt (toplevel CMakeLists.txt for a catkin workspace)
project1/
CMakeList.txt (for the project1)
package.xml
x.launch
src/
project1.cpp
include/
include.txt
rqt_mypkg/
CMakeLists.txt (for the rqt_mypkg plugin)
package.xml
plugin.xml
setup.py
resource/
MyPlugin.ui
scripts/
rqt_mypkg
src/
rqt_mypkg/
__init__.py
my_module.py
UPDATE #3: Some progress - thank you! Per your suggestion, I moved rqt_mypkg under ros/src directory. Now when I run catkin_make, I see it is getting compiled as I see these type of statements:
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 2 packages in topological order:
-- ~~ - rqt_mypkg
-- ~~ - project1
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'rqt_mypkg'
-- ==> add_subdirectory(rqt_mypkg)
But when I run 'rqt --standalone rqt_mypkg --force -discover', I still get the same error:
qt_gui_main() found no plugin matching "rqt_mypkg" try passing the option "--force-discover"
When I run 'rqt --list-plugins' my ...