23 #include <QMessageBox>
26 #include <MemoryX/gui-plugins/PriorMemoryEditor/ui_ManipulationAttributesEditTab.h>
42 robotStateComponent(robotStateComponent)
47 connect(ui->rbManipulationFile, SIGNAL(toggled(
bool)),
this, SLOT(
update()));
48 connect(ui->rbIVFiles, SIGNAL(toggled(
bool)),
this, SLOT(
update()));
52 manipulationFileDialog =
new QFileDialog(parent);
53 manipulationFileDialog->setModal(
true);
54 manipulationFileDialog->setFileMode(QFileDialog::ExistingFiles);
55 manipulationFileDialog->setNameFilter(tr(
"Manipulation Object XML (*.xml *.moxml)"));
56 connect(ui->btnSelectManipulationFile, SIGNAL(clicked()), manipulationFileDialog, SLOT(show()));
58 connect(ui->btnEditGrasps, SIGNAL(clicked()),
this, SLOT(
editGrasps()));
61 visuFileDialog =
new QFileDialog(parent);
62 visuFileDialog->setModal(
true);
63 visuFileDialog->setFileMode(QFileDialog::ExistingFiles);
64 visuFileDialog->setNameFilter(tr(
"Inventor & VRML models (*.iv *.wrl)"));
65 connect(ui->btnSelectVisuFile, SIGNAL(clicked()), visuFileDialog, SLOT(show()));
69 collisionFileDialog =
new QFileDialog(parent);
70 collisionFileDialog->setModal(
true);
71 collisionFileDialog->setFileMode(QFileDialog::ExistingFiles);
72 collisionFileDialog->setNameFilter(tr(
"Inventor & VRML models (*.iv *.wrl)"));
73 connect(ui->btnSelectCollisionFile, SIGNAL(clicked()), collisionFileDialog, SLOT(show()));
89 ui->rbManipulationFile->setChecked(
true);
90 ui->editManipulationFile->setText(QString::fromStdString(simoxWrapper->getManipulationObjectFileName()));
92 Eigen::Vector3f putdownOrientation = simoxWrapper->getPutdownOrientationRPY();
93 ui->editPutdownOrientationR->setText(QString::number(putdownOrientation(0)));
94 ui->editPutdownOrientationP->setText(QString::number(putdownOrientation(1)));
95 ui->editPutdownOrientationY->setText(QString::number(putdownOrientation(2)));
106 if (ui->rbManipulationFile->isChecked())
108 simoxWrapper->setAndStoreManipulationFile(ui->editManipulationFile->text().toStdString(), filesDBName);
112 simoxWrapper->setAndStoreModelIVFiles(ui->editVisuFile->text().toStdString(),
113 ui->editCollisionFile->text().toStdString(),
117 Eigen::Vector3f putdownOrientation;
118 putdownOrientation(0) = std::stof(ui->editPutdownOrientationR->text().toStdString());
119 putdownOrientation(1) = std::stof(ui->editPutdownOrientationP->text().toStdString());
120 putdownOrientation(2) = std::stof(ui->editPutdownOrientationY->text().toStdString());
121 simoxWrapper->setPutdownOrientationRPY(putdownOrientation);
126 ui->editManipulationFile->setText(manipulationFileDialog->selectedFiles()[0]);
131 ui->editVisuFile->setText(visuFileDialog->selectedFiles()[0]);
136 ui->editCollisionFile->setText(collisionFileDialog->selectedFiles()[0]);
141 if (ui->editManipulationFile->text().isEmpty())
144 msgBox.setText(
"Please select a manipulation file first.");
145 msgBox.setIcon(QMessageBox::Information);
146 msgBox.setStandardButtons(QMessageBox::Ok);
147 msgBox.setDefaultButton(QMessageBox::Ok);
152 std::string robotFile(
"/usr/local/data/robots/ArmarIII/ArmarIII.xml");
153 std::string localRobot =
"RobotAPI/robots/Armar3/ArmarIII.xml";
157 robotFile = localRobot;
160 if (robotStateComponent)
162 for (
auto package : robotStateComponent->getArmarXPackages())
164 auto path = robotStateComponent->getRobotFilename();
178 std::string objectFile(ui->editManipulationFile->text().toStdString());
187 const bool moFile = ui->rbManipulationFile->isChecked();
188 ui->editManipulationFile->setEnabled(moFile);
189 ui->lblManipulationFile->setEnabled(moFile);
190 ui->btnSelectManipulationFile->setEnabled(moFile);
191 ui->btnEditGrasps->setEnabled(moFile);
193 ui->editVisuFile->setEnabled(!moFile);
194 ui->lblVisuFile->setEnabled(!moFile);
195 ui->btnSelectVisuFile->setEnabled(!moFile);
197 ui->editCollisionFile->setEnabled(!moFile);
198 ui->lblCollisionFile->setEnabled(!moFile);
199 ui->btnSelectCollisionFile->setEnabled(!moFile);