RemoteRobot Class Reference

Mimics the behaviour of the VirtualRobot::Robot class while redirecting everything to an Ice proxy. More...

#include <RobotAPI/libraries/core/remoterobot/RemoteRobot.h>

+ Inheritance diagram for RemoteRobot:

Public Member Functions

VirtualRobot::RobotPtr createLocalClone ()
 Clones the structure of this remote robot to a local instance. More...
 
Eigen::Matrix4f getGlobalPose () const override
 
std::string getName () const override
 
VirtualRobot::RobotNodePtr getRobotNode (const std::string &robotNodeName) const override
 
void getRobotNodes (std::vector< VirtualRobot::RobotNodePtr > &storeNodes, bool clearVector=true) const override
 
VirtualRobot::RobotNodeSetPtr getRobotNodeSet (const std::string &nodeSetName) const override
 
void getRobotNodeSets (std::vector< VirtualRobot::RobotNodeSetPtr > &storeNodeSet) const override
 
VirtualRobot::RobotNodePtr getRootNode () const override
 
float getScaling ()
 
SharedRobotInterfacePrx getSharedRobot () const
 Use this method to share the robot instance over Ice. More...
 
bool hasRobotNode (const std::string &robotNodeName) const override
 
bool hasRobotNode (VirtualRobot::RobotNodePtr) const override
 
bool hasRobotNodeSet (const std::string &name) const override
 
 RemoteRobot (SharedRobotInterfacePrx robot)
 
 ~RemoteRobot () override
 

Static Public Member Functions

static VirtualRobot::RobotPtr createLocalClone (RobotStateComponentInterfacePrx robotStatePrx, const std::string &filename=std::string(), const Ice::StringSeq packages=Ice::StringSeq(), VirtualRobot::RobotIO::RobotDescription loadMode=VirtualRobot::RobotIO::eFull)
 
static VirtualRobot::RobotPtr createLocalClone (SharedRobotInterfacePrx sharedRobotPrx, std::string filename=std::string(), float scaling=1.0f, const Ice::StringSeq packages=Ice::StringSeq(), VirtualRobot::RobotIO::RobotDescription loadMode=VirtualRobot::RobotIO::eFull)
 
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 RobotStateComponent, loads robot from the file and syncs it once. More...
 
static bool synchronizeLocalClone (VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx)
 
static bool synchronizeLocalClone (VirtualRobot::RobotPtr robot, SharedRobotInterfacePrx sharedRobotPrx)
 
static bool synchronizeLocalCloneToState (VirtualRobot::RobotPtr robot, RobotStateConfig const &state)
 
static bool synchronizeLocalCloneToTimestamp (VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx, Ice::Long timestamp)
 Synchronizes a local robot to a robot state at timestamp. More...
 

Protected Member Functions

VirtualRobot::RobotNodePtr createLocalNode (SharedRobotNodeInterfacePrx remoteNode, std::vector< VirtualRobot::RobotNodePtr > &allNodes, std::map< VirtualRobot::RobotNodePtr, std::vector< std::string > > &childrenMap, VirtualRobot::RobotPtr robo)
 
void deregisterRobotNode (VirtualRobot::RobotNodePtr node) override
 Not implemented yet. More...
 
void deregisterRobotNodeSet (VirtualRobot::RobotNodeSetPtr nodeSet) override
 Not implemented yet. More...
 
VirtualRobot::EndEffectorPtr getEndEffector (const std::string &endEffectorName) const override
 Not implemented yet. More...
 
void getEndEffectors (std::vector< VirtualRobot::EndEffectorPtr > &storeEEF) const override
 Not implemented yet. More...
 
bool hasEndEffector (const std::string &endEffectorName) const override
 Not implemented yet. More...
 
void registerEndEffector (VirtualRobot::EndEffectorPtr endEffector) override
 Not implemented yet. More...
 
void registerRobotNode (VirtualRobot::RobotNodePtr node) override
 Not implemented yet. More...
 
void registerRobotNodeSet (VirtualRobot::RobotNodeSetPtr nodeSet) override
 Not implemented yet. More...
 
void setGlobalPose (const Eigen::Matrix4f &globalPose, bool applyValues=true) override
 Sets the global pose of the robot. More...
 
void setRootNode (VirtualRobot::RobotNodePtr node) override
 Not implemented yet. More...
 

Static Protected Member Functions

static VirtualRobot::RobotNodePtr createRemoteRobotNode (SharedRobotNodeInterfacePrx, VirtualRobot::RobotPtr)
 

Protected Attributes

std::map< std::string, VirtualRobot::RobotNodePtr > _cachedNodes
 
SharedRobotInterfacePrx _robot
 
VirtualRobot::RobotNodePtr _root
 

Static Protected Attributes

static std::recursive_mutex m
 

Detailed Description

Mimics the behaviour of the VirtualRobot::Robot class while redirecting everything to an Ice proxy.

For a description of the members please refer to the Simox documentation (VirtualRobot::Robot). Note that not the complete interface has been made available yet. These functions are marked as protected.

Definition at line 139 of file RemoteRobot.h.

Constructor & Destructor Documentation

◆ RemoteRobot()

Definition at line 57 of file RemoteRobot.cpp.

+ Here is the caller graph for this function:

◆ ~RemoteRobot()

~RemoteRobot ( )
override

Definition at line 64 of file RemoteRobot.cpp.

Member Function Documentation

◆ createLocalClone() [1/3]

VirtualRobot::RobotPtr createLocalClone ( )

Clones the structure of this remote robot to a local instance.

Definition at line 328 of file RemoteRobot.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createLocalClone() [2/3]

VirtualRobot::RobotPtr createLocalClone ( RobotStateComponentInterfacePrx  robotStatePrx,
const std::string &  filename = std::string(),
const Ice::StringSeq  packages = Ice::StringSeq(),
VirtualRobot::RobotIO::RobotDescription  loadMode = VirtualRobot::RobotIO::eFull 
)
static

Creates a local robot that is synchronized once but not updated any more. You can use the synchronizeLocalClone method to update the joint values. Note that only the kinematic structure is cloned, but the visualization files, collision models, end effectors, etc are not copied. This means you can use this model for kinematic computations (e.g. coordinate transformations) but not for advanced features like collision detection. In order to get a fully featured robot model you can pass a filename to VirtualRobot::Robot, but then you need to make sure that the loaded model is identical to the model of the remote robot (otherwise errors will occur). In the packages parameter you can pass in ArmarX packages, in which the robot file model might be in. The loadMode specifies in which mode the model should be loaded. Refer to simox for more information (only matters if filename was passed in).

See also
createLocalCloneFromFile(), synchronizeLocalClone()

Definition at line 366 of file RemoteRobot.cpp.

+ Here is the call graph for this function:

◆ createLocalClone() [3/3]

RobotPtr createLocalClone ( SharedRobotInterfacePrx  sharedRobotPrx,
std::string  filename = std::string(),
float  scaling = 1.0f,
const Ice::StringSeq  packages = Ice::StringSeq(),
VirtualRobot::RobotIO::RobotDescription  loadMode = VirtualRobot::RobotIO::eFull 
)
static

Definition at line 371 of file RemoteRobot.cpp.

+ Here is the call graph for this function:

◆ createLocalCloneFromFile()

RobotPtr createLocalCloneFromFile ( RobotStateComponentInterfacePrx  robotStatePrx,
VirtualRobot::RobotIO::RobotDescription  loadMode = VirtualRobot::RobotIO::eFull 
)
static

This is a convenience function for createLocalClone, which automatically gets the filename from the RobotStateComponent, loads robot from the file and syncs it once.

Parameters
robotStatePrxProxy to the RobotStateComponent
loadModeThe loadMode specifies in which mode the model should be loaded. Refer to simox for more information.
Returns
new robot clone
See also
createLocalClone(), synchronizeLocalClone()

Definition at line 441 of file RemoteRobot.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createLocalNode()

VirtualRobot::RobotNodePtr createLocalNode ( SharedRobotNodeInterfacePrx  remoteNode,
std::vector< VirtualRobot::RobotNodePtr > &  allNodes,
std::map< VirtualRobot::RobotNodePtr, std::vector< std::string > > &  childrenMap,
VirtualRobot::RobotPtr  robo 
)
protected

Definition at line 205 of file RemoteRobot.cpp.

+ Here is the caller graph for this function:

◆ createRemoteRobotNode()

RobotNodePtr createRemoteRobotNode ( SharedRobotNodeInterfacePrx  node,
VirtualRobot::RobotPtr  robot 
)
staticprotected

Definition at line 42 of file RemoteRobotNode.cpp.

+ Here is the caller graph for this function:

◆ deregisterRobotNode()

void deregisterRobotNode ( VirtualRobot::RobotNodePtr  node)
overrideprotected

Not implemented yet.

Definition at line 543 of file RemoteRobot.cpp.

◆ deregisterRobotNodeSet()

void deregisterRobotNodeSet ( VirtualRobot::RobotNodeSetPtr  nodeSet)
overrideprotected

Not implemented yet.

Definition at line 545 of file RemoteRobot.cpp.

◆ getEndEffector()

EndEffectorPtr getEndEffector ( const std::string &  endEffectorName) const
overrideprotected

Not implemented yet.

Definition at line 535 of file RemoteRobot.cpp.

◆ getEndEffectors()

void getEndEffectors ( std::vector< VirtualRobot::EndEffectorPtr > &  storeEEF) const
overrideprotected

Not implemented yet.

Definition at line 540 of file RemoteRobot.cpp.

◆ getGlobalPose()

Matrix4f getGlobalPose ( ) const
override
Returns
Global pose of the robot

Definition at line 184 of file RemoteRobot.cpp.

◆ getName()

std::string getName ( ) const
override

Definition at line 200 of file RemoteRobot.cpp.

+ Here is the caller graph for this function:

◆ getRobotNode()

RobotNodePtr getRobotNode ( const std::string &  robotNodeName) const
override

Definition at line 128 of file RemoteRobot.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRobotNodes()

void getRobotNodes ( std::vector< VirtualRobot::RobotNodePtr > &  storeNodes,
bool  clearVector = true 
) const
override

Definition at line 146 of file RemoteRobot.cpp.

+ Here is the call graph for this function:

◆ getRobotNodeSet()

RobotNodeSetPtr getRobotNodeSet ( const std::string &  nodeSetName) const
override

Definition at line 165 of file RemoteRobot.cpp.

+ Here is the caller graph for this function:

◆ getRobotNodeSets()

void getRobotNodeSets ( std::vector< VirtualRobot::RobotNodeSetPtr > &  storeNodeSet) const
override

Definition at line 174 of file RemoteRobot.cpp.

+ Here is the call graph for this function:

◆ getRootNode()

RobotNodePtr getRootNode ( ) const
override

Definition at line 81 of file RemoteRobot.cpp.

+ Here is the call graph for this function:

◆ getScaling()

float getScaling ( )

Definition at line 190 of file RemoteRobot.cpp.

◆ getSharedRobot()

SharedRobotInterfacePrx getSharedRobot ( ) const

Use this method to share the robot instance over Ice.

Definition at line 195 of file RemoteRobot.cpp.

◆ hasEndEffector()

bool hasEndEffector ( const std::string &  endEffectorName) const
overrideprotected

Not implemented yet.

Definition at line 530 of file RemoteRobot.cpp.

◆ hasRobotNode() [1/2]

bool hasRobotNode ( const std::string &  robotNodeName) const
override

Definition at line 91 of file RemoteRobot.cpp.

◆ hasRobotNode() [2/2]

bool hasRobotNode ( VirtualRobot::RobotNodePtr  ) const
override

◆ hasRobotNodeSet()

bool hasRobotNodeSet ( const std::string &  name) const
override

Definition at line 160 of file RemoteRobot.cpp.

◆ registerEndEffector()

void registerEndEffector ( VirtualRobot::EndEffectorPtr  endEffector)
overrideprotected

Not implemented yet.

Definition at line 546 of file RemoteRobot.cpp.

◆ registerRobotNode()

void registerRobotNode ( VirtualRobot::RobotNodePtr  node)
overrideprotected

Not implemented yet.

Definition at line 542 of file RemoteRobot.cpp.

◆ registerRobotNodeSet()

void registerRobotNodeSet ( VirtualRobot::RobotNodeSetPtr  nodeSet)
overrideprotected

Not implemented yet.

Definition at line 544 of file RemoteRobot.cpp.

◆ setGlobalPose()

void setGlobalPose ( const Eigen::Matrix4f &  globalPose,
bool  applyValues = true 
)
overrideprotected

Sets the global pose of the robot.

Parameters
globalPosenew global pose
applyValuesNo effect. Will be always applied.

Definition at line 548 of file RemoteRobot.cpp.

◆ setRootNode()

void setRootNode ( VirtualRobot::RobotNodePtr  node)
overrideprotected

Not implemented yet.

Definition at line 541 of file RemoteRobot.cpp.

◆ synchronizeLocalClone() [1/2]

bool synchronizeLocalClone ( VirtualRobot::RobotPtr  robot,
RobotStateComponentInterfacePrx  robotStatePrx 
)
static

Use this method to synchronize (i.e. copy the joint values) from the remote robot to the local clone. The local clone must have the identical structure as the remote robot model, otherwise an error will be reported. This is the fastest way to get update a local robot.

Definition at line 448 of file RemoteRobot.cpp.

+ Here is the caller graph for this function:

◆ synchronizeLocalClone() [2/2]

bool synchronizeLocalClone ( VirtualRobot::RobotPtr  robot,
SharedRobotInterfacePrx  sharedRobotPrx 
)
static

Definition at line 453 of file RemoteRobot.cpp.

+ Here is the call graph for this function:

◆ synchronizeLocalCloneToState()

bool synchronizeLocalCloneToState ( VirtualRobot::RobotPtr  robot,
RobotStateConfig const &  state 
)
static

Definition at line 497 of file RemoteRobot.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ synchronizeLocalCloneToTimestamp()

bool synchronizeLocalCloneToTimestamp ( VirtualRobot::RobotPtr  robot,
RobotStateComponentInterfacePrx  robotStatePrx,
Ice::Long  timestamp 
)
static

Synchronizes a local robot to a robot state at timestamp.

Parameters
robotLocal robot that should be updated
robotStatePrxProxy to the RobotStateComponent
timestampTimestamp to which the local robot should be sychronized. Must be in range of the state history of the RobotStateComponent.
Returns
True if successfully synced.

Definition at line 487 of file RemoteRobot.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ _cachedNodes

std::map<std::string, VirtualRobot::RobotNodePtr> _cachedNodes
mutableprotected

Definition at line 255 of file RemoteRobot.h.

◆ _robot

SharedRobotInterfacePrx _robot
protected

Definition at line 254 of file RemoteRobot.h.

◆ _root

VirtualRobot::RobotNodePtr _root
mutableprotected

Definition at line 256 of file RemoteRobot.h.

◆ m

std::recursive_mutex m
staticprotected

Definition at line 258 of file RemoteRobot.h.


The documentation for this class was generated from the following files: