As far as I know the built-in rqt_reconfigure (the gui for dynamic reconfigure) only really has support for sliders (and maybe pull down menus and check boxes but I'm not sure).
But, you don't have to limit yourself to using rqt or even dynamic reconfigure. You can really use ROS with any GUI library you like (C++ or Python ones will be easiest of course).
For example, if you use python, you can use TkInter (the easiest Python GUI library in my opinion/experience, also it ships with Python by default most of the time) and make the callback for the button press publish a message to a topic.
Here is a quick example of a Tkinter button:
from Tkinter import *
master = Tk()
def callback():
print "click!"
b = Button(master, text="OK", command=callback)
b.pack()
mainloop()
You would just make the callback function publish a ROS message instead of printing "click!". More info about Tkinter buttons can be found here.
Using
dynamic_reconfigure
for this sounds like a bit of an abuse of the infrastructure.Creating UIs like this is typically done in RQT, which is the same framework that
rqt_dynamic_reconfigure
is built on top of. See wiki/rqt. Has both Python and C++ bindings.so far I only used dynamic_reconfigure, but this is something i should probably investigate. thx
It's a bit hacky but if you're using Rviz then you can use the 2D nav goal message that is triggered using the Rviz GUI, you can ignore the content of the message and use the message itself as a trigger for an event.