Go to the documentation of this file.
27 #include <VirtualRobot/SceneObject.h>
28 #include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
31 #include <RobotAPI/interface/core/RobotState.h>
35 #include <Inventor/nodes/SoSeparator.h>
38 #include <Eigen/Geometry>
56 defineOptionalProperty<std::string>(
"ReportVisuTopicName",
"SimulatorVisuUpdates",
"The topic on which the visualization updates are published.");
67 virtual public SimulatorListenerInterface,
81 return "ArmarXPhysicsWorldVisualization";
92 void reportSceneUpdated(const ::armarx::SceneVisuData& actualData, const ::Ice::Current& = Ice::emptyCurrent)
override;
141 void addFloorVisualization(Eigen::Vector3f floorPos, Eigen::Vector3f floorUp,
float floorExtendMM, std::string floorTexture);
146 void setMutex(std::shared_ptr<std::recursive_mutex>
const& m);
177 std::vector<VirtualRobot::RobotPtr>
getRobots()
const;
178 std::vector<VirtualRobot::SceneObjectPtr>
getObjects()
const;
188 bool loadRobot(
const std::string& robotName,
const std::string& robotFile,
const std::string&
project,
float scaling,
bool colModel);
189 bool loadObject(
const std::string& objectFile,
const std::string&
project,
const std::string& instanceName);
208 std::shared_ptr<std::recursive_mutex>
mutex;
Ice::Long getSyncTimestamp() const
getSyncTimestamp
SceneVisuData lastSceneData
std::map< VirtualRobot::RobotPtr, SoNode * > addedRobotVisualizations
std::string getDefaultName() const override
Retrieve default name of component.
~ArmarXPhysicsWorldVisualization() override
bool synchronizeObjects()
SoSeparator * getViewableScene()
Returns the scene without floor (allows for better viewAll handling)
void showBaseCoord(bool enable, float scale=5.0f)
void addVisualization(VirtualRobot::SceneObjectPtr so, VirtualRobot::SceneObject::VisualizationType visuType=VirtualRobot::SceneObject::Full)
SoSeparator * sceneViewableSep
void onDisconnectComponent() override
Hook for subclass.
SoSeparator * dynamicsVisu
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
void enableVisuType(bool fullModel)
The ArmarXPhysicsWorldVisualization class organizes the Coin3D visualization of the physics scene....
void removeFloorVisualization()
RecursiveLockPtr getScopedDataLock()
VirtualRobot::SceneObject::VisualizationType modelType
SceneVisuData currentSceneData
bool loadRobot(const std::string &robotName, const std::string &robotFile, const std::string &project, float scaling, bool colModel)
void onConnectComponent() override
Pure virtual hook for the subclass.
void reportSceneUpdated(const ::armarx::SceneVisuData &actualData, const ::Ice::Current &=Ice::emptyCurrent) override
void onExitComponent() override
Hook for subclass.
std::vector< VirtualRobot::RobotPtr > getRobots() const
SoSeparator * getVisualization()
getVisu returns the visualization that is synchronized with ArmarXPhysicsWorld
void removeObjectVisualization(const std::string &name)
RecursiveLockPtr getScopedLock()
VirtualRobot::SceneObjectPtr getObject(const std::string &name)
std::shared_ptr< std::recursive_mutex > mutex
mutex to protect access to visualization models
std::shared_ptr< std::unique_lock< std::recursive_mutex > > RecursiveLockPtr
std::vector< VirtualRobot::SceneObjectPtr > getObjects() const
Baseclass for all ArmarX ManagedIceObjects requiring properties.
void removeVisualization(VirtualRobot::RobotPtr r)
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
ArmarXPhysicsWorldVisualizationPropertyDefinitions(std::string prefix)
std::map< VirtualRobot::SceneObjectPtr, SoNode * > addedVisualizations
Default component property definition container.
bool synchronizeSceneObjectPoses(NamePoseMap &objMap, NameValueMap &jvMap, VirtualRobot::SceneObjectPtr currentObjVisu)
std::shared_ptr< std::recursive_mutex > mutexData
mutex to process SceneData
void onInitComponent() override
Pure virtual hook for the subclass.
boost::intrusive_ptr< SceneObject > SceneObjectPtr
PropertyDefinitionsPtr createPropertyDefinitions() override
void addFloorVisualization(Eigen::Vector3f floorPos, Eigen::Vector3f floorUp, float floorExtendMM, std::string floorTexture)
void removeRobotVisualization(const std::string &name)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
VirtualRobot::RobotPtr getRobot(const std::string &name)
bool loadObject(const ObjectVisuData &obj)
SoSeparator * baseCoordVisu
bool createPrimitiveObject(ObjectVisuPrimitivePtr objectPrimitiveData, const std::string &name)
bool synchronizeVisualizationData()
Show/hide contacts.
This file offers overloads of toIce() and fromIce() functions for STL container types.
ArmarXPhysicsWorldVisualization()
SoNode * buildVisu(VirtualRobot::SceneObjectPtr o, VirtualRobot::SceneObject::VisualizationType visuType=VirtualRobot::SceneObject::Full)
buildVisu Creates visualization with increased ref counter.
std::shared_ptr< class Robot > RobotPtr
void setMutex(std::shared_ptr< std::recursive_mutex > const &m)