Simox  2.3.74.0
VirtualRobot::RobotFactory Class Reference

Data Structures

struct  robotNodeDef
 
struct  robotStructureDef
 

Static Public Member Functions

static RobotPtr createRobot (const std::string &name, const std::string &type="")
 
static bool initializeRobot (RobotPtr robot, std::vector< RobotNodePtr > &robotNodes, std::map< RobotNodePtr, std::vector< std::string > > childrenMap, RobotNodePtr rootNode)
 
static RobotPtr clone (RobotPtr robot, const std::string &name, CollisionCheckerPtr collisionChecker=CollisionCheckerPtr(), float scaling=1.0f)
 
static RobotPtr cloneSubSet (RobotPtr robot, RobotNodeSetPtr rns, const std::string &name)
 
static RobotPtr cloneUniteSubsets (RobotPtr robot, const std::string &name, std::vector< std::string > uniteWithAllChildren)
 
static RobotPtr cloneInversed (RobotPtr robot, const std::string &newRootName, bool cloneRNS=true, bool cloneEEF=true)
 
static RobotPtr cloneChangeStructure (RobotPtr robot, robotStructureDef &newStructure)
 
static RobotPtr cloneChangeStructure (RobotPtr robot, const std::string &startNode, const std::string &endNode)
 
static bool attach (RobotPtr robot, SceneObjectPtr o, RobotNodePtr rn, const Eigen::Matrix4f &transformation)
 attach Attach an object to a robot. The object is cloned. More...
 
static bool detach (RobotPtr robot, RobotNodePtr rn)
 

Protected Member Functions

 RobotFactory ()
 
virtual ~RobotFactory ()
 

Static Protected Member Functions

static RobotNodePtr createUnitedRobotNode (RobotPtr robot, const std::vector< RobotNodePtr > &nodes, RobotNodePtr parent, RobotNodePtr parentClone, const Eigen::Matrix4f &trafo, const std::vector< SensorPtr > &sensors)
 
static RobotNodePtr accumulateTransformations (RobotPtr robot, RobotNodePtr nodeA, RobotNodePtr nodeAClone, RobotNodePtr nodeB, Eigen::Matrix4f &storeTrafo)
 
static void getChildNodes (RobotNodePtr nodeA, RobotNodePtr nodeExclude, std::vector< RobotNodePtr > &appendNodes)
 
static void getChildSensorNodes (RobotNodePtr nodeA, RobotNodePtr nodeExclude, std::vector< SensorPtr > &appendNodes)
 
static void cloneRecursiveUnite (RobotPtr robot, RobotNodePtr currentNode, RobotNodePtr currentNodeClone, std::vector< std::string > uniteWithAllChildren)
 

Constructor & Destructor Documentation

◆ RobotFactory()

VirtualRobot::RobotFactory::RobotFactory ( )
protecteddefault

◆ ~RobotFactory()

VirtualRobot::RobotFactory::~RobotFactory ( )
protectedvirtualdefault

Member Function Documentation

◆ accumulateTransformations()

RobotNodePtr VirtualRobot::RobotFactory::accumulateTransformations ( RobotPtr  robot,
RobotNodePtr  nodeA,
RobotNodePtr  nodeAClone,
RobotNodePtr  nodeB,
Eigen::Matrix4f &  storeTrafo 
)
staticprotected

◆ attach()

bool VirtualRobot::RobotFactory::attach ( RobotPtr  robot,
SceneObjectPtr  o,
RobotNodePtr  rn,
const Eigen::Matrix4f &  transformation 
)
static

attach Attach an object to a robot. The object is cloned.

Parameters
robot
oThe object and its visualization model is cloned
rnThe robot node to which the object should be attached
transformationThe RN to object transformation
Returns
true on succes

◆ clone()

RobotPtr VirtualRobot::RobotFactory::clone ( RobotPtr  robot,
const std::string &  name,
CollisionCheckerPtr  collisionChecker = CollisionCheckerPtr(),
float  scaling = 1.0f 
)
static

Clones the robot.

Parameters
robotThe robot to clone
nameThe new name
collisionCheckerOptional: A collision checker to which the robot should be registered. If not set, the collision checker of the input robot is used.
scalingScale the resulting robot.

◆ cloneChangeStructure() [1/2]

RobotPtr VirtualRobot::RobotFactory::cloneChangeStructure ( RobotPtr  robot,
robotStructureDef newStructure 
)
static

Chenge the structure of the clone according to the given defintion.

◆ cloneChangeStructure() [2/2]

RobotPtr VirtualRobot::RobotFactory::cloneChangeStructure ( RobotPtr  robot,
const std::string &  startNode,
const std::string &  endNode 
)
static

Clone kinematic chain and reverse direction.

Parameters
startNodeName of the start node of the original kinematic chain.
endNodeName of the end node of the original kinematic chain. Will be the new root.

◆ cloneInversed()

RobotPtr VirtualRobot::RobotFactory::cloneInversed ( RobotPtr  robot,
const std::string &  newRootName,
bool  cloneRNS = true,
bool  cloneEEF = true 
)
static

Creates a clone with changed structure, so that the given robot node is the new root of the resulting kinematic tree.

◆ cloneRecursiveUnite()

void VirtualRobot::RobotFactory::cloneRecursiveUnite ( RobotPtr  robot,
RobotNodePtr  currentNode,
RobotNodePtr  currentNodeClone,
std::vector< std::string >  uniteWithAllChildren 
)
staticprotected

◆ cloneSubSet()

RobotPtr VirtualRobot::RobotFactory::cloneSubSet ( RobotPtr  robot,
RobotNodeSetPtr  rns,
const std::string &  name 
)
static

Clones the robot, but only leave the defined joints active. ALl other joints are accumulated and set to one model which is fixed (may result in faster updates)

Parameters
robotThe robot to clone
rnsThe robot node set of active joints. The joints must be given as an ordered set, i.e. node i must be located before node i+1 in the kinematic structure of the robot.
nameThe new name

◆ cloneUniteSubsets()

RobotPtr VirtualRobot::RobotFactory::cloneUniteSubsets ( RobotPtr  robot,
const std::string &  name,
std::vector< std::string >  uniteWithAllChildren 
)
static

Creates a robot clone with reduced structure.

Parameters
robotThe robot to clone.
uniteWithAllChildrenList of RobotNodeNames. Each listed robot ndoe is united with all of its children to one fixed RobotNode. This means that all related coordinate systems and joints will not be present in the clone. The visualizations are united.

◆ createRobot()

RobotPtr VirtualRobot::RobotFactory::createRobot ( const std::string &  name,
const std::string &  type = "" 
)
static

Creates an empty robot.

◆ createUnitedRobotNode()

RobotNodePtr VirtualRobot::RobotFactory::createUnitedRobotNode ( RobotPtr  robot,
const std::vector< RobotNodePtr > &  nodes,
RobotNodePtr  parent,
RobotNodePtr  parentClone,
const Eigen::Matrix4f &  trafo,
const std::vector< SensorPtr > &  sensors 
)
staticprotected

◆ detach()

bool VirtualRobot::RobotFactory::detach ( RobotPtr  robot,
RobotNodePtr  rn 
)
static

◆ getChildNodes()

void VirtualRobot::RobotFactory::getChildNodes ( RobotNodePtr  nodeA,
RobotNodePtr  nodeExclude,
std::vector< RobotNodePtr > &  appendNodes 
)
staticprotected

◆ getChildSensorNodes()

void VirtualRobot::RobotFactory::getChildSensorNodes ( RobotNodePtr  nodeA,
RobotNodePtr  nodeExclude,
std::vector< SensorPtr > &  appendNodes 
)
staticprotected

◆ initializeRobot()

bool VirtualRobot::RobotFactory::initializeRobot ( RobotPtr  robot,
std::vector< RobotNodePtr > &  robotNodes,
std::map< RobotNodePtr, std::vector< std::string > >  childrenMap,
RobotNodePtr  rootNode 
)
static

Initializes Robot and all RobotNodes.

Parameters
robotNodesAll nodes of the robot. Must contain rootNode.
childrenMapParent-child relations are built according to this data.
rootNodeThe root.