Publishing/Subscribing from/to Qt GUI to ROS
Hi,
I am working on qt based GUI tool that I found in ROS wiki. As I understand, this package provides the basic requirement to interface Qt to ROS by means of a QNode
class (a Thread). This package template, publishes chatter
topic by means of the QNode Thread, using the run
method. so my question is, how can one publish/subscribe values from Qt elements like a qSlider, qButton, qLineEdit, qProgressBar... etc to ROS? I am not very familiar with Thread programming, How can I pass these values to the QNode Thread...? PFB is portion of code to get an Idea:
/*********************
** Logging
**********************/
ui.view_logging->setModel(qnode.loggingModel());
QObject::connect(&qnode, SIGNAL(loggingUpdated()), this, SLOT(updateLoggingView()));
/*********************
** Auto Start
**********************/
if ( ui.checkbox_remember_settings->isChecked() ) {
on_button_connect_clicked(true);
}
/*********************
**
Values That I need to publish
**********************/
ui.linearVelprogressBar->setValue(ui.linearVelhorizontalSlider->value());
ui.angularVelprogressBar->setValue(ui.angularVeldial->value());
connect(ui.linearVelhorizontalSlider,SIGNAL(valueChanged(int)),ui.linearVelprogressBar,SLOT(setValue(int)));
connect(ui.angularVeldial,SIGNAL(valueChanged(int)),ui.angularVelprogressBar,SLOT(setValue(int)));
here is sample GUI...
If anyone has worked on this, Please give me an Idea to perform the above... Thanks in advance.
Murali
This is what i'm looking for. Did you get the answer?
I was not able to find a solution with qt and C++; so I switched over to GLADE+gtk+python for GUI development, it is relatively simpler to understand and quicker to code. There are some issues with this method too ( ~ similar to the one mentioned above); will post the link shortly.