Skip to content
Snippets Groups Projects
Commit 87d6402a authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Add function of plugin user to plugin

parent 69af7b2e
No related branches found
No related tags found
2 merge requests!185Clean up interfaces and unneeded code in memory core classes,!178Draft: Make RobotStateMemory ready
......@@ -116,6 +116,19 @@ namespace armarx::plugins
}
void RobotUnitComponentPlugin::waitUntilRobotUnitIsRunning(const std::function<bool ()>& termCond) const
{
ARMARX_INFO << "Waiting until robot unit is running ...";
while (not(termCond() or not isNullptr(getRobotUnit()) or getRobotUnit()->isRunning()))
{
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
ARMARX_INFO << "Robot unit is up and running.";
}
} // namespace armarx::plugins
......
......@@ -34,6 +34,19 @@ namespace armarx
}
/**
* @brief Waits until the robot unit is running.
*
* Although the robot unit proxy might be initialized (\see getRobotUnit()), the robot unit might
* not be fully initialized.
*
* @param termCond Termination condition.
* If it evaluates to true, waitUntilRobotUnitIsRunning returns without waiting
* for the robot unit to become available.
*/
void waitUntilRobotUnitIsRunning(const std::function<bool()>& termCond = [] {return false;}) const;
//controllers
public:
......
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