Skip to content
Snippets Groups Projects
Commit 51e0984f authored by Mirko Wächter's avatar Mirko Wächter
Browse files

adjusted observers

parent c1341ea4
No related branches found
No related tags found
No related merge requests found
Showing with 47 additions and 19 deletions
......@@ -33,11 +33,11 @@ namespace armarx
* \brief
*/
class BusInspectionUnitObserverPropertyDefinitions:
public ComponentPropertyDefinitions
public ObserverPropertyDefinitions
{
public:
BusInspectionUnitObserverPropertyDefinitions(std::string prefix):
ComponentPropertyDefinitions(prefix)
ObserverPropertyDefinitions(prefix)
{
defineOptionalProperty<std::string>("BusInspectionUnitTopicName", "HALCycleTimes", "Name of the BusInspectionUnit Topic");
}
......
......@@ -116,7 +116,7 @@ void ForceTorqueObserver::visualizerFunction()
return;
}
float maxTorque = getProperty<float>("MaxExpectedTorqueValue");
float torqueVisuDeathZone = getProperty<float>("TorqueVisuDeathZone");
float torqueVisuDeadZone = getProperty<float>("TorqueVisuDeadZone");
float arrowLength = getProperty<float>("MaxForceArrowLength").getValue();
float forceFactor = getProperty<float>("ForceVisualizerFactor").getValue();
auto channels = getAvailableChannels(false);
......@@ -162,7 +162,7 @@ void ForceTorqueObserver::visualizerFunction()
Eigen::Vector3f dirYglobal = FramedDirection(Eigen::Vector3f::UnitY(), torque->frame, torque->agent).toGlobalEigen(localRobot);
Eigen::Vector3f dirZglobal = FramedDirection(Eigen::Vector3f::UnitZ(), torque->frame, torque->agent).toGlobalEigen(localRobot);
// ARMARX_INFO << channel.first << VAROUT(torque) << VAROUT(dirXglobal) << VAROUT(dirYglobal) << VAROUT(dirZglobal);
if (fabs(torque->x) > torqueVisuDeathZone)
if (fabs(torque->x) > torqueVisuDeadZone)
{
batchPrx->setCircleArrowVisu("Torques",
"TorqueX" + channel.first,
......@@ -179,7 +179,7 @@ void ForceTorqueObserver::visualizerFunction()
batchPrx->removeCircleVisu("Torques",
"TorqueX" + channel.first);
}
if (fabs(torque->y) > torqueVisuDeathZone)
if (fabs(torque->y) > torqueVisuDeadZone)
{
batchPrx->setCircleArrowVisu("Torques",
"TorqueY" + channel.first,
......@@ -197,7 +197,7 @@ void ForceTorqueObserver::visualizerFunction()
"TorqueY" + channel.first);
}
if (fabs(torque->z) > torqueVisuDeathZone)
if (fabs(torque->z) > torqueVisuDeadZone)
{
batchPrx->setCircleArrowVisu("Torques",
"TorqueZ" + channel.first,
......
......@@ -35,11 +35,11 @@ namespace armarx
* \brief
*/
class ForceTorqueObserverPropertyDefinitions:
public ComponentPropertyDefinitions
public ObserverPropertyDefinitions
{
public:
ForceTorqueObserverPropertyDefinitions(std::string prefix):
ComponentPropertyDefinitions(prefix)
ObserverPropertyDefinitions(prefix)
{
defineRequiredProperty<std::string>("ForceTorqueTopicName", "Name of the ForceTorqueUnit Topic");
defineOptionalProperty<bool>("VisualizeForce", true, "Visualize the force with an arrow in the debug drawer");
......@@ -47,7 +47,7 @@ namespace armarx
defineOptionalProperty<int>("VisualizeForceUpdateFrequency", 30, "Frequency with which the force is visualized");
defineOptionalProperty<float>("ForceVisualizerFactor", 0.01f, "Factor by which the forces are scaled to fit into 0..1 (only for visulization) ");
defineOptionalProperty<float>("MaxExpectedTorqueValue", 30, "The torque visualization circle reaches the full circle at this value");
defineOptionalProperty<float>("TorqueVisuDeathZone", 1, "Torques below this threshold are not visualized.");
defineOptionalProperty<float>("TorqueVisuDeadZone", 1, "Torques below this threshold are not visualized.");
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");
defineOptionalProperty<std::string>("SensorRobotNodeMapping", "", "Triplets of sensor node name, target frame robot node name and optional channel name: Sensor values are also reported in the frame of the robot node: e. g. SensorName:RobotNodeName[:ChannelName],SensorName2:RobotNodeName2[:ChannelName2]");
......
......@@ -39,11 +39,11 @@ namespace armarx
* \brief
*/
class HapticObserverPropertyDefinitions:
public ComponentPropertyDefinitions
public ObserverPropertyDefinitions
{
public:
HapticObserverPropertyDefinitions(std::string prefix):
ComponentPropertyDefinitions(prefix)
ObserverPropertyDefinitions(prefix)
{
defineOptionalProperty<std::string>("HapticTopicName", "HapticValues", "Name of the HapticUnit Topic");
}
......
......@@ -38,11 +38,11 @@ namespace armarx
* \brief
*/
class InertialMeasurementUnitObserverPropertyDefinitions:
public ComponentPropertyDefinitions
public ObserverPropertyDefinitions
{
public:
InertialMeasurementUnitObserverPropertyDefinitions(std::string prefix):
ComponentPropertyDefinitions(prefix)
ObserverPropertyDefinitions(prefix)
{
defineOptionalProperty<std::string>("IMUTopicName", "IMUValues", "Name of the IMU Topic.");
defineOptionalProperty<std::string>("DebugDrawerTopic", "DebugDrawerUpdates", "Name of the DebugDrawerTopic");
......
......@@ -279,14 +279,14 @@ void KinematicUnitObserver::nameValueMapToDataFields(const std::string& channelN
boost::unordered_map< ::std::string, ::armarx::VariantBasePtr> map;
if (timestamp < 0)
{
for (const auto & it : nameValueMap)
for (const auto& it : nameValueMap)
{
map[it.first] = new Variant(it.second);
}
}
else
{
for (const auto & it : nameValueMap)
for (const auto& it : nameValueMap)
{
map[it.first] = new TimedVariant(new Variant(it.second), IceUtil::Time::microSeconds(timestamp));
}
......@@ -302,6 +302,6 @@ void KinematicUnitObserver::nameValueMapToDataFields(const std::string& channelN
PropertyDefinitionsPtr KinematicUnitObserver::createPropertyDefinitions()
{
return PropertyDefinitionsPtr(new KinematicUnitPropertyDefinitions(
return PropertyDefinitionsPtr(new KinematicUnitObserverPropertyDefinitions(
getConfigIdentifier()));
}
......@@ -39,6 +39,19 @@ namespace armarx
ARMARX_CREATE_CHECK(KinematicUnitObserver, equals)
ARMARX_CREATE_CHECK(KinematicUnitObserver, larger)
class KinematicUnitObserverPropertyDefinitions:
public ObserverPropertyDefinitions
{
public:
KinematicUnitObserverPropertyDefinitions(std::string prefix):
ObserverPropertyDefinitions(prefix)
{
defineRequiredProperty<std::string>("RobotNodeSetName", "Robot node set name as defined in robot xml file, e.g. 'LeftArm'");
defineRequiredProperty<std::string>("RobotFileName", "Robot file name, e.g. robot_model.xml");
defineOptionalProperty<std::string>("RobotFileNameProject", "", "Project in which the robot filename is located (if robot is loaded from an external project)");
}
};
/**
* \class KinematicUnitObserver
* \ingroup RobotAPI-SensorActorUnits-observers
......
......@@ -110,6 +110,6 @@ void PlatformUnitObserver::nameValueMapToDataFields(std::string channelName, ::I
PropertyDefinitionsPtr PlatformUnitObserver::createPropertyDefinitions()
{
return PropertyDefinitionsPtr(new PlatformUnitPropertyDefinitions(
return PropertyDefinitionsPtr(new PlatformUnitObserverPropertyDefinitions(
getConfigIdentifier()));
}
......@@ -41,6 +41,21 @@ namespace armarx
ARMARX_CREATE_CHECK(PlatformUnitObserver, larger)
ARMARX_CREATE_CHECK(PlatformUnitObserver, inrange)
/**
* \class PlatformUnitPropertyDefinitions
* \brief Defines all necessary properties for armarx::PlatformUnit
*/
class PlatformUnitObserverPropertyDefinitions:
public ObserverPropertyDefinitions
{
public:
PlatformUnitObserverPropertyDefinitions(std::string prefix):
ObserverPropertyDefinitions(prefix)
{
defineOptionalProperty<std::string>("PlatformName", "Platform", "Name of the platform (will publish values on PlatformName + 'State')");
}
};
/**
* \class PlatformUnitObserver
* \ingroup RobotAPI-SensorActorUnits-observers
......
......@@ -32,11 +32,11 @@ namespace armarx
* \brief
*/
class TCPControlUnitObserverPropertyDefinitions:
public ComponentPropertyDefinitions
public ObserverPropertyDefinitions
{
public:
TCPControlUnitObserverPropertyDefinitions(std::string prefix):
ComponentPropertyDefinitions(prefix)
ObserverPropertyDefinitions(prefix)
{
defineOptionalProperty<std::string>("TCPControlUnitName", "TCPControlUnit", "Name of the TCPControlUnit");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment