27#include <QActionGroup>
30#include <QDialogButtonBox>
42#include <QPlainTextEdit>
43#include <QPluginLoader>
45#include <QSignalMapper>
47#include <QStackedWidget>
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>
96 "ShowBaseCoordSystem",
98 "Enable/disbale a coordinate visualization at the global root.");
101 "If >0 anti aliasing is enabled (may slow down the "
102 "visualization). Defines the number of render passes.");
105 "Camera.x", 0.f,
"x component of initial camera position (mm)");
107 "Camera.y", 0.f,
"y component of initial camera position (mm)");
109 "Camera.z", 0.f,
"z component of initial camera position (mm)");
111 "Camera.roll", 0.f,
"Initial camera pose: roll component of RPY angles (radian)");
113 "Camera.pitch", 0.f,
"Initial camera pose: pitch component of RPY angles (radian)");
115 "Camera.yaw", 0.f,
"Initial camera pose: yaw component of RPY angles (radian)");
117 "TempDir",
"/tmp",
"Local temp directory. Used for storing video files.");
120 "Enable/disbale video recording (video is stored to tmp "
121 "directory, currently only BMP files are supported.");
123 "Background.r", 1.f,
"r component of initial background color [0, 1]");
125 "Background.g", 1.f,
"g component of initial background color [0, 1]");
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;
ArmarXSimulatorWindowPropertyDefinitions(std::string prefix)
void onInitComponent() override
Pure virtual hook for the subclass.
void showDebugDrawLayer(bool show, const Ice::Current &c=Ice::emptyCurrent) override
PoseBasePtr getCameraPose(const Ice::Current &c=Ice::emptyCurrent) override
void setAntiAliasing(int steps, const Ice::Current &c=Ice::emptyCurrent) override
void slotClearDebugDrawLayer()
void setDrawTimeMeasured(float ms)
void slotShowBaseCoord(bool show, float scale)
void saveScreenshots(bool enable, const ::Ice::Current &=Ice::emptyCurrent) override
void enableLayerVisu(const std::string &layerName, bool visible, const ::Ice::Current &=Ice::emptyCurrent) override
void initialize(ArmarXPhysicsWorldVisualizationPtr physicsVisu, DebugDrawerComponentPtr debugDrawer)
void slotEnableDebugDrawLayer(bool show)
armarx::SimulatorViewerInformation info
void onDisconnectComponent() override
Hook for subclass.
void setMutex(CoinViewer::RecursiveMutexPtr const &m)
::armarx::LayerInformationSequence layerInformation(const ::Ice::Current &=Ice::emptyCurrent) override
DebugDrawerComponentPtr debugDrawer
void closeRequest()
emitted, when the main window should be closed
void closeEvent(QCloseEvent *event) override
emits the closeRequest signal
void slotClearLayer(const QString layerName)
void setupAntiAliasing(int numPasses)
void setCamPoseFromConfig()
void setCamPose(float x, float y, float z, float roll, float pitch, float yaw)
CoinViewer::RecursiveMutexLockPtr getScopedLock()
Protect access with this lock.
void slotSelectVisuType(bool visible)
void onConnectComponent() override
Pure virtual hook for the subclass.
PropertyDefinitionsPtr createPropertyDefinitions() override
~ArmarXSimulatorWindow() override
CoinViewer::RecursiveMutexPtr mutex
void selectVisuType(bool fullModel, const Ice::Current &c=Ice::emptyCurrent) override
Switch between full/collision model.
void clearDebugDrawLayer(const Ice::Current &c=Ice::emptyCurrent) override
void slotRemoveLayer(const QString layerName)
Eigen::Matrix4f getCamPose()
void clearLayer(const std::string &layerName, const ::Ice::Current &=Ice::emptyCurrent) override
void setTempPath(const std::string &p, const ::Ice::Current &=Ice::emptyCurrent) override
void slotEnableLayerVisu(const QString layerName, bool visible)
void enableSimulatorWindow(bool show, const Ice::Current &c=Ice::emptyCurrent) override
void onExitComponent() override
Hook for subclass.
void removeLayer(const std::string &layerName, const ::Ice::Current &=Ice::emptyCurrent) override
Ui::MainWindowArmarXSimulator ui
void showBaseCoordSystem(bool show, float scale=1.0, const Ice::Current &c=Ice::emptyCurrent) override
SimulatorViewerInformation getSimulatorInformation(const Ice::Current &c=Ice::emptyCurrent) override
ArmarXPhysicsWorldVisualizationPtr physicsVisu
std::string getDefaultName() const override
Retrieve default name of component.
static void timerCB(void *data, SoSensor *sensor)
std::shared_ptr< RecursiveMutexLock > RecursiveMutexLockPtr
std::shared_ptr< RecursiveMutex > RecursiveMutexPtr
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Component()
Protected default constructor. Used for virtual inheritance. Use createManagedIceObject() instead.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< ArmarXSimulatorWindow > ArmarXSimulatorWindowPtr
IceInternal::Handle< DebugDrawerComponent > DebugDrawerComponentPtr
IceInternal::Handle< ArmarXPhysicsWorldVisualization > ArmarXPhysicsWorldVisualizationPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.