Go to the documentation of this file.
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())
74 parent<Component>().getProperty(_robotUnitName, PROPERTY_NAME);
77 if (not _isRobotUnitOptionalDependency)
79 parent<Component>().usingProxy(_robotUnitName);
86 if (not _robotUnitName.empty())
88 parent<Component>().getProxy(_robotUnit, _robotUnitName);
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!";
153 parent<Component>().usingProxy(_robotUnitName);
157 std::this_thread::sleep_for(std::chrono::milliseconds(100));
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));
bool isNullptr(const T &p)
PrxT createNJointController(const std::string &className, const std::string &instanceName, const NJointControllerConfigPtr &config, bool doManageController=true)
void setRobotUnitName(const std::string &name)
void postOnDisconnectComponent() override
std::shared_ptr< class RobotUnitDataStreamingReceiver > RobotUnitDataStreamingReceiverPtr
ManagedIceObject & parent()
#define ARMARX_CHECK_EMPTY(c)
const std::string & getRobotUnitName() const
#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...
bool robotUnitIsRunning() const
void manageController(const NJointControllerInterfacePrx &ctrl)
PluginT * addPlugin(const std::string prefix="", ParamsT &&...params)
bool hasRobotUnitName() const
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
This file is part of ArmarX.
bool isRunning(Status status)
Returns whether the given task status describes a state where a path is planned.
RobotUnitComponentPluginUser()
RobotUnitDataStreamingReceiverPtr startDataStreaming(const RobotUnitDataStreaming::Config &cfg)
void waitUntilRobotUnitIsRunning(const std::function< bool()> &termCond=[] { return false;}) const
Waits until the robot unit is running.
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
void preOnConnectComponent() override
void preOnInitComponent() override
void setRobotUnitAsOptionalDependency(bool isOptional=true)
plugins::RobotUnitComponentPlugin & getRobotUnitComponentPlugin()
RobotUnitInterfacePrx getRobotUnit() const
void waitUntilRobotUnitIsRunning(const std::function< bool()> &termCond=[] { return false;})
Waits until the robot unit is running.
This file offers overloads of toIce() and fromIce() functions for STL container types.
RobotUnitInterfacePrx getRobotUnit() const
#define ARMARX_STREAM_PRINTER
use this macro to write output code that is executed when printed and thus not executed if the debug ...