diff --git a/source/RobotAPI/components/units/ForceTorqueObserver.cpp b/source/RobotAPI/components/units/ForceTorqueObserver.cpp index 756b00b155b3bcd8c0e551d14a9d00eef6879c83..5118f2a2e14bce96accc5592d992dfd22d263778 100644 --- a/source/RobotAPI/components/units/ForceTorqueObserver.cpp +++ b/source/RobotAPI/components/units/ForceTorqueObserver.cpp @@ -76,13 +76,13 @@ void ForceTorqueObserver::onInitObserver() offerConditionCheck("magnitudelarger", new ConditionCheckMagnitudeLarger()); offerConditionCheck("magnitudesmaller", new ConditionCheckMagnitudeSmaller()); - usingProxy("RobotStateComponent"); + usingProxy(getProperty<std::string>("RobotStateComponentName").getValue()); offeringTopic("DebugDrawerUpdates"); } void ForceTorqueObserver::onConnectObserver() { - + robot = getProxy<RobotStateComponentInterfacePrx>(getProperty<std::string>("RobotStateComponentName").getValue()); debugDrawer = getTopic<DebugDrawerInterfacePrx>("DebugDrawerUpdates"); if (getProperty<bool>("VisualizeForce").getValue()) { @@ -125,7 +125,7 @@ void ForceTorqueObserver::visualizerFunction() float forceFactor = getProperty<float>("ForceVisualizerFactor").getValue(); RemoteRobot::synchronizeLocalClone(localRobot, robot); auto channels = getAvailableChannels(false); - for (auto& channel : channels) + for (auto & channel : channels) { if (localRobot->hasRobotNode(channel.first)) { diff --git a/source/RobotAPI/components/units/ForceTorqueObserver.h b/source/RobotAPI/components/units/ForceTorqueObserver.h index 8cf255be21512233a4d8caf8f3c836c5a4a4fd40..6e17f88e8dbf7f7efabfd327a5e1463a542bb616 100644 --- a/source/RobotAPI/components/units/ForceTorqueObserver.h +++ b/source/RobotAPI/components/units/ForceTorqueObserver.h @@ -46,6 +46,8 @@ namespace armarx defineOptionalProperty<int>("VisualizeForceUpdateFrequency", 20, "Frequency with which the force is visualized"); defineOptionalProperty<float>("ForceVisualizerFactor", 0.01, "Factor by which the forces are scaled to fit into 0..1 (only for visulization) "); defineOptionalProperty<float>("MaxForceArrowLength", 150, "Length of the force visu arrow in mm"); + defineOptionalProperty<std::string>("RobotStateComponentName", "RobotStateComponent", "Name of the RobotStateComponent that should be used"); + } };