Topic mode: pick one of the dataset's robot_description topics.
| 118 | |
| 119 | // Topic mode: pick one of the dataset's robot_description topics. |
| 120 | std::optional<std::pair<ObjectTopicId, QString>> pickRobotDescriptionTopic( |
| 121 | QWidget* parent, const QList<Scene3DDockWidget::RobotDescriptionTopic>& topics) { |
| 122 | Dialog dialog(parent); |
| 123 | auto* combo = new ComboBox(dialog.contentWidget()); |
| 124 | for (const auto& topic : topics) { |
| 125 | combo->addItem(topic.name, QVariant::fromValue(static_cast<uint>(topic.topic_id.id))); |
| 126 | } |
| 127 | if (!execFieldDialog(dialog, QObject::tr("Robot description topic"), combo) || combo->currentIndex() < 0) { |
| 128 | return std::nullopt; |
| 129 | } |
| 130 | ObjectTopicId topic_id; |
| 131 | topic_id.id = combo->currentData().toUInt(); |
| 132 | return std::make_pair(topic_id, combo->currentText()); |
| 133 | } |
| 134 | |
| 135 | // URL mode: free-text http(s) URDF location. |
| 136 | std::optional<QString> promptUrdfUrl(QWidget* parent) { |
no test coverage detected