8 #include <VirtualRobot/XML/RobotIO.h>
15 #include "../KinematicSolver.h"
22 environment = std::make_shared<Environment>();
23 ARMARX_INFO <<
"RobotTrajectoryDesigner: EnvironmentController on init";
29 ARMARX_INFO <<
"RobotTrajectoryDesigner: EnvironmentController on connect";
35 ARMARX_INFO <<
"RobotTrajectoryDesigner: EnvironmentController on disconnect";
41 ARMARX_INFO <<
"RobotTrajectoryDesigner: EnvironmentController on exit";
47 std::string robotFile =
"/RobotAPI/robots/Armar3/ArmarIII.xml";
52 environment->setRobot(
53 VirtualRobot::RobotIO::loadRobot(finder.
getDataDir() + robotFile));
65 environment->setRobot(VirtualRobot::RobotIO::loadRobot(robotFileName));
78 QMessageBox::StandardButton reply;
79 reply = QMessageBox::question(
82 "If you change the robot all trajectories are lost.\nDo you want to change?",
88 QFileDialog dialog(0);
89 dialog.setFileMode(QFileDialog::ExistingFiles);
90 dialog.setAcceptMode(QFileDialog::AcceptOpen);
91 dialog.setNameFilter(tr(
"XML (*.xml)"));
92 QStringList fileNames;
96 fileNames = dialog.selectedFiles();
98 if (fileNames.length() > 1)
100 QMessageBox* toManyFilesSelected =
new QMessageBox;
101 toManyFilesSelected->setWindowTitle(QString::fromStdString(
"Information"));
102 toManyFilesSelected->setText(QString::fromStdString(
103 "To many files selected.\nAs default the first file was taken."));
104 toManyFilesSelected->exec();
106 if (!fileNames.empty())
111 VirtualRobot::RobotIO::loadRobot(fileNames[0].toStdString());
112 environment->setRobot(robot);
117 catch (std::exception& e)
119 QMessageBox* selectRobotFailed =
new QMessageBox;
120 selectRobotFailed->setWindowTitle(QString::fromStdString(
"Error Message"));
121 selectRobotFailed->setText(
122 QString::fromStdString(
"The selected file is not a robot xml file."));
123 selectRobotFailed->exec();