23 std::vector<std::string> cs(_ctrls.begin(), _ctrls.end());
24 _robotUnit->deactivateAndDeleteNJointControllers(cs);
29 NJointControllerInterfacePrx
31 const std::string& className,
32 const std::string& instanceName,
33 const armarx::NJointControllerConfigPtr& config,
34 bool doManageController)
40 if (doManageController)
42 out <<
"and managing ";
44 out <<
" controller '" << instanceName <<
"' of class '" << instanceName <<
"'";
47 _robotUnit->createOrReplaceNJointController(className, instanceName, config);
49 if (doManageController)
72 if (_robotUnitName.empty())
77 if (not _isRobotUnitOptionalDependency)
86 if (not _robotUnitName.empty())
96 if (!properties->hasDefinition(PROPERTY_NAME))
98 if (_isRobotUnitOptionalDependency)
100 properties->defineOptionalProperty<std::string>(
101 PROPERTY_NAME,
"",
"Name of the RobotUnit");
105 properties->defineRequiredProperty<std::string>(PROPERTY_NAME,
106 "Name of the RobotUnit");
121 _robotUnitName = name;
127 return _robotUnitName;
133 return not _robotUnitName.empty();
139 _isRobotUnitOptionalDependency = isOptional;
145 ARMARX_INFO <<
"Waiting until robot unit is running ...";
149 ARMARX_ERROR <<
"Could not wait for a robotUnit without a name!";
157 std::this_thread::sleep_for(std::chrono::milliseconds(100));
187 return plugin->getRobotUnit();
198 const std::function<
bool()>& termCond)
const
200 ARMARX_INFO <<
"Waiting until robot unit is running ...";
202 while ((not termCond()) and
205 std::this_thread::sleep_for(std::chrono::milliseconds(100));
#define ARMARX_CHECK_EMPTY(c)
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
#define ARMARX_STREAM_PRINTER
use this macro to write output code that is executed when printed and thus not executed if the debug ...
ManagedIceObject & parent()
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
PluginT * addPlugin(const std::string prefix="", ParamsT &&... params)
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
plugins::RobotUnitComponentPlugin & getRobotUnitComponentPlugin()
void waitUntilRobotUnitIsRunning(const std::function< bool()> &termCond=[] { return false;}) const
Waits until the robot unit is running.
RobotUnitComponentPluginUser()
RobotUnitInterfacePrx getRobotUnit() const
void postOnDisconnectComponent() override
void preOnInitComponent() override
void preOnConnectComponent() override
void setRobotUnitAsOptionalDependency(bool isOptional=true)
RobotUnitDataStreamingReceiverPtr startDataStreaming(const RobotUnitDataStreaming::Config &cfg)
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
void setRobotUnitName(const std::string &name)
bool robotUnitIsRunning() const
const std::string & getRobotUnitName() const
void manageController(const NJointControllerInterfacePrx &ctrl)
void waitUntilRobotUnitIsRunning(const std::function< bool()> &termCond=[] { return false;})
Waits until the robot unit is running.
RobotUnitInterfacePrx getRobotUnit() const
bool hasRobotUnitName() const
PrxT createNJointController(const std::string &className, const std::string &instanceName, const NJointControllerConfigPtr &config, bool doManageController=true)
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
#define ARMARX_INFO
The normal logging level.
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
This file is part of ArmarX.
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotUnitInterface > RobotUnitInterfacePrx
auto make_shared(Args &&... args)
bool isNullptr(const T &p)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
std::shared_ptr< class RobotUnitDataStreamingReceiver > RobotUnitDataStreamingReceiverPtr