Skip to content
Snippets Groups Projects
Commit 26b180a9 authored by Pascal Weiner's avatar Pascal Weiner
Browse files

Add RobotStateComponentPlugin::deactivate

parent caea1b5a
No related branches found
No related tags found
No related merge requests found
......@@ -212,12 +212,12 @@ namespace armarx::plugins
void RobotStateComponentPlugin::preOnInitComponent()
{
if (!_robotStateComponent && _robotStateComponentName.empty())
if (!_deactivated && !_robotStateComponent && _robotStateComponentName.empty())
{
parent<Component>().getProperty(_robotStateComponentName, makePropertyName(_propertyName));
}
if (!_robotStateComponent)
if (!_deactivated && !_robotStateComponent)
{
parent<Component>().usingProxy(_robotStateComponentName);
}
......@@ -225,11 +225,14 @@ namespace armarx::plugins
void RobotStateComponentPlugin::preOnConnectComponent()
{
if (!_robotStateComponent)
if (!_deactivated && !_robotStateComponent)
{
parent<Component>().getProxy(_robotStateComponent, _robotStateComponentName);
}
_nameHelper = std::make_shared<RobotNameHelper>(_robotStateComponent->getRobotInfo());
if (!_deactivated)
{
_nameHelper = std::make_shared<RobotNameHelper>(_robotStateComponent->getRobotInfo());
}
}
void RobotStateComponentPlugin::postOnDisconnectComponent()
......@@ -274,6 +277,11 @@ namespace armarx::plugins
return _robotStateComponentName;
}
void RobotStateComponentPlugin::deactivate()
{
_deactivated = true;
}
Eigen::Matrix4f RobotStateComponentPlugin::transformFromTo(
const std::string& from,
const std::string& to,
......
......@@ -57,6 +57,7 @@ namespace armarx::plugins
void setRobotStateComponentName(const std::string& name);
void setRobotStateComponent(const RobotStateComponentInterfacePrx& rsc);
const std::string& getRobotStateComponentName() const;
void deactivate();
//get / add
public:
bool hasRobot(const std::string& id) const;
......@@ -153,6 +154,7 @@ namespace armarx::plugins
mutable std::recursive_mutex _robotsMutex;
std::map<std::string, RobotData> _robots;
RobotNameHelperPtr _nameHelper;
bool _deactivated = false;
};
}
......
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