Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

ROS_Hydro support running the plugin

68 views
Skip to first unread message

mfr...@vt.edu

unread,
Nov 18, 2014, 11:37:49 AM11/18/14
to ros-s...@googlegroups.com
Good morning,


   I am having some difficulties trying to create my own custom rqt plugin in c++. I looked at the tutorials on how to set up a rqt plugin using the following sites

1. http://wiki.ros.org/rqt/Tutorials/Writing%20a%20C%2B%2B%20Plugin
2. http://wiki.ros.org/rqt/Tutorials/Create%20your%20new%20rqt%20plugin


  From what I understand I should be able to use the command "rosrun rqt_mypkg rqt_mypkg" to run my plugin. However I am unable to find the executable for rqt_mypkg ros package. Again I am not sure if thats the proper way, but after reading the document on running the plugin the command "rqt" was also suppose to allow me to run the custom rqt plugin as well.

 I did find that using the command "rqt --standalone rqt_mypkg" ran pulled up the UI file that I created, I believe then that the plugin is findable, but I cannot see it any other way.


Finally if I want to use the plugin in a launch file is there any documentation on that? I saw some information regarding rqt_launch package and it can be better than roslaunch, but I didnt see the proper way of running a plugin in launch file.

I look forward to hearing about anyones thoughts on this subject.

Sincerely
Mike

Aaron Blasdel

unread,
Nov 19, 2014, 12:06:46 PM11/19/14
to ros-s...@googlegroups.com, mfr...@vt.edu
Hello Mike,

Welcome to ROS!

I think the issue you are running into is that all the common/robot plugins in the main repos have an executable launch script created for them like this:

These scripts allow the rosrun behavior you are looking for. That isn't in the tutorials.

Otherwise if you can see your plugin with rqt --standalone your plugin should be setup just fine. 
If you just run "rqt" you will need to select your plugin from the drop down menu.

As for roslaunch tutorials this isn't really the sig for that but have you seen this tutorial? http://wiki.ros.org/roslaunch/Tutorials/Roslaunch%20tips%20for%20larger%20projects

Hope this helped!
Aaron

mfr...@vt.edu

unread,
Nov 19, 2014, 2:22:24 PM11/19/14
to ros-s...@googlegroups.com, mfr...@vt.edu
Hey Aaron

Thanks for the response! I do have the script you are talking about, which is why the default rqt plugin is able to recognize my plugin as a standalone. I did find my plugin under the list of plugins of the default rqt plugin. However I still dont understand how that script would create an executable such that i can use "rosrun rqt_mypkg rqt_mypkg" , in the cmakelist.txt file I dont see any instances of add_executable(), is the script suppose create that? I dont have an executable yet.

For the time being I think I will be okay with launching the gui using the default rqt.

As for the roslaunch  question I had I found a sample launch file with rqt node being used
<launch>

  <!-- Load RQT with a pre-setup GUI for Baxter controls from a perspective file  -->
  <node name="rrbot_rqt" pkg="rqt_gui" type="rqt_gui" respawn="false"
    output="screen" args="--perspective-file $(find rrbot_control)/launch/rrbot_rqt.perspective"/>
 
</launch>

however I assumed I could use the standalone argument in the args section and I got an error at run time saying that invalid syntax at that line
<launch>

  <node name="rqt_mypkg" pkg="rqt_gui" type="rqt_gui" respawn="false"
    output="screen" args="--standalone rqt_mypkg/>
 
</launch>

Am I not using the args input correctly?


On Wednesday, November 19, 2014 12:06:46 PM UTC-5, Aaron Blasdel wrote:
Hello Mike,

Welcome to ROS!

Aaron Blasdel

unread,
Nov 20, 2014, 11:53:07 AM11/20/14
to ros-s...@googlegroups.com, mfr...@vt.edu
Hey Mike,


I do have the script you are talking about, which is why the default rqt plugin is able to recognize my plugin as a standalone.
Incorrect, You have it backwards. 
The script I am talking about is running your plugin in stand alone mode. 
To prove this to yourself try deleting the script and see if you can still run stand alone. (hint: You can.)
 
However I still dont understand how that script would create an executable such that i can use "rosrun rqt_mypkg rqt_mypkg"
In the RQT framework you are writing a plugin library so you won't ever get a separate executable file for your plugin. It will always have to be run through RQT.
If you want to run from rosrun like this you need the script I mentioned before. 
If it is still not working make sure you have the rqt_mypkg script set to executable.
 
I dont have an executable yet. 
For the time being I think I will be okay with launching the gui using the default rqt.
You can use the script to make it behave similarly.
 

*snipped Launch question*
I think for the launch questions your best bet would be to post them answers.ros.org

Thanks!
Aaron Blasdel
Reply all
Reply to author
Forward
0 new messages