30#include <QDialogButtonBox>
34#include <QtWidgets/QLabel>
35#include <qboxlayout.h>
38#include <qobjectdefs.h>
41#include <VirtualRobot/Robot.h>
47#include <RobotAPI/interface/core/RobotState.h>
59 _enabled =
new QCheckBox(
"Enable Visu",
this);
60 _enabled->setChecked(
true);
62 _collisionModel =
new QCheckBox(
"Use Collision Model",
this);
63 _collisionModel->setChecked(
false);
66 setLayout(
new QVBoxLayout());
67 layout()->addWidget(_enabled);
68 layout()->addWidget(_collisionModel);
72 connect(_collisionModel, &QCheckBox::toggled,
this, &
This::changed);
75 setContentsMargins(margin, margin, margin, margin);
81 return _enabled->isChecked();
87 return _collisionModel->isChecked();
97 _filename = robotStateComponent->getRobotFilename();
99 robotStateComponent,
"", {}, VirtualRobot::RobotIO::RobotDescription::eStructure);
110 _synchronize(synchronize);
114 std::map<std::string, float>
117 _synchronize(synchronize);
118 return _robot->getConfig()->getRobotNodeJointValueMap();
124 _synchronize(synchronize);
128 if (_settings and _settings->useCollisionModel())
139 return *_robotStateComponent;
149 robotvisu::Connection::_synchronize(
bool synchronize)
160 _statusLabel =
new QLabel(
"Not connected",
this);
161 _connectButton =
new QPushButton(
"Connect ...",
this);
164 _settings->setEnabled(
false);
167 QBoxLayout* layout =
new QVBoxLayout(
this);
170 layout->addWidget(_statusLabel);
171 layout->addWidget(_connectButton);
172 layout->addWidget(_settings);
184 QString name = QString::fromStdString(
connection().getConnectedName());
185 _statusLabel->setText(
"Connected to '" + name +
"'");
187 connect(
this, &
This::connected,
this, [
this]() { _settings->setEnabled(
true); });
199 return _connection.has_value();
205 return _connection.value();
212 "*RobotStateComponent", _component,
this);
213 switch (dialog.exec())
215 case QDialog::Accepted:
217 case QDialog::Rejected:
221 auto robotStateComponent = dialog.
getProxy();
222 if (robotStateComponent)
224 _connection.emplace(robotStateComponent, _settings);
The ManagedIceObject is the base class for all ArmarX objects.
VirtualRobot::RobotPtr createLocalClone()
Clones the structure of this remote robot to a local instance.
static bool synchronizeLocalClone(VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx)
Connection(RobotStateComponentInterfacePrx robotStateComponent, robotvisu::SettingsWidget *settings)
RobotStateComponentInterfacePrx getRobotStateComponent() const
std::map< std::string, float > getJointValues(bool synchronize=true)
viz::Robot vizRobot(const std::string &id, bool synchronize=true)
std::string getConnectedName() const
core::Pose getGlobalPose(bool synchronize=true)
DerivedT & pose(Eigen::Matrix4f const &pose)
Robot & useCollisionModel()
Robot & file(std::string const &project, std::string const &filename)
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx