Ask Your Question

Revision history [back]

Have a look at the ros_qml package. Right now the installation process is not very straight forward, but it is definitely easier to create a graphical interface in Qt QML, than writing a plugin for rqt.

Publishing a message from QML is as easy as this:

import QtQuick 2.2
import QtQuick.Controls 1.2
import Ros 1.0

ApplicationWindow {

  Ros {
    id: ros

    Publisher {
      id: pub1
      topic: Topic {
        name: "/my_topic"
        type: "std_msgs/Empty"
      }
    }
  }

  Button {
    text: "Publish"
    onClicked: {
      var now = ros.now()
      ros.loginfo('Sample info message with user data: ' + JSON.stringify(now))

      var msg = {
        seq: 0,
        stamp: now,
        frame_id: 'test_frame',
      }

      pub1.publish(msg)
    }
  }
}

For more example, please see examples/ folder.

Have a look at the ros_qml package. Right now the installation process is not very straight forward, but it is definitely easier to create a graphical interface in Qt QML, than writing a plugin for rqt.

Publishing a message from QML is as easy as this:

import QtQuick 2.2
import QtQuick.Controls 1.2
import Ros 1.0

ApplicationWindow {

  Ros {
    id: ros

    Publisher {
      id: pub1
      topic: Topic {
        name: "/my_topic"
        type: "std_msgs/Empty"
      }
    }
  }

  Button {
    text: "Publish"
    onClicked: {
      var now = ros.now()
      ros.loginfo('Sample info message with user data: ' + JSON.stringify(now))

      var msg = {
        seq: 0,
        stamp: now,
        frame_id: 'test_frame',
      }

      pub1.publish(msg)
    }
  }
}

For more example, examples, please see examples/ folder.

Have a look at the ros_qml package. Right now the installation process is not very straight forward, but it is definitely easier to create a graphical interface in Qt QML, than writing a plugin for rqt.

Publishing a message from QML is as easy as this:

import QtQuick 2.2
import QtQuick.Controls 1.2
import Ros 1.0

ApplicationWindow {

  Ros {
    id: ros

    Publisher {
      id: pub1
      topic: Topic {
        name: "/my_topic"
        type: "std_msgs/Empty"
"std_msgs/Header"
      }
    }
  }

  Button {
    text: "Publish"
    onClicked: {
      var now = ros.now()
      ros.loginfo('Sample info message with user data: ' + JSON.stringify(now))

      var msg = {
        seq: 0,
        stamp: now,
        frame_id: 'test_frame',
      }

      pub1.publish(msg)
    }
  }
}

For more examples, please see examples/ folder.

Have a look at the ros_qml package. Right now the installation process is not very straight forward, but it is definitely easier to create a graphical interface in Qt QML, than writing a plugin for rqt.

Publishing a message from QML is as easy as this:

import QtQuick 2.2
import QtQuick.Controls 1.2
import Ros 1.0

ApplicationWindow {

  Ros {
    id: ros

    Publisher {
      id: pub1
      topic: Topic {
        name: "/my_topic"
        type: "std_msgs/Header"
      }
    }
  }

  Button {
    text: "Publish"
    onClicked: {
      var now = ros.now()
      ros.loginfo('Sample info message with user data: ' + JSON.stringify(now))

      var msg = {
        seq: 0,
        stamp: now,
        frame_id: 'test_frame',
      }

      pub1.publish(msg)
    }
  }
}

For more examples, please see examples/ folder.


EDIT:

ros_qml is an essential part for creating QML GUI "connected" to ROS. It is a QML plugin (module) that exposes ROS features, such as publishers and subscribers. So there is no choice between Qt Quick and ros_qml — you need both. Also the package sets up the proper environment for Qt Creator, such that code-completion works fine for ros_qml.

I believe QML is extremely good for simple GUIs and it is usually a matter of minutes to create an interface.

If you are confident with installing dependencies from source (as described in ros_qml/README.md), then I would recommend to use QML. Otherwise it might be too confusing.

The main hitch with installation is that PyQt 5.4 (Python module used by ros_qml) is precompiled only for Python 3, while ros_qml is written for Python 2.7. Therefore, PyQt has to be built from sources and linked with appropriate version of Python.

P.S. There seems to be not much interest in the package so far, so I didn't bother to simplify the installation process yet.

Have a look at the ros_qml package. Right now the installation process is not very straight forward, but it is definitely easier to create a graphical interface in Qt QML, than writing a plugin for rqt.

Publishing a message from QML is as easy as this:

import QtQuick 2.2
import QtQuick.Controls 1.2
import Ros 1.0

ApplicationWindow {

  Ros {
    id: ros

    Publisher {
      id: pub1
      topic: Topic {
        name: "/my_topic"
        type: "std_msgs/Header"
      }
    }
  }

  Button {
    text: "Publish"
    onClicked: {
      var now = ros.now()
      ros.loginfo('Sample info message with user data: ' + JSON.stringify(now))

      var msg = {
        seq: 0,
        stamp: now,
        frame_id: 'test_frame',
      }

      pub1.publish(msg)
    }
  }
}

For more examples, please see examples/ folder.


EDIT:

ros_qml is an essential part for creating QML GUI "connected" to ROS. It is a QML plugin (module) that exposes ROS features, such as publishers and subscribers. So there is no choice between Qt Quick and ros_qml — you need both. Also the package sets up the proper environment for Qt Creator, such that code-completion works fine for ros_qml.

I believe QML is extremely good for simple GUIs and it is usually a matter of minutes to create an interface.

If you are confident with installing dependencies from source (as described in ros_qml/README.md), then I would recommend to use QML. Otherwise it might be too confusing.

The main hitch with installation is that PyQt 5.4 (Python module used by ros_qml) is precompiled only for Python 3, while ros_qml is written for Python 2.7. Therefore, PyQt has to be built from sources and linked with appropriate version of Python.

P.S. There seems to be not much interest in the package so far, so I didn't bother to simplify the installation process yet.


EDIT:

A common approach to change robot's parameters dynamically is dynamic_reconfigure and it is usually used in combination with rqt_reconfigure GUI. The interface is a quite limited, it lacks push buttons etc., but can be an alternative to full-featured GUI.

Have a look at the ros_qml package. Right now the installation process is not very straight forward, but it is definitely easier to create a graphical interface in Qt QML, than writing a plugin for rqt.

Publishing a message from QML is as easy as this:

import QtQuick 2.2
import QtQuick.Controls 1.2
import Ros 1.0

ApplicationWindow {

  Ros {
    id: ros

    Publisher {
      id: pub1
      topic: Topic {
        name: "/my_topic"
        type: "std_msgs/Header"
      }
    }
  }

  Button {
    text: "Publish"
    onClicked: {
      var now = ros.now()
      ros.loginfo('Sample info message with user data: ' + JSON.stringify(now))

      var msg = {
        seq: 0,
        stamp: now,
        frame_id: 'test_frame',
      }

      pub1.publish(msg)
    }
  }
}

For more examples, please see examples/ folder.


EDIT:

ros_qml is an essential part for creating QML GUI "connected" to ROS. It is a QML plugin (module) that exposes ROS features, such as publishers and subscribers. So there is no choice between Qt Quick and ros_qml — you need both. Also the package sets up the proper environment for Qt Creator, such that code-completion works fine for ros_qml.

I believe QML is extremely good for simple GUIs and it is usually a matter of minutes to create an interface.

If you are confident with installing dependencies from source (as described in ros_qml/README.md), then I would recommend to use QML. Otherwise it might be too confusing.

The main hitch with installation is that PyQt 5.4 (Python module used by ros_qml) is precompiled only for Python 3, while ros_qml is written for Python 2.7. Therefore, PyQt has to be built from sources and linked with appropriate version of Python.

P.S. There seems to be not much interest in the package so far, so I didn't bother to simplify the installation process yet.


EDIT:

A common approach to change robot's parameters dynamically is dynamic_reconfigure and it is usually used in combination with rqt_reconfigure GUI. The interface is a quite limited, it lacks push buttons etc., but can be an alternative to full-featured GUI.