Skip to content
Snippets Groups Projects
Commit 41a621ae authored by Christoph Pohl's avatar Christoph Pohl
Browse files

Added HandUnitComponentPlugin

parent 4f41b71a
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@ set(LIB_FILES
TrajectoryPlayerComponentPlugin.cpp
CartesianPositionControlComponentPlugin.cpp
NaturalIKComponentPlugin.cpp
HandUnitComponentPlugin.cpp
)
set(LIB_HEADERS
RobotStateComponentPlugin.h
......@@ -34,6 +35,7 @@ set(LIB_HEADERS
TrajectoryPlayerComponentPlugin.h
CartesianPositionControlComponentPlugin.h
NaturalIKComponentPlugin.h
HandUnitComponentPlugin.h
)
armarx_add_library("${LIB_NAME}" "${LIB_FILES}" "${LIB_HEADERS}" "${LIBS}")
......
#include "HandUnitComponentPlugin.h"
namespace armarx
{
namespace plugins
{
void HandUnitComponentPlugin::preOnInitComponent()
{
parent<Component>().usingProxyFromProperty(PROPERTY_NAME);
}
void HandUnitComponentPlugin::preOnConnectComponent()
{
parent<Component>().getProxyFromProperty(_handUnit, PROPERTY_NAME);
}
void HandUnitComponentPlugin::postCreatePropertyDefinitions(armarx::PropertyDefinitionsPtr& properties)
{
if (!properties->hasDefinition(PROPERTY_NAME))
{
properties->defineOptionalProperty<std::string>(
PROPERTY_NAME,
"HandUnit",
"Name of the HandUnit");
}
}
HandUnitInterfacePrx HandUnitComponentPlugin::getHandUnit()
{
return _handUnit;
}
}
}
namespace armarx
{
HandUnitComponentPluginUser::HandUnitComponentPluginUser()
{
addPlugin(plugin);
}
HandUnitInterfacePrx HandUnitComponentPluginUser::getHandUnit()
{
return plugin->getHandUnit();
}
}
#pragma once
#include <ArmarXCore/core/Component.h>
#include <RobotAPI/interface/units/HandUnitInterface.h>
namespace armarx
{
namespace plugins
{
class HandUnitComponentPlugin : public ComponentPlugin
{
public:
using ComponentPlugin::ComponentPlugin;
void preOnInitComponent() override;
void preOnConnectComponent() override;
void postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties) override;
HandUnitInterfacePrx getHandUnit();
private:
static constexpr const char* PROPERTY_NAME = "HandUnitName";
HandUnitInterfacePrx _handUnit;
};
}
}
namespace armarx
{
/**
* @brief Provides a ready-to-use HandUnit.
*/
class HandUnitComponentPluginUser : virtual public ManagedIceObject
{
public:
HandUnitComponentPluginUser();
HandUnitInterfacePrx getHandUnit();
private:
armarx::plugins::HandUnitComponentPlugin* plugin = nullptr;
};
}
namespace armarx
{
namespace plugins
{
// Legacy typedef.
using HandUnitComponentPluginUser = armarx::HandUnitComponentPluginUser;
}
}
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