4 #include <VirtualRobot/XML/RobotIO.h>
9 #include "../KinematicSolver.h"
10 #include <QMessageBox>
16 environment = std::make_shared<Environment>();
17 ARMARX_INFO <<
"RobotTrajectoryDesigner: EnvironmentController on init";
22 ARMARX_INFO <<
"RobotTrajectoryDesigner: EnvironmentController on connect";
27 ARMARX_INFO <<
"RobotTrajectoryDesigner: EnvironmentController on disconnect";
32 ARMARX_INFO <<
"RobotTrajectoryDesigner: EnvironmentController on exit";
37 std::string robotFile =
"/RobotAPI/robots/Armar3/ArmarIII.xml";
42 environment->setRobot(VirtualRobot::RobotIO::loadRobot(finder.
getDataDir() + robotFile));
53 environment->setRobot(VirtualRobot::RobotIO::loadRobot(robotFileName));
65 QMessageBox::StandardButton reply;
66 reply = QMessageBox::question(0,
"Select robot",
"If you change the robot all trajectories are lost.\nDo you want to change?",
QMessageBox::Yes |
QMessageBox::No);
71 QFileDialog dialog(0);
72 dialog.setFileMode(QFileDialog::ExistingFiles);
73 dialog.setAcceptMode(QFileDialog::AcceptOpen);
74 dialog.setNameFilter(tr(
"XML (*.xml)"));
75 QStringList fileNames;
79 fileNames = dialog.selectedFiles();
81 if (fileNames.length() > 1)
83 QMessageBox* toManyFilesSelected =
new QMessageBox;
84 toManyFilesSelected->setWindowTitle(QString::fromStdString(
"Information"));
85 toManyFilesSelected->setText(QString::fromStdString(
"To many files selected.\nAs default the first file was taken."));
86 toManyFilesSelected->exec();
88 if (!fileNames.empty())
93 environment->setRobot(robot);
98 catch (std::exception& e)
100 QMessageBox* selectRobotFailed =
new QMessageBox;
101 selectRobotFailed->setWindowTitle(QString::fromStdString(
"Error Message"));
102 selectRobotFailed->setText(QString::fromStdString(
"The selected file is not a robot xml file."));
103 selectRobotFailed->exec();