diff --git a/source/RobotAPI/components/units/HeadIKUnit.cpp b/source/RobotAPI/components/units/HeadIKUnit.cpp index 46dcd0ab50fc6bca4e71b3015614707f949fde63..c7ccaca529f6c7569d56d6e5880078c99b6fbaaf 100644 --- a/source/RobotAPI/components/units/HeadIKUnit.cpp +++ b/source/RobotAPI/components/units/HeadIKUnit.cpp @@ -121,7 +121,7 @@ namespace armarx this->targetPosition->frame = targetPosition->frame; FramedPositionPtr globalTarget = FramedPositionPtr::dynamicCast(targetPosition)->toGlobal(robotStateComponentPrx->getSynchronizedRobot()); - if (drawer) + if (drawer && getProperty<bool>("VisualizeIKTarget").getValue()) { drawer->setSphereDebugLayerVisu("HeadViewTarget", globalTarget, @@ -295,7 +295,7 @@ namespace armarx ARMARX_DEBUG << "Solution found"; - if (drawer && localRobot->hasRobotNode("Cameras")) + if (drawer && localRobot->hasRobotNode("Cameras") && getProperty<bool>("VisualizeIKTarget").getValue()) { Vector3Ptr startPos = new Vector3(localRobot->getRobotNode("Cameras")->getGlobalPose()); drawer->setSphereDebugLayerVisu("HeadViewTargetSolution", diff --git a/source/RobotAPI/components/units/HeadIKUnit.h b/source/RobotAPI/components/units/HeadIKUnit.h index 6deff5a7add3ea52ae1bc09721a4e421c316df2d..f76b57c7db2cfe8f1980eda8a124b8b741b6fb90 100644 --- a/source/RobotAPI/components/units/HeadIKUnit.h +++ b/source/RobotAPI/components/units/HeadIKUnit.h @@ -50,6 +50,7 @@ namespace armarx defineOptionalProperty<std::string>("RobotStateTopicName", "RobotState", "Name of the RobotComponent State topic."); defineOptionalProperty<std::string>("HeadIKUnitTopicName", "HeadIKUnitTopic", "Name of the HeadIKUnit Topic"); defineOptionalProperty<std::string>("RobotStateComponentName", "RobotStateComponent", "Name of the RobotStateComponent that should be used"); + defineOptionalProperty<bool>("VisualizeIKTarget", true, "Visualize the current IK target using the debug drawer"); defineOptionalProperty<int>("CycleTime", 30, "Cycle time of the tcp control in ms"); } };