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

added topic for automatic view selection status

parent 581364c6
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,7 @@ void ViewSelection::onInitComponent() ...@@ -40,6 +40,7 @@ void ViewSelection::onInitComponent()
usingProxy(getProperty<std::string>("HeadIKUnitName").getValue()); usingProxy(getProperty<std::string>("HeadIKUnitName").getValue());
offeringTopic("DebugDrawerUpdates"); offeringTopic("DebugDrawerUpdates");
offeringTopic(getName() + "Observer");
headIKKinematicChainName = getProperty<std::string>("HeadIKKinematicChainName").getValue(); headIKKinematicChainName = getProperty<std::string>("HeadIKKinematicChainName").getValue();
headFrameName = getProperty<std::string>("HeadFrameName").getValue(); headFrameName = getProperty<std::string>("HeadFrameName").getValue();
...@@ -105,6 +106,7 @@ void ViewSelection::onConnectComponent() ...@@ -105,6 +106,7 @@ void ViewSelection::onConnectComponent()
headIKUnitProxy = getProxy<HeadIKUnitInterfacePrx>(getProperty<std::string>("HeadIKUnitName").getValue()); headIKUnitProxy = getProxy<HeadIKUnitInterfacePrx>(getProperty<std::string>("HeadIKUnitName").getValue());
headIKUnitProxy->request(); headIKUnitProxy->request();
viewSelectionObserver = getTopic<ViewSelectionObserverPrx>(getName() + "Observer");
drawer = getTopic<DebugDrawerInterfacePrx>("DebugDrawerUpdates"); drawer = getTopic<DebugDrawerInterfacePrx>("DebugDrawerUpdates");
processorTask->start(); processorTask->start();
......
...@@ -154,15 +154,26 @@ namespace armarx ...@@ -154,15 +154,26 @@ namespace armarx
boost::mutex::scoped_lock lock(manualViewTargetsMutex); boost::mutex::scoped_lock lock(manualViewTargetsMutex);
ARMARX_INFO << "activating automatic view selection"; ARMARX_INFO << "activating automatic view selection";
doAutomaticViewSelection = true; doAutomaticViewSelection = true;
viewSelectionObserver->onActivateAutomaticViewSelection();
} }
virtual void deactivateAutomaticViewSelection(const Ice::Current& c = Ice::Current()) virtual void deactivateAutomaticViewSelection(const Ice::Current& c = Ice::Current())
{ {
boost::mutex::scoped_lock lock(manualViewTargetsMutex); boost::mutex::scoped_lock lock(manualViewTargetsMutex);
ARMARX_INFO << "DEactivating automatic view selection"; ARMARX_INFO << "deactivating automatic view selection";
doAutomaticViewSelection = false; doAutomaticViewSelection = false;
viewSelectionObserver->onDeactivateAutomaticViewSelection();
}
virtual bool isEnabledAutomaticViewSelection(const Ice::Current& c = Ice::Current())
{
boost::mutex::scoped_lock lock(manualViewTargetsMutex);
return doAutomaticViewSelection;
} }
void updateSaliencyMap(const SaliencyMapBasePtr& map, const Ice::Current& c = ::Ice::Current()); void updateSaliencyMap(const SaliencyMapBasePtr& map, const Ice::Current& c = ::Ice::Current());
...@@ -179,6 +190,8 @@ namespace armarx ...@@ -179,6 +190,8 @@ namespace armarx
HeadIKUnitInterfacePrx headIKUnitProxy; HeadIKUnitInterfacePrx headIKUnitProxy;
DebugDrawerInterfacePrx drawer; DebugDrawerInterfacePrx drawer;
ViewSelectionObserverPrx viewSelectionObserver;
std::string headIKKinematicChainName; std::string headIKKinematicChainName;
std::string headFrameName; std::string headFrameName;
std::string cameraFrameName; std::string cameraFrameName;
......
...@@ -35,7 +35,6 @@ module armarx ...@@ -35,7 +35,6 @@ module armarx
const int DEFAULT_VIEWTARGET_PRIORITY = 50; const int DEFAULT_VIEWTARGET_PRIORITY = 50;
["cpp:virtual"] ["cpp:virtual"]
class ViewTargetBase class ViewTargetBase
{ {
...@@ -76,11 +75,19 @@ module armarx ...@@ -76,11 +75,19 @@ module armarx
void activateAutomaticViewSelection(); void activateAutomaticViewSelection();
void deactivateAutomaticViewSelection(); void deactivateAutomaticViewSelection();
bool isEnabledAutomaticViewSelection();
void updateSaliencyMap(SaliencyMapBase map); void updateSaliencyMap(SaliencyMapBase map);
}; };
interface ViewSelectionObserver
{
void onActivateAutomaticViewSelection();
void onDeactivateAutomaticViewSelection();
};
}; };
#endif #endif
......
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