MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / pickRobotDescriptionTopic

Function pickRobotDescriptionTopic

pj_app/src/ui/Scene3DConfigPanel.cpp:120–133  ·  view source on GitHub ↗

Topic mode: pick one of the dataset's robot_description topics.

Source from the content-addressed store, hash-verified

118
119// Topic mode: pick one of the dataset's robot_description topics.
120std::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.
136std::optional<QString> promptUrdfUrl(QWidget* parent) {

Callers 1

onAddModelClickedMethod · 0.85

Calls 4

execFieldDialogFunction · 0.85
trFunction · 0.85
contentWidgetMethod · 0.80
addItemMethod · 0.45

Tested by

no test coverage detected