Skip to content
Snippets Groups Projects
Commit b8a0cdfc authored by Mirko Wächter's avatar Mirko Wächter
Browse files

added robotpool for robotunit robots

parent cfcafa72
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,8 @@
#include <ArmarXCore/core/system/cmake/CMakePackageFinder.h>
#include <ArmarXCore/core/system/ArmarXDataPath.h>
#include <RobotAPI/libraries/core/RobotPool.h>
#include "RobotUnitModuleRobotData.h"
namespace armarx
......@@ -73,8 +75,8 @@ namespace armarx
throwIfInControlThread(BOOST_CURRENT_FUNCTION);
std::lock_guard<std::mutex> guard {robotMutex};
ARMARX_CHECK_EXPRESSION_W_HINT(robot, __FUNCTION__ << " should only be called after _initVirtualRobot was called");
ARMARX_CHECK_EXPRESSION(robot);
const VirtualRobot::RobotPtr clone = robot->clone();
ARMARX_CHECK_EXPRESSION(robotPool);
const VirtualRobot::RobotPtr clone = robotPool->getRobot();
clone->setUpdateVisualization(false);
clone->setUpdateCollisionModel(updateCollisionModel);
return clone;
......@@ -123,6 +125,7 @@ namespace armarx
<< "\n\tRobotNodeSet : " << robotNodeSetName
<< "\n\tNodeNames : " << robot->getRobotNodeSet(robotNodeSetName)->getNodeNames();
ARMARX_CHECK_NOT_NULL(robot);
robotPool.reset(new RobotPool(robot, 10));
}
}
}
......
......@@ -32,6 +32,8 @@
namespace armarx
{
typedef std::shared_ptr<class RobotPool> RobotPoolPtr;
namespace RobotUnitModule
{
class RobotDataPropertyDefinitions: public ModuleBasePropertyDefinitions
......@@ -129,6 +131,7 @@ namespace armarx
/// @brief The robot's model.
boost::shared_ptr<VirtualRobot::Robot> robot;
RobotPoolPtr robotPool;
/// @brief A mutex guarding \ref robot
mutable std::mutex robotMutex;
};
......
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