Skip to content
Snippets Groups Projects
Commit a5897d32 authored by Markus Grotz's avatar Markus Grotz
Browse files

update AffordancePipelineVisualization

- add parameter to manually specify a file
parent 0e4b84ee
No related branches found
No related tags found
No related merge requests found
......@@ -98,6 +98,36 @@ void AffordancePipelineVisualization::onInitComponent()
void AffordancePipelineVisualization::onConnectComponent()
{
debugDrawerTopicPrx = getTopic<DebugDrawerInterfacePrx>(getProperty<std::string>("DebugDrawerTopicName").getValue());
if (!debugDrawerTopicPrx)
{
ARMARX_ERROR << "Failed to obtain debug drawer proxy";
return;
}
affordanceVisualizationTopicPrx = getTopic<AffordancePipelineVisualizationListenerPrx>(getProperty<std::string>("VisualizationUpdateTopicName").getValue());
if (!affordanceVisualizationTopicPrx)
{
ARMARX_ERROR << "Failed to obtain affordance visualization topic proxy";
return;
}
usingTopic(getProperty<std::string>("DebugDrawerSelectionsTopicName").getValue());
offeringTopic(getProperty<std::string>("VisualizationUpdateTopicName").getValue());
std::string fileName = getProperty<std::string>("FileName").getValue();
if(!fileName.empty())
{
ARMARX_INFO << "Visualizing affordances from file " << VAROUT(fileName);
scene.reset(new AffordanceKitArmarX::SceneArmarX());
scene->load(fileName);
visualize();
ARMARX_INFO << "Done visualizing affordances.";
return;
}
workingMemoryPrx = getProxy<memoryx::WorkingMemoryInterfacePrx>(getProperty<std::string>("WorkingMemoryName").getValue());
if (!workingMemoryPrx)
{
......@@ -118,23 +148,6 @@ void AffordancePipelineVisualization::onConnectComponent()
ARMARX_ERROR << "Failed to obtain environmental primitive segment pointer";
return;
}
debugDrawerTopicPrx = getTopic<DebugDrawerInterfacePrx>(getProperty<std::string>("DebugDrawerTopicName").getValue());
if (!debugDrawerTopicPrx)
{
ARMARX_ERROR << "Failed to obtain debug drawer proxy";
return;
}
affordanceVisualizationTopicPrx = getTopic<AffordancePipelineVisualizationListenerPrx>(getProperty<std::string>("VisualizationUpdateTopicName").getValue());
if (!affordanceVisualizationTopicPrx)
{
ARMARX_ERROR << "Failed to obtain affordance visualization topic proxy";
return;
}
usingTopic(getProperty<std::string>("DebugDrawerSelectionsTopicName").getValue());
offeringTopic(getProperty<std::string>("VisualizationUpdateTopicName").getValue());
}
void AffordancePipelineVisualization::onDisconnectComponent()
......
......@@ -75,6 +75,8 @@ namespace armarx
defineOptionalProperty<float>("MinExpectedProbability", 0, "Visualize only samplings with expected probability greater than X");
defineOptionalProperty<bool>("NoAffordanceExtractionConfigured", false, "In this case visualization will start as soon as primitives are computed");
defineOptionalProperty<std::string>("FileName", "", "Load affordances from a file name and exit.");
}
};
......
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