Go to the documentation of this file.
26 #include <VirtualRobot/VirtualRobot.h>
27 #include <VirtualRobot/Robot.h>
28 #include <VirtualRobot/RobotNodeSet.h>
29 #include <VirtualRobot/Nodes/RobotNode.h>
30 #include <RobotAPI/interface/core/RobotState.h>
31 #include <VirtualRobot/Nodes/RobotNodeRevolute.h>
32 #include <VirtualRobot/Nodes/RobotNodePrismatic.h>
33 #include <VirtualRobot/Nodes/RobotNodeFixed.h>
34 #include <VirtualRobot/XML/RobotIO.h>
48 template<
typename VirtualRobotNodeType>
69 template<
class VirtualRobotNodeType>
71 public VirtualRobotNodeType
80 this->name =
_node->getName();
82 _node->getJointValueOffest();
101 virtual bool hasChildNode(
const std::string& child,
bool recursive =
false)
const;
103 std::vector<VirtualRobot::RobotNodePtr>
getAllParents(VirtualRobot::RobotNodeSetPtr rns)
override;
119 std::vector< VirtualRobot::SceneObjectPtr>
getChildren()
const override;
125 virtual bool hasChildNode(
const VirtualRobot::RobotNodePtr child,
bool recursive =
false)
const;
126 virtual void addChildNode(VirtualRobot::RobotNodePtr child);
127 virtual bool initialize(VirtualRobot::RobotNodePtr parent,
bool initializeChildren =
false);
128 virtual void reset();
130 virtual void setJointValue(
float q,
bool updateTransformations =
true,
bool clampToLimits =
true);
146 VirtualRobot::RobotNodePtr
getRootNode()
const override;
148 bool hasRobotNode(
const std::string& robotNodeName)
const override;
149 bool hasRobotNode(VirtualRobot::RobotNodePtr)
const override;
151 VirtualRobot::RobotNodePtr
getRobotNode(
const std::string& robotNodeName)
const override;
152 void getRobotNodes(std::vector< VirtualRobot::RobotNodePtr >& storeNodes,
bool clearVector =
true)
const override;
155 VirtualRobot::RobotNodeSetPtr
getRobotNodeSet(
const std::string& nodeSetName)
const override;
156 void getRobotNodeSets(std::vector<VirtualRobot::RobotNodeSetPtr>& storeNodeSet)
const override;
171 std::string
getName()
const override;
226 bool hasEndEffector(
const std::string& endEffectorName)
const override;
228 VirtualRobot::EndEffectorPtr
getEndEffector(
const std::string& endEffectorName)
const override;
230 void getEndEffectors(std::vector<VirtualRobot::EndEffectorPtr>& storeEEF)
const override;
233 void setRootNode(VirtualRobot::RobotNodePtr node)
override;
251 VirtualRobot::RobotNodePtr
createLocalNode(SharedRobotNodeInterfacePrx remoteNode, std::vector<VirtualRobot::RobotNodePtr>& allNodes, std::map<VirtualRobot::RobotNodePtr, std::vector<std::string> >& childrenMap,
VirtualRobot::RobotPtr robo);
255 mutable std::map<std::string, VirtualRobot::RobotNodePtr>
_cachedNodes;
256 mutable VirtualRobot::RobotNodePtr
_root;
258 static std::recursive_mutex
m;
virtual float getJointLimitLo() const
static std::recursive_mutex m
Eigen::Matrix4f getGlobalPose() const override
static VirtualRobot::RobotNodePtr createRemoteRobotNode(SharedRobotNodeInterfacePrx, VirtualRobot::RobotPtr)
bool hasRobotNode(const std::string &robotNodeName) const override
SharedRobotInterfacePrx _robot
void deregisterRobotNode(VirtualRobot::RobotNodePtr node) override
Not implemented yet.
static bool synchronizeLocalClone(VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx)
virtual bool hasChildNode(const std::string &child, bool recursive=false) const
static VirtualRobot::RobotPtr createLocalCloneFromFile(RobotStateComponentInterfacePrx robotStatePrx, VirtualRobot::RobotIO::RobotDescription loadMode=VirtualRobot::RobotIO::eFull)
This is a convenience function for createLocalClone, which automatically gets the filename from the R...
VirtualRobot::RobotNodePtr getRootNode() const override
static void initialize(RemoteRobotNode< VirtualRobotNodeType > *remoteNode)
void getRobotNodes(std::vector< VirtualRobot::RobotNodePtr > &storeNodes, bool clearVector=true) const override
VirtualRobot::RobotNodePtr _root
void getEndEffectors(std::vector< VirtualRobot::EndEffectorPtr > &storeEEF) const override
Not implemented yet.
virtual float getJointLimitHi() const
virtual void setLocalTransformation(const Eigen::Matrix4f &trafo)
float getJointValue() const override
Eigen::Matrix4f getGlobalPose() const override
VirtualRobot::RobotNodePtr createLocalNode(SharedRobotNodeInterfacePrx remoteNode, std::vector< VirtualRobot::RobotNodePtr > &allNodes, std::map< VirtualRobot::RobotNodePtr, std::vector< std::string > > &childrenMap, VirtualRobot::RobotPtr robo)
RemoteRobotNodeInitializer is used to initialize the robot node for a given node type.
std::vector< VirtualRobot::SceneObjectPtr > getChildren() const override
VirtualRobot::RobotNodeSetPtr getRobotNodeSet(const std::string &nodeSetName) const override
VirtualRobot::RobotNodePtr getRobotNode(const std::string &robotNodeName) const override
Eigen::Matrix4f getPoseInRootFrame() const override
std::string getName() const override
bool hasRobotNodeSet(const std::string &name) const override
SharedRobotNodeInterfacePrx getSharedRobotNode()
SharedRobotNodeInterfacePrx _node
void getRobotNodeSets(std::vector< VirtualRobot::RobotNodeSetPtr > &storeNodeSet) const override
void setJointLimits(float lo, float hi) override
void setGlobalPose(const Eigen::Matrix4f &pose) override
void registerEndEffector(VirtualRobot::EndEffectorPtr endEffector) override
Not implemented yet.
SharedRobotInterfacePrx getSharedRobot() const
Use this method to share the robot instance over Ice.
std::vector< VirtualRobot::RobotNodePtr > getAllParents(VirtualRobot::RobotNodeSetPtr rns) override
void updateTransformationMatrices() override
void deregisterRobotNodeSet(VirtualRobot::RobotNodeSetPtr nodeSet) override
Not implemented yet.
CollisionCheckerPtr RemoteRobotNode_getGlobalCollisionChecker()
virtual void addChildNode(VirtualRobot::RobotNodePtr child)
Eigen::Matrix4f getLocalTransformation() override
std::shared_ptr< RemoteRobot > RemoteRobotPtr
virtual VirtualRobot::SceneObjectPtr getParent()
Mimics the behaviour of the VirtualRobot::Robot class while redirecting everything to an Ice proxy.
Mimics the behaviour of robot nodes while redirecting everything to Ice proxies.
MatrixXX< 4, 4, float > Matrix4f
std::map< std::string, VirtualRobot::RobotNodePtr > _cachedNodes
void registerRobotNodeSet(VirtualRobot::RobotNodeSetPtr nodeSet) override
Not implemented yet.
VirtualRobot::RobotPtr createLocalClone()
Clones the structure of this remote robot to a local instance.
RemoteRobotNode(SharedRobotNodeInterfacePrx node, VirtualRobot::RobotPtr vr)
static bool synchronizeLocalCloneToTimestamp(VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx, Ice::Long timestamp)
Synchronizes a local robot to a robot state at timestamp.
static bool synchronizeLocalCloneToState(VirtualRobot::RobotPtr robot, RobotStateConfig const &state)
boost::intrusive_ptr< SceneObject > SceneObjectPtr
virtual std::string getParentName() const
virtual std::vector< std::string > getChildrenNames() const
virtual bool initialize(VirtualRobot::RobotNodePtr parent, bool initializeChildren=false)
~RemoteRobotNode() override
VirtualRobot::EndEffectorPtr getEndEffector(const std::string &endEffectorName) const override
Not implemented yet.
RemoteRobot(SharedRobotInterfacePrx robot)
virtual void setJointValue(float q, bool updateTransformations=true, bool clampToLimits=true)
Eigen::Vector3f getPositionInRootFrame() const override
This file offers overloads of toIce() and fromIce() functions for STL container types.
void setRootNode(VirtualRobot::RobotNodePtr node) override
Not implemented yet.
void setGlobalPose(const Eigen::Matrix4f &globalPose, bool applyValues=true) override
Sets the global pose of the robot.
std::shared_ptr< class Robot > RobotPtr
void registerRobotNode(VirtualRobot::RobotNodePtr node) override
Not implemented yet.
bool hasEndEffector(const std::string &endEffectorName) const override
Not implemented yet.