Class RouteTool

Inheritance Relationships

Base Type

  • public rviz_common::Panel

Class Documentation

class RouteTool : public rviz_common::Panel

Here we declare our new subclass of rviz::Panel. Every panel which can be added via the Panels/Add_New_Panel menu is a subclass of rviz::Panel.

Public Functions

explicit RouteTool(QWidget *parent = nullptr)

This class uses Qt slots and is a subclass of QObject, so it needs the Q_OBJECT macro. QWidget subclass constructors usually take a parent widget parameter (which usually defaults to 0). At the same time, pluginlib::ClassLoader creates instances by calling the default constructor (with no arguments). Taking the parameter and giving a default of 0 let’s the default constructor work and also let’s someone using the class for something else to pass in a parent widget as they normally would with Qt.

void onInitialize() override
virtual void save(rviz_common::Config config) const

Now we declare overrides of rviz_common::Panel functions for saving and loading data from the config file. Here the data is the topic name.

virtual void load(const rviz_common::Config &config)

Protected Attributes

std::unique_ptr<Ui::route_tool> ui_

Finally, we close up with protected member variables