Go to the documentation of this file.
27 #include <QMainWindow>
30 #include <QStringList>
31 #include <QPluginLoader>
34 #include <QGridLayout>
35 #include <QStackedWidget>
37 #include <QPlainTextEdit>
40 #include <QSignalMapper>
41 #include <QActionGroup>
42 #include <QModelIndex>
43 #include <QListWidget>
44 #include <QDockWidget>
45 #include <QHBoxLayout>
46 #include <QDialogButtonBox>
47 #include <QProxyStyle>
56 #include <Inventor/nodes/SoNode.h>
57 #include <Inventor/nodes/SoSeparator.h>
58 #include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
67 #include <SimDynamics/DynamicsEngine/DynamicsEngine.h>
68 #include <SimDynamics/DynamicsWorld.h>
69 #include <SimDynamics/DynamicsEngine/BulletEngine/BulletEngine.h>
70 #include <SimDynamics/DynamicsEngine/DynamicsRobot.h>
71 #include <SimDynamics/DynamicsEngine/DynamicsObject.h>
76 #include <ArmarXSimulation/applications/SimulatorViewer/ui_ArmarXSimulatorWindow.h>
78 #include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
99 defineOptionalProperty<bool>(
"ShowBaseCoordSystem",
false,
"Enable/disbale a coordinate visualization at the global root.");
100 defineOptionalProperty<int>(
"AntiAliasingRenderPasses", 4,
"If >0 anti aliasing is enabled (may slow down the visualization). Defines the number of render passes.");
102 defineOptionalProperty<float>(
"Camera.x", 0.f,
"x component of initial camera position (mm)");
103 defineOptionalProperty<float>(
"Camera.y", 0.f,
"y component of initial camera position (mm)");
104 defineOptionalProperty<float>(
"Camera.z", 0.f,
"z component of initial camera position (mm)");
105 defineOptionalProperty<float>(
"Camera.roll", 0.f,
"Initial camera pose: roll component of RPY angles (radian)");
106 defineOptionalProperty<float>(
"Camera.pitch", 0.f,
"Initial camera pose: pitch component of RPY angles (radian)");
107 defineOptionalProperty<float>(
"Camera.yaw", 0.f,
"Initial camera pose: yaw component of RPY angles (radian)");
108 defineOptionalProperty<std::string>(
"TempDir",
"/tmp",
"Local temp directory. Used for storing video files.");
109 defineOptionalProperty<bool>(
"SaveVideo",
false,
"Enable/disbale video recording (video is stored to tmp directory, currently only BMP files are supported.");
110 defineOptionalProperty<float>(
"Background.r", 1.f,
"r component of initial background color [0, 1]");
111 defineOptionalProperty<float>(
"Background.g", 1.f,
"g component of initial background color [0, 1]");
112 defineOptionalProperty<float>(
"Background.b", 1.f,
"b component of initial background color [0, 1]");
120 virtual public SimulatorViewerControlInterface,
132 return "ArmarXSimulatorWindow";
181 void clearLayer(
const std::string& layerName, const ::Ice::Current& = Ice::emptyCurrent)
override;
182 void removeLayer(
const std::string& layerName, const ::Ice::Current& = Ice::emptyCurrent)
override;
183 void enableLayerVisu(
const std::string& layerName,
bool visible, const ::Ice::Current& = Ice::emptyCurrent)
override;
184 ::armarx::LayerInformationSequence
layerInformation(const ::Ice::Current& = Ice::emptyCurrent)
override;
186 void setTempPath(
const std::string& p, const ::Ice::Current& = Ice::emptyCurrent)
override;
187 void saveScreenshots(
bool enable, const ::Ice::Current& = Ice::emptyCurrent)
override;
191 void selectVisuType(
bool fullModel,
const Ice::Current&
c = Ice::emptyCurrent)
override;
192 void showBaseCoordSystem(
bool show,
float scale = 1.0,
const Ice::Current&
c = Ice::emptyCurrent)
override;
196 void setAntiAliasing(
int steps,
const Ice::Current&
c = Ice::emptyCurrent)
override;
198 PoseBasePtr
getCameraPose(
const Ice::Current&
c = Ice::emptyCurrent)
override;
202 void setCamPose(
float x,
float y,
float z,
float roll,
float pitch,
float yaw);
227 Ui::MainWindowArmarXSimulator
ui;
244 armarx::SimulatorViewerInformation
info;
252 QString guiWindowBaseName;
void initialize(ArmarXPhysicsWorldVisualizationPtr physicsVisu, DebugDrawerComponentPtr debugDrawer)
DebugDrawerComponentPtr debugDrawer
void setMutex(CoinViewer::RecursiveMutexPtr const &m)
void slotSelectVisuType(bool visible)
::armarx::LayerInformationSequence layerInformation(const ::Ice::Current &=Ice::emptyCurrent) override
void setTempPath(const std::string &p, const ::Ice::Current &=Ice::emptyCurrent) override
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
ArmarXPhysicsWorldVisualizationPtr physicsVisu
void slotClearDebugDrawLayer()
void enableLayerVisu(const std::string &layerName, bool visible, const ::Ice::Current &=Ice::emptyCurrent) override
void onDisconnectComponent() override
Hook for subclass.
void saveScreenshots(bool enable, const ::Ice::Current &=Ice::emptyCurrent) override
Ui::MainWindowArmarXSimulator ui
void setCamPose(float x, float y, float z, float roll, float pitch, float yaw)
void slotShowBaseCoord(bool show, float scale)
void closeRequest()
emitted, when the main window should be closed
ArmarXSimulatorWindowPropertyDefinitions(std::string prefix)
void slotEnableDebugDrawLayer(bool show)
CoinViewer::RecursiveMutexPtr mutex
void setAntiAliasing(int steps, const Ice::Current &c=Ice::emptyCurrent) override
void showBaseCoordSystem(bool show, float scale=1.0, const Ice::Current &c=Ice::emptyCurrent) override
void clearLayer(const std::string &layerName, const ::Ice::Current &=Ice::emptyCurrent) override
void onConnectComponent() override
Pure virtual hook for the subclass.
void showDebugDrawLayer(bool show, const Ice::Current &c=Ice::emptyCurrent) override
std::shared_ptr< RecursiveMutex > RecursiveMutexPtr
void onExitComponent() override
Hook for subclass.
void removeLayer(const std::string &layerName, const ::Ice::Current &=Ice::emptyCurrent) override
~ArmarXSimulatorWindow() override
void slotEnableLayerVisu(const QString layerName, bool visible)
Baseclass for all ArmarX ManagedIceObjects requiring properties.
std::string getDefaultName() const override
Retrieve default name of component.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
void setCamPoseFromConfig()
MatrixXX< 4, 4, float > Matrix4f
Default component property definition container.
SimulatorViewerInformation getSimulatorInformation(const Ice::Current &c=Ice::emptyCurrent) override
void slotClearLayer(const QString layerName)
Eigen::Matrix4f getCamPose()
void enableSimulatorWindow(bool show, const Ice::Current &c=Ice::emptyCurrent) override
void setDrawTimeMeasured(float ms)
CoinViewer::RecursiveMutexLockPtr getScopedLock()
Protect access with this lock.
void clearDebugDrawLayer(const Ice::Current &c=Ice::emptyCurrent) override
static void timerCB(void *data, SoSensor *sensor)
void selectVisuType(bool fullModel, const Ice::Current &c=Ice::emptyCurrent) override
Switch between full/collision model.
std::shared_ptr< RecursiveMutexLock > RecursiveMutexLockPtr
void slotRemoveLayer(const QString layerName)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
void closeEvent(QCloseEvent *event) override
emits the closeRequest signal
void onInitComponent() override
Pure virtual hook for the subclass.
This file offers overloads of toIce() and fromIce() functions for STL container types.
PropertyDefinitionsPtr createPropertyDefinitions() override
void setupAntiAliasing(int numPasses)
PoseBasePtr getCameraPose(const Ice::Current &c=Ice::emptyCurrent) override
armarx::SimulatorViewerInformation info