|
autonomy_datasets v1.6.0
|
#include <playback_panel.hpp>
Signals | |
| void | requestFinished (const QString &position, const QString &status, bool success) |
| Reports the outcome of a sample request from the thread that received the response. | |
Public Member Functions | |
| PlaybackPanel (QWidget *parent=nullptr) | |
| Creates the panel and its widgets, without connecting to a service yet. | |
| ~PlaybackPanel () override | |
| Destroys the panel, dropping the service client before the RViz node goes away. | |
| PlaybackPanel (const PlaybackPanel &)=delete | |
| Copy construction is disabled because the panel owns Qt and ROS resources. | |
| PlaybackPanel & | operator= (const PlaybackPanel &)=delete |
| Copy assignment is disabled because the panel owns Qt and ROS resources. | |
| PlaybackPanel (PlaybackPanel &&)=delete | |
| Move construction is disabled because RViz owns the panel lifecycle. | |
| PlaybackPanel & | operator= (PlaybackPanel &&)=delete |
| Move assignment is disabled because RViz owns the panel lifecycle. | |
| void | onInitialize () override |
| Picks up the ROS node of RViz and creates the client for the configured service. | |
| void | load (const rviz_common::Config &config) override |
| Restores the service name and step size stored in the RViz configuration. | |
| void | save (rviz_common::Config config) const override |
| Stores the service name and step size in the RViz configuration. | |
Private Member Functions | |
| void | onServiceNameChanged () |
| Re-creates the service client after the service name has been edited. | |
| void | onPauseClicked () |
| Requests no sample at all, which stops the playback at the current sample. | |
| void | onStepClicked () |
| Requests the next samples, which advances the playback by the configured step size. | |
| void | onSkipClicked () |
| Requests the entered sample IDs, which skips the playback ahead to them. | |
| void | onPlayClicked () |
| Requests all remaining samples, which runs the playback to the end of the dataset. | |
| void | updateAvailability () |
| Tracks whether the service is available and reflects it in the panel. | |
| void | applyRequestResult (const QString &position, const QString &status, bool success) |
| Shows the outcome of a sample request and re-enables the controls. | |
| bool | eventFilter (QObject *watched, QEvent *event) override |
| Re-shortens the reported texts whenever one of the labels showing them is resized. | |
| void | setupUi () |
| Creates the widgets of the panel and connects them to their handlers. | |
| void | showPosition (const QString &text) |
| Reports which sample the dataset node published last. | |
| void | showStatus (const QString &text) |
| Reports what the panel is waiting for or what a request resulted in. | |
| void | createClient () |
| Creates the service client for the service name currently entered in the panel. | |
| void | sendRequest (uint8_t mode, uint64_t num_samples, const std::vector< uint64_t > &sample_ids, const QString &pending_status) |
| Sends a sample request and reports its response through requestFinished(). | |
| void | updateControlState () |
| Enables the controls that may be used while no request is being processed. | |
| std::vector< uint64_t > | parseSampleIds (QString *error) const |
| Reads the sample IDs entered in the panel. | |
Static Private Member Functions | |
| static void | showElided (QLabel *label, const QString &text) |
| Shows as much of a text as fits into a label and offers all of it as its tooltip. | |
| static QString | describePosition (const autonomy_datasets_msgs::srv::RequestSamples::Response &response) |
| Describes the sample a response reports as published last. | |
Private Attributes | |
| QLineEdit * | service_name_edit_ {nullptr} |
| Name of the request_samples service of the dataset node to control. | |
| QSpinBox * | step_size_spin_ {nullptr} |
| Number of samples a step advances the playback by. | |
| QLineEdit * | sample_ids_edit_ {nullptr} |
| Sample IDs to skip ahead to. | |
| QPushButton * | pause_button_ {nullptr} |
| Stops the playback at the current sample. | |
| QPushButton * | step_button_ {nullptr} |
| Advances the playback by the configured step size. | |
| QPushButton * | skip_button_ {nullptr} |
| Skips the playback ahead to the entered sample IDs. | |
| QPushButton * | play_button_ {nullptr} |
| Runs the playback to the end of the dataset. | |
| QLabel * | position_label_ {nullptr} |
| Sample the dataset node published last. | |
| QLabel * | status_label_ {nullptr} |
| Outcome of the last request, or why no request can be sent. | |
| QTimer * | availability_timer_ {nullptr} |
| Polls whether the service is available, as the panel cannot be notified about it. | |
| rclcpp::Node::SharedPtr | node_ |
| ROS node of RViz, which its executor spins. | |
| rclcpp::Client< autonomy_datasets_msgs::srv::RequestSamples >::SharedPtr | client_ |
| Client of the request_samples service of the dataset node. | |
| bool | request_in_flight_ {false} |
| Whether a request has been sent whose response has not arrived yet. | |
| bool | service_available_ {false} |
| Whether the service was available the last time it was polled. | |
| QString | position_text_ |
| Full text reported by position_label_, of which only what fits is shown. | |
| QString | status_text_ |
| Full text reported by status_label_, of which only what fits is shown. | |
Definition at line 33 of file playback_panel.hpp.
|
explicit |
Creates the panel and its widgets, without connecting to a service yet.
| parent | widget taking ownership of the panel, as usual for Qt widgets |
Definition at line 37 of file playback_panel.cpp.
|
override |
Destroys the panel, dropping the service client before the RViz node goes away.
Definition at line 39 of file playback_panel.cpp.
|
delete |
Copy construction is disabled because the panel owns Qt and ROS resources.
|
delete |
Move construction is disabled because RViz owns the panel lifecycle.
|
private |
Shows the outcome of a sample request and re-enables the controls.
Only ever called on the GUI thread, as the response of a request may reach the panel on whichever thread the executor of RViz runs on.
| position | description of the sample the dataset node published last |
| status | description of the outcome, as reported by the service |
| success | whether all requested samples have been published |
Definition at line 330 of file playback_panel.cpp.
|
private |
Creates the service client for the service name currently entered in the panel.
Definition at line 196 of file playback_panel.cpp.
|
staticprivate |
Describes the sample a response reports as published last.
| response | response of the sample request |
Definition at line 317 of file playback_panel.cpp.
|
overrideprivate |
Re-shortens the reported texts whenever one of the labels showing them is resized.
| watched | object the event is delivered to |
| event | event delivered to the watched object |
Definition at line 137 of file playback_panel.cpp.
|
override |
Restores the service name and step size stored in the RViz configuration.
| config | RViz configuration to read the panel settings from |
Definition at line 174 of file playback_panel.cpp.
|
override |
Picks up the ROS node of RViz and creates the client for the configured service.
Definition at line 168 of file playback_panel.cpp.
|
private |
Requests no sample at all, which stops the playback at the current sample.
Definition at line 243 of file playback_panel.cpp.
|
private |
Requests all remaining samples, which runs the playback to the end of the dataset.
Definition at line 270 of file playback_panel.cpp.
|
private |
Re-creates the service client after the service name has been edited.
Definition at line 208 of file playback_panel.cpp.
|
private |
Requests the entered sample IDs, which skips the playback ahead to them.
Definition at line 255 of file playback_panel.cpp.
|
private |
Requests the next samples, which advances the playback by the configured step size.
Definition at line 249 of file playback_panel.cpp.
|
delete |
Copy assignment is disabled because the panel owns Qt and ROS resources.
|
delete |
Move assignment is disabled because RViz owns the panel lifecycle.
|
private |
Reads the sample IDs entered in the panel.
| error | set to a description of the first malformed entry, if there is one |
Definition at line 274 of file playback_panel.cpp.
|
signal |
Reports the outcome of a sample request from the thread that received the response.
Connected to applyRequestResult() as a queued connection, so that the widgets are only ever touched by the GUI thread, no matter which thread the executor of RViz answers the request on. Qt drops the queued call if the panel is closed before it is delivered.
| position | description of the sample the dataset node published last |
| status | description of the outcome, as reported by the service |
| success | whether all requested samples have been published |
|
override |
Stores the service name and step size in the RViz configuration.
| config | RViz configuration to write the panel settings to |
Definition at line 190 of file playback_panel.cpp.
|
private |
Sends a sample request and reports its response through requestFinished().
| mode | requested playback mode, one of the MODE_* constants of the service |
| num_samples | number of samples to publish in MODE_NEXT_SAMPLES |
| sample_ids | IDs of the samples to publish in MODE_SAMPLE_IDS |
| pending_status | description of the request, shown while it is being processed |
Definition at line 289 of file playback_panel.cpp.
|
private |
Creates the widgets of the panel and connects them to their handlers.
Definition at line 46 of file playback_panel.cpp.
|
staticprivate |
Shows as much of a text as fits into a label and offers all of it as its tooltip.
The panel is docked beside the render window of RViz, where a scene ID or a message of the service would widen it far beyond the width its controls need.
| label | label to show the text in |
| text | text to show, shortened at its end where it does not fit |
Definition at line 158 of file playback_panel.cpp.
|
private |
Reports which sample the dataset node published last.
| text | description of the sample |
Definition at line 148 of file playback_panel.cpp.
|
private |
Reports what the panel is waiting for or what a request resulted in.
| text | description of the state or of the outcome |
Definition at line 153 of file playback_panel.cpp.
|
private |
Tracks whether the service is available and reflects it in the panel.
Definition at line 213 of file playback_panel.cpp.
|
private |
Enables the controls that may be used while no request is being processed.
Definition at line 233 of file playback_panel.cpp.
|
private |
Polls whether the service is available, as the panel cannot be notified about it.
Definition at line 241 of file playback_panel.hpp.
|
private |
Client of the request_samples service of the dataset node.
Definition at line 246 of file playback_panel.hpp.
|
private |
ROS node of RViz, which its executor spins.
Definition at line 244 of file playback_panel.hpp.
|
private |
Stops the playback at the current sample.
Definition at line 229 of file playback_panel.hpp.
|
private |
Runs the playback to the end of the dataset.
Definition at line 235 of file playback_panel.hpp.
|
private |
Sample the dataset node published last.
Definition at line 237 of file playback_panel.hpp.
|
private |
Full text reported by position_label_, of which only what fits is shown.
Definition at line 252 of file playback_panel.hpp.
|
private |
Whether a request has been sent whose response has not arrived yet.
Definition at line 248 of file playback_panel.hpp.
|
private |
|
private |
Whether the service was available the last time it was polled.
Definition at line 250 of file playback_panel.hpp.
|
private |
Name of the request_samples service of the dataset node to control.
Definition at line 223 of file playback_panel.hpp.
|
private |
Skips the playback ahead to the entered sample IDs.
Definition at line 233 of file playback_panel.hpp.
|
private |
Outcome of the last request, or why no request can be sent.
Definition at line 239 of file playback_panel.hpp.
|
private |
Full text reported by status_label_, of which only what fits is shown.
Definition at line 254 of file playback_panel.hpp.
|
private |
Advances the playback by the configured step size.
Definition at line 231 of file playback_panel.hpp.
|
private |
Number of samples a step advances the playback by.
Definition at line 225 of file playback_panel.hpp.