Skip to content
Snippets Groups Projects
Commit 394ef979 authored by Fabian Reister's avatar Fabian Reister
Browse files

PlatformUnit: partially reverting changes

parent cfd521d7
No related branches found
No related tags found
1 merge request!132Fix robot state component
......@@ -34,26 +34,30 @@ namespace armarx
{
PropertyDefinitionsPtr PlatformUnit::createPropertyDefinitions()
{
armarx::PropertyDefinitionsPtr def = new ComponentPropertyDefinitions(getConfigIdentifier());
armarx::PropertyDefinitionsPtr def = new PlatformUnitPropertyDefinitions(getConfigIdentifier());
def->topic(odometryPrx);
def->topic(globalPosePrx);
// legacy
// defineOptionalProperty<std::string>("PlatformName", "Platform", "Name of the platform (will publish values on PlatformName + 'State')");
def->topic(listenerPrx, "PlatformState");
return def;
}
void PlatformUnit::onInitComponent()
{
std::string platformName = getProperty<std::string>("PlatformName").getValue();
listenerChannelName = platformName + "State";
offeringTopic(listenerChannelName);
this->onInitPlatformUnit();
}
void PlatformUnit::onConnectComponent()
{
listenerPrx = getTopic<PlatformUnitListenerPrx>(listenerChannelName);
this->onStartPlatformUnit();
}
......
......@@ -36,6 +36,21 @@
namespace armarx
{
/**
* \class PlatformUnitPropertyDefinitions
* \brief Defines all necessary properties for armarx::PlatformUnit
*/
class PlatformUnitPropertyDefinitions:
public ComponentPropertyDefinitions
{
public:
PlatformUnitPropertyDefinitions(std::string prefix):
ComponentPropertyDefinitions(prefix)
{
defineOptionalProperty<std::string>("PlatformName", "Platform", "Name of the platform (will publish values on PlatformName + 'State')");
}
};
/**
* \defgroup Component-PlatformUnit PlatformUnit
......@@ -100,6 +115,8 @@ namespace armarx
PropertyDefinitionsPtr createPropertyDefinitions() override;
protected:
std::string listenerChannelName;
/**
* PlatformUnitListener proxy for publishing state updates
*/
......
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