Go to the documentation of this file.
27 #include <QActionGroup>
30 #include <QDialogButtonBox>
32 #include <QDockWidget>
33 #include <QGridLayout>
34 #include <QHBoxLayout>
36 #include <QListWidget>
37 #include <QMainWindow>
39 #include <QModelIndex>
42 #include <QPlainTextEdit>
43 #include <QPluginLoader>
44 #include <QProxyStyle>
45 #include <QSignalMapper>
47 #include <QStackedWidget>
48 #include <QStringList>
56 #include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
57 #include <Inventor/nodes/SoNode.h>
58 #include <Inventor/nodes/SoSeparator.h>
69 #include <ArmarXSimulation/applications/SimulatorViewer/ui_ArmarXSimulatorWindow.h>
71 #include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
73 #include <SimDynamics/DynamicsEngine/BulletEngine/BulletEngine.h>
74 #include <SimDynamics/DynamicsEngine/DynamicsEngine.h>
75 #include <SimDynamics/DynamicsEngine/DynamicsObject.h>
76 #include <SimDynamics/DynamicsEngine/DynamicsRobot.h>
77 #include <SimDynamics/DynamicsWorld.h>
95 defineOptionalProperty<bool>(
96 "ShowBaseCoordSystem",
98 "Enable/disbale a coordinate visualization at the global root.");
99 defineOptionalProperty<int>(
"AntiAliasingRenderPasses",
101 "If >0 anti aliasing is enabled (may slow down the "
102 "visualization). Defines the number of render passes.");
104 defineOptionalProperty<float>(
105 "Camera.x", 0.f,
"x component of initial camera position (mm)");
106 defineOptionalProperty<float>(
107 "Camera.y", 0.f,
"y component of initial camera position (mm)");
108 defineOptionalProperty<float>(
109 "Camera.z", 0.f,
"z component of initial camera position (mm)");
110 defineOptionalProperty<float>(
111 "Camera.roll", 0.f,
"Initial camera pose: roll component of RPY angles (radian)");
112 defineOptionalProperty<float>(
113 "Camera.pitch", 0.f,
"Initial camera pose: pitch component of RPY angles (radian)");
114 defineOptionalProperty<float>(
115 "Camera.yaw", 0.f,
"Initial camera pose: yaw component of RPY angles (radian)");
116 defineOptionalProperty<std::string>(
117 "TempDir",
"/tmp",
"Local temp directory. Used for storing video files.");
118 defineOptionalProperty<bool>(
"SaveVideo",
120 "Enable/disbale video recording (video is stored to tmp "
121 "directory, currently only BMP files are supported.");
122 defineOptionalProperty<float>(
123 "Background.r", 1.f,
"r component of initial background color [0, 1]");
124 defineOptionalProperty<float>(
125 "Background.g", 1.f,
"g component of initial background color [0, 1]");
126 defineOptionalProperty<float>(
127 "Background.b", 1.f,
"b component of initial background color [0, 1]");
133 virtual public SimulatorViewerControlInterface,
146 return "ArmarXSimulatorWindow";
196 const ::Ice::Current& = Ice::emptyCurrent)
override;
198 const ::Ice::Current& = Ice::emptyCurrent)
override;
201 const ::Ice::Current& = Ice::emptyCurrent)
override;
202 ::armarx::LayerInformationSequence
205 void setTempPath(
const std::string& p, const ::Ice::Current& = Ice::emptyCurrent)
override;
206 void saveScreenshots(
bool enable, const ::Ice::Current& = Ice::emptyCurrent)
override;
210 void selectVisuType(
bool fullModel,
const Ice::Current&
c = Ice::emptyCurrent)
override;
213 const Ice::Current&
c = Ice::emptyCurrent)
override;
215 SimulatorViewerInformation
218 void setAntiAliasing(
int steps,
const Ice::Current&
c = Ice::emptyCurrent)
override;
220 PoseBasePtr
getCameraPose(
const Ice::Current&
c = Ice::emptyCurrent)
override;
224 void setCamPose(
float x,
float y,
float z,
float roll,
float pitch,
float yaw);
249 Ui::MainWindowArmarXSimulator
ui;
266 armarx::SimulatorViewerInformation
info;
274 QString guiWindowBaseName;
void initialize(ArmarXPhysicsWorldVisualizationPtr physicsVisu, DebugDrawerComponentPtr debugDrawer)
DebugDrawerComponentPtr debugDrawer
void setMutex(CoinViewer::RecursiveMutexPtr const &m)
void slotSelectVisuType(bool visible)
MatrixXX< 4, 4, float > Matrix4f
::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()
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