Class SelectServiceDialog

Inheritance Relationships

Base Type

  • public QDialog

Class Documentation

class SelectServiceDialog : public QDialog

Provides a dialog that the user can use to either list all known ROS services or all ROS services that handle a particular type.

Public Functions

explicit SelectServiceDialog(const rclcpp::Node::SharedPtr &node, const std::string &datatype = "", QWidget *parent = nullptr)

Constructs a new SelectServiceDialog and automatically starts a timer that will refresh the list of services every 5 seconds.

Parameters:
  • datatype[in] The type of service to search for; if empty, it will show the user a list of all services.

  • parent[in] The dialog’s parent widget.

~SelectServiceDialog() override
void setDatatypeFilter(const std::string &datatype)

Set a datatype filter to limit displayed topics based on their types. If the vector is empty (default), the dialog will display all available topics.

Parameters:

datatype[in] The type of service to search for.

std::string selectedService() const

Gets the service the user had selected, or an empty string if there was none.

Returns:

The selected service.

Public Static Functions

static std::string selectService(rclcpp::Node::SharedPtr node, const std::string &datatype, QWidget *parent = 0)

Convenience function for creating a dialog that will prompt the user to select a service and then return the value. If no service was selected, the returned value will be empty.

Parameters:
  • datatype[in] The type of service to search for; if empty, it will show the user a list of all services.

  • parent[in] The dialog’s parent widget.

Returns:

The name of the selected service, or an empty string if there was none.