diff --git a/scenarios/tests/DebugDrawerTest/DebugDrawerTestApp/DebugDrawerTest.cpp b/scenarios/tests/DebugDrawerTest/DebugDrawerTestApp/DebugDrawerTest.cpp index 4f8e861724ab6cd980c6ac187a0175c679f9696a..c3380bff11dd73768e9de647d33fe9b139067c86 100644 --- a/scenarios/tests/DebugDrawerTest/DebugDrawerTestApp/DebugDrawerTest.cpp +++ b/scenarios/tests/DebugDrawerTest/DebugDrawerTestApp/DebugDrawerTest.cpp @@ -42,7 +42,7 @@ namespace armarx std::string robFile="Armar3/robotmodel/ArmarIII.xml"; std::string project="Armar3"; ARMARX_INFO << "adding robot visu"; - prxDD->setRobotVisu("TestVisu", "TestRobot", robFile, project); + prxDD->setRobotVisu("TestVisu", "TestRobot", robFile, project, DrawStyle::FullModel); ARMARX_INFO << "setting robot position"; Eigen::Matrix4f p; @@ -53,7 +53,7 @@ namespace armarx prxDD->updateRobotPose("TestVisu", "TestRobot", gp); ARMARX_INFO << "adding second robot visu"; - prxDD->setRobotVisu("TestVisu", "TestRobot2", robFile, project); + prxDD->setRobotVisu("TestVisu", "TestRobot2", robFile, project, DrawStyle::FullModel); ARMARX_INFO << "setting second robot position"; p(0,3) = 3000.0f; p(1,3) = 3000.0f; @@ -84,7 +84,7 @@ namespace armarx usleep (10000000); ARMARX_INFO << "adding robot visu"; - prxDD->setRobotVisu("TestVisu", "TestRobot", robFile, project); + prxDD->setRobotVisu("TestVisu", "TestRobot", robFile, project, DrawStyle::FullModel); ARMARX_INFO << "setting robot position 6000/1000"; p(0,3) = 6000.0f; @@ -93,7 +93,7 @@ namespace armarx prxDD->updateRobotPose("TestVisu", "TestRobot", gp3); ARMARX_INFO << "adding second robot visu"; - prxDD->setRobotVisu("TestVisu", "TestRobot2", robFile, project); + prxDD->setRobotVisu("TestVisu", "TestRobot2", robFile, project, DrawStyle::FullModel); ARMARX_INFO << "setting second robot position 6000/3000"; p(0,3) = 6000.0f; p(1,3) = 3000.0f; diff --git a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp index a98352c735093bdce6d9649b3c6336209ffbfe77..fd1d3dbcf913a4ef92615e054ed2480ee433bea1 100644 --- a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp +++ b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp @@ -604,7 +604,13 @@ VirtualRobot::RobotPtr DebugDrawerComponent::requestRobot(const DebugDrawerCompo m->setOverride(false); sep->addChild(m); - boost::shared_ptr<CoinVisualization> robVisu = result->getVisualization<CoinVisualization>(VirtualRobot::SceneObject::Full); + + + VirtualRobot::SceneObject::VisualizationType visuType = VirtualRobot::SceneObject::Full; + if (d.drawStyle == DrawStyle::CollisionModel) + visuType = VirtualRobot::SceneObject::Collision; + + boost::shared_ptr<CoinVisualization> robVisu = result->getVisualization<CoinVisualization>(visuType); if (robVisu) { SoNode *sepRob = robVisu->getCoinVisualization(); @@ -1233,7 +1239,7 @@ void DebugDrawerComponent::removeArrowDebugLayerVisu(const std::string &arrowNam removeArrowVisu(DEBUG_LAYER_NAME, arrowName); } -void DebugDrawerComponent::setRobotVisu(const std::string &layerName, const std::string &robotName, const std::string &robotFile, const std::string &armarxProject, const Ice::Current &) +void DebugDrawerComponent::setRobotVisu(const std::string &layerName, const std::string &robotName, const std::string &robotFile, const std::string &armarxProject, DrawStyle drawStyle, const Ice::Current &) { ScopedRecursiveLockPtr l = getScopedAccumulatedDataLock(); std::string entryName = "__" + layerName + "__" + robotName + "__"; @@ -1242,6 +1248,7 @@ void DebugDrawerComponent::setRobotVisu(const std::string &layerName, const std: d.robotFile = robotFile; d.armarxProject = armarxProject; + d.drawStyle = drawStyle; d.layerName = layerName; d.name = robotName; diff --git a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.h b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.h index dec6e0f66b429282e017e32e54ec4f661e14647e..2ab7be5683a2c7f7a0bb686da009678d75f9749e 100644 --- a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.h +++ b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.h @@ -186,9 +186,10 @@ public: * \param layerName The layer * \param robotName The identifier of the robot * \param robotFile The filename of the robot. The robot must be locally present in a project. + * \param DrawStyle Either FullModel ior CollisionModel. * \param armarxProject Additional armarx project that should be used to search the robot. Must be locally available and accessible through the armarx cmake search procedure. */ - virtual void setRobotVisu(const std::string &layerName, const std::string &robotName, const std::string &robotFile, const std::string &armarxProject, const ::Ice::Current& = ::Ice::Current()); + virtual void setRobotVisu(const std::string &layerName, const std::string &robotName, const std::string &robotFile, const std::string &armarxProject, DrawStyle drawStyle, const ::Ice::Current& = ::Ice::Current()); virtual void updateRobotPose(const std::string &layerName, const std::string &robotName, const ::armarx::PoseBasePtr &globalPose, const ::Ice::Current& = ::Ice::Current()); virtual void updateRobotConfig(const std::string &layerName, const std::string &robotName, const std::map< std::string, float> &configuration, const ::Ice::Current& = ::Ice::Current()); /*! @@ -323,6 +324,8 @@ protected: bool updateConfig; std::map < std::string, float > configuration; + + armarx::DrawStyle drawStyle; }; struct UpdateData diff --git a/source/RobotAPI/gui-plugins/RobotViewerPlugin/RobotViewerGuiPlugin.cpp b/source/RobotAPI/gui-plugins/RobotViewerPlugin/RobotViewerGuiPlugin.cpp index c0f6a69bdc8d58da32b0afc3ddc85b9a93f6761e..eeb89f8db30dc69883ee957107ded4a680076d97 100644 --- a/source/RobotAPI/gui-plugins/RobotViewerPlugin/RobotViewerGuiPlugin.cpp +++ b/source/RobotAPI/gui-plugins/RobotViewerPlugin/RobotViewerGuiPlugin.cpp @@ -126,10 +126,12 @@ void RobotViewerWidgetController::onConnectComponent() CMakePackageFinder project(projectName); StringList projectIncludePaths; auto pathsString = project.getDataDir(); + ARMARX_VERBOSE << "Data paths of ArmarX package " << projectName << ": " << pathsString; boost::split(projectIncludePaths, pathsString, boost::is_any_of(";,"), boost::token_compress_on); + ARMARX_VERBOSE << "Result: Data paths of ArmarX package " << projectName << ": " << projectIncludePaths; includePaths.insert(includePaths.end(), projectIncludePaths.begin(), projectIncludePaths.end()); } diff --git a/source/RobotAPI/interface/visualization/DebugDrawerInterface.ice b/source/RobotAPI/interface/visualization/DebugDrawerInterface.ice index 3711852621633b7d1533986c2b29c382d5dfabf6..8bc72229b36ef5e763f6342e3f679593dbc5bf59 100644 --- a/source/RobotAPI/interface/visualization/DebugDrawerInterface.ice +++ b/source/RobotAPI/interface/visualization/DebugDrawerInterface.ice @@ -67,6 +67,8 @@ module armarx sequence< Vector3Base > PolygonPointList; + enum DrawStyle { FullModel, CollisionModel }; + /*! * \brief A layered drawing interface. * All drawing operations are identified with a layer name in order to distinguish different drawing entitties. @@ -100,9 +102,11 @@ module armarx * \param layerName The layer * \param robotName The identifier of the robot * \param robotFile The filename of the robot. The robot must be locally present in a project. + * \param drawStyleType Either full or collision model. * \param armarxProject Additional armarx project that should be used to search the robot. Must be locally available and accessible through the armarx cmake search procedure. */ - void setRobotVisu(string layerName, string robotName, string robotFile, string armarxProject); + + void setRobotVisu(string layerName, string robotName, string robotFile, string armarxProject, DrawStyle drawStyleType); void updateRobotPose(string layerName, string robotName, PoseBase globalPose); void updateRobotConfig(string layerName, string robotName, NameValueMap configuration); /*!